Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking Change] Misleading error message: Runtime exception: ERROR: Schema violation: Data does not match any schemas from 'oneOf' #6998

Closed
konrad-jamrozik opened this issue Sep 20, 2023 · 4 comments
Assignees
Labels
Breaking Changes Improvements to Breaking Changes tooling Central-EngSys This issue is owned by the Engineering System team. Spec PR Tools Tooling that runs in azure-rest-api-specs repo.

Comments

@konrad-jamrozik
Copy link
Contributor

konrad-jamrozik commented Sep 20, 2023

Related work:

Investigation

Error message in the check run says:

"new":"https://github.com/Azure/azure-rest-api-specs/blob/0bac3d9045a1610fe2c5ede033df1df55b612525/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2023-01-01-preview/namespace-preview.json",
"old":"https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/namespace-preview.json",
"details":"Command failed: node "/mnt/vss/_work/_tasks/AzureApiValidation_5654d05d-82c1-48da-ad8f-161b817f6d41/0.0.59/common/temp/node_modules/.pnpm/https://github.com/[email protected]/node_modules/autorest/dist/app.js" --v2 --input-file=specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2023-01-01-preview/namespace-preview.json --output-artifact=swagger-document.json --output-artifact=swagger-document.map --output-file=new --output-folder=/tmp\nERROR: Schema violation: Data does not match any schemas from 'oneOf'\n - file:///mnt/vss/_work/1/azure-rest-api-specs/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2023-01-01-preview/namespace-preview.json:347:10 ($.paths["/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ServiceBus/namespaces/namespaceName/failover"].post["x-ms-examples"].NamespaceFailOver)\nFATAL: swagger-document/individual/schema-validator - FAILED\nFATAL: Error: [OperationAbortedException] Error occurred. Exiting.\nProcess() cancelled due to e"

Notably it says:

ERROR: Schema violation: Data does not match any schemas from 'oneOf'\n - file:///mnt/vss/_work/1/azure-rest-api-specs/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2023-01-01-preview/namespace-preview.json:347:10 ($.paths["/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ServiceBus/namespaces/namespaceName/failover"].post["x-ms-examples"].NamespaceFailOver

In the new spec file we can see:

    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/failover": {
      "post": {
        "tags": [
          "Namespaces Geo DR Failover"
        ],
        "operationId": "Namespaces_Failover",
        "x-ms-examples": {
          "NamespaceFailOver": {
            "$ref": "./examples/NameSpaces/SBNamespaceFailover.json"
          }
        },

The 347:10 location given in error message points to "NamespaceFailOver": {.

In the old spec file we can see

    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections": {
      "get": {
        "tags": [
          "Namespaces PrivateEndpointConnections"
        ],
        "operationId": "PrivateEndpointConnections_List",
        "x-ms-examples": {
          "NameSpaceCreate": {
            "$ref": "./examples/NameSpaces/PrivateEndPointConnectionList.json"
          }
        },

Looks like in the case of old spec the x-ms-examples had an entry for NameSpaceCreate and there was SBNameSpaceCreate.json example.

However, in the case of the new spec the x-ms-examples has an entry for NamespaceFailOver while there is SBNamespaceFailover.json example. The problem here appears to be the casing mismatch: NamespaceFailOver vs NamespaceFailover.

If this is not the root-cause, then maybe the contents of the SBNamespaceFailover.json does not adhere to the schema.

If none of the above are the root-cause, then an investigation by OpenAPI spec SME would help here.

Update 2023-09-20 11:59 PM PST

See this Teams discussion

Reference

@konrad-jamrozik konrad-jamrozik added Central-EngSys This issue is owned by the Engineering System team. Spec PR Tools Tooling that runs in azure-rest-api-specs repo. labels Sep 20, 2023
@konrad-jamrozik konrad-jamrozik self-assigned this Sep 20, 2023
@konrad-jamrozik konrad-jamrozik moved this from 🤔 Triage to 📋 Backlog in Azure SDK EngSys 🤖🧠 Sep 20, 2023
@konrad-jamrozik konrad-jamrozik moved this to 📋 Backlog in Spec PR Tools Sep 20, 2023
@konrad-jamrozik konrad-jamrozik added bug This issue requires a change to an existing behavior in the product in order to be resolved. Breaking Changes Improvements to Breaking Changes tooling and removed bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Sep 20, 2023
@konrad-jamrozik konrad-jamrozik changed the title [Breaking Change] Runtime exception: ERROR: Schema violation: Data does not match any schemas from 'oneOf' [Breaking Change] Misleading message for casing issue: Runtime exception: ERROR: Schema violation: Data does not match any schemas from 'oneOf' Sep 20, 2023
@konrad-jamrozik konrad-jamrozik changed the title [Breaking Change] Misleading message for casing issue: Runtime exception: ERROR: Schema violation: Data does not match any schemas from 'oneOf' [Breaking Change] Misleading error message: Runtime exception: ERROR: Schema violation: Data does not match any schemas from 'oneOf' Sep 20, 2023
@konrad-jamrozik konrad-jamrozik changed the title [Breaking Change] Misleading error message: Runtime exception: ERROR: Schema violation: Data does not match any schemas from 'oneOf' [Breaking Change] Misleading error message: Runtime exception: ERROR: Schema violation: Data does not match any schemas from 'oneOf' Sep 26, 2023
@konrad-jamrozik
Copy link
Contributor Author

For analysis of runtime error buckets, see:

@konrad-jamrozik konrad-jamrozik moved this from 📋 Backlog to 🐝 Dev in Azure SDK EngSys 🤖🧠 Sep 28, 2023
@konrad-jamrozik konrad-jamrozik moved this from 📋 Backlog to 🐝 In Progress in Spec PR Tools Sep 28, 2023
@konrad-jamrozik
Copy link
Contributor Author

Addressed by:

  • Pull Request 500754: Implement support for pretty-printing runtime errors originating from AutoRest invocation from within OAD (breaking change detector)

@github-project-automation github-project-automation bot moved this from 🐝 In Progress to 🎊 Closed in Spec PR Tools Sep 29, 2023
@github-project-automation github-project-automation bot moved this from 🐝 Dev to 🎊 Closed in Azure SDK EngSys 🤖🧠 Sep 29, 2023
@konrad-jamrozik
Copy link
Contributor Author

New Teams discussion here.

@konrad-jamrozik
Copy link
Contributor Author

This is how one can read the AutoRest runtime messages now:

image

The above comes from:
https://github.com/Azure/azure-rest-api-specs/pull/28080/checks?check_run_id=22780562664

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Changes Improvements to Breaking Changes tooling Central-EngSys This issue is owned by the Engineering System team. Spec PR Tools Tooling that runs in azure-rest-api-specs repo.
Projects
Archived in project
Status: 🎊 Closed
Development

No branches or pull requests

1 participant