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

Error responses from certain operations do not conform to ODataV4 #19665

Closed
fhoy opened this issue Jul 6, 2021 · 6 comments
Closed

Error responses from certain operations do not conform to ODataV4 #19665

fhoy opened this issue Jul 6, 2021 · 6 comments
Assignees
Labels
App Services customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@fhoy
Copy link

fhoy commented Jul 6, 2021

  • Package Name: azure-mgmt-web
  • Package Version: 2.0.0
  • Operating System: n/a
  • Python Version: n/a

Describe the bug
Certain server-side failures produce error responses that do not conform to ODataV4, which means that the standard handling drops error details.

To my understanding, the OData section on error handling requires keys (code, message, etc.) to be lower-case, and the SDK code that parses error responses is implemented as such. However, in certain situations, we have observed the error responses to return title-cased keys (Code, Message, etc.), which causes the parsing code to raise a ValueError. A specific example is the following, that was returned when a call to web_apps.create_or_update_swift_virtual_network_connection() (using the default API-version, 2020-09-01), resulted in a 409 Conflict:

{"Code":"Conflict","Message":"Subnet X in VNET Y is already occupied by service S.","Target":null,"Details":[{"Message":"Subnet X in VNET Y is already occupied by service S."},{"Code":"Conflict"},{"ErrorEntity":{"ExtendedCode":"55914","MessageTemplate":"Subnet {0} in VNET {1} is already occupied by service {2}.","Parameters":[X,Y,S],"Code":"Conflict","Message":"Subnet X in VNET Y is already occupied by service S."}}],"Innererror":null}

Interestingly enough, forcing an error through running web_apps.get_swift_virtual_network_connection() and giving a non-existing service name leads to a 404 Not Found, with a correctly formatted response.

To Reproduce
Call web_apps.create_or_update_swift_virtual_network_connection() (using the default API-version, 2020-09-01) with a setup that results in a 409 Conflict.

Expected behavior
The error response conforms to the OData spec, for all operations.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 6, 2021
@kristapratico kristapratico added App Services Mgmt This issue is related to a management-plane library. Service Attention Workflow: This issue is responsible by Azure service team. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jul 6, 2021
@ghost
Copy link

ghost commented Jul 6, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp, @AzureAppServiceCLI.

Issue Details
  • Package Name: azure-mgmt-web
  • Package Version: 2.0.0
  • Operating System: n/a
  • Python Version: n/a

Describe the bug
Certain server-side failures produce error responses that do not conform to ODataV4, which means that the standard handling drops error details.

To my understanding, the OData section on error handling requires keys (code, message, etc.) to be lower-case, and the SDK code that parses error responses is implemented as such. However, in certain situations, we have observed the error responses to return title-cased keys (Code, Message, etc.), which causes the parsing code to raise a ValueError. A specific example is the following, that was returned when a call to web_apps.create_or_update_swift_virtual_network_connection() (using the default API-version, 2020-09-01), resulted in a 409 Conflict:

{"Code":"Conflict","Message":"Subnet X in VNET Y is already occupied by service S.","Target":null,"Details":[{"Message":"Subnet X in VNET Y is already occupied by service S."},{"Code":"Conflict"},{"ErrorEntity":{"ExtendedCode":"55914","MessageTemplate":"Subnet {0} in VNET {1} is already occupied by service {2}.","Parameters":[X,Y,S],"Code":"Conflict","Message":"Subnet X in VNET Y is already occupied by service S."}}],"Innererror":null}

Interestingly enough, forcing an error through running web_apps.get_swift_virtual_network_connection() and giving a non-existing service name leads to a 404 Not Found, with a correctly formatted response.

To Reproduce
Call web_apps.create_or_update_swift_virtual_network_connection() (using the default API-version, 2020-09-01) with a setup that results in a 409 Conflict.

Expected behavior
The error response conforms to the OData spec, for all operations.

Author: fhoy
Assignees: -
Labels:

App Services, Mgmt, Service Attention, customer-reported, question

Milestone: -

@kristapratico
Copy link
Member

Thanks for your question, we'll investigate and report back.

@RAY-316 RAY-316 self-assigned this Jul 21, 2021
@BigCat20196
Copy link
Contributor

Hi @fhoy Thanks for the feedback!

The latest azure-mgmt-web version is 3.0.0. In this version, create_or_update_swift_virtual_network_connection_with_check operation replaces create_or_update_swift_virtual_network_connection operation.

It is recommended to upgrade the version and try again. The problem may have been fixed.

Please kindly let us know if it solves the issue.

@BigCat20196 BigCat20196 self-assigned this Jul 27, 2021
@xiangyan99 xiangyan99 added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Dec 3, 2021
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Dec 10, 2021
@ghost
Copy link

ghost commented Dec 10, 2021

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@RAY-316 RAY-316 added the issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. label Dec 15, 2021
@ghost ghost removed the no-recent-activity There has been no recent activity on this issue. label Dec 15, 2021
@ghost
Copy link

ghost commented Dec 15, 2021

Hi @fhoy. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

@ghost ghost removed the needs-author-feedback Workflow: More information is needed from author to address the issue. label Dec 15, 2021
@ghost
Copy link

ghost commented Dec 22, 2021

Hi @fhoy, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.

@ghost ghost closed this as completed Dec 22, 2021
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-python that referenced this issue Jul 21, 2022
Review request for Microsoft.ContainerService to add version 2022-06-01 (Azure#19848)

* Adds base for updating Microsoft.ContainerService from version stable/2022-04-01 to version 2022-06-01

* Updates readme

* Updates API version in new specs and examples

* update readmes (Azure#19421)

* Add key management service profile of a managed cluster for version 2022-06-01 (Azure#19529)

* Add NetworkPlugin none option to 2022-06-01 (Azure#19510)

* Add NetworkPlugin none option to 2022-06-01

* improve description for none value

* Fix violated rule R4041 for 2022-06-01 managedCluster swagger (Azure#19581)

* remove useless directive

* fix R4041

* GA AKS support for Dedicated Host Group (Azure#19547)

* GA AKS support for Dedicated Host Group

* fit some format minor issue

* add newline in end of files

* Defender updates (Azure#19665)

* Defender updates

* sample

* remove old description

Co-authored-by: Bin Xia <[email protected]>
Co-authored-by: Matt Stam <[email protected]>
Co-authored-by: Jianping Zeng <[email protected]>
Co-authored-by: Or Parnes <[email protected]>
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-python that referenced this issue Aug 1, 2022
Compute update folder structure (Azure#19723)

* update folder structure

* small errors and CI check

* [Language Text] Update swagger titles (Azure#19835)

* [Language Text] Update swagger titles

* edits

* address feedback

* Review request for Microsoft.ContainerService to add version 2022-06-01 (Azure#19848)

* Adds base for updating Microsoft.ContainerService from version stable/2022-04-01 to version 2022-06-01

* Updates readme

* Updates API version in new specs and examples

* update readmes (Azure#19421)

* Add key management service profile of a managed cluster for version 2022-06-01 (Azure#19529)

* Add NetworkPlugin none option to 2022-06-01 (Azure#19510)

* Add NetworkPlugin none option to 2022-06-01

* improve description for none value

* Fix violated rule R4041 for 2022-06-01 managedCluster swagger (Azure#19581)

* remove useless directive

* fix R4041

* GA AKS support for Dedicated Host Group (Azure#19547)

* GA AKS support for Dedicated Host Group

* fit some format minor issue

* add newline in end of files

* Defender updates (Azure#19665)

* Defender updates

* sample

* remove old description

Co-authored-by: Bin Xia <[email protected]>
Co-authored-by: Matt Stam <[email protected]>
Co-authored-by: Jianping Zeng <[email protected]>
Co-authored-by: Or Parnes <[email protected]>

* Update resources.json (Azure#19861)

* Pattts/predictive autoscale 20221001 (Azure#19765)

* Rev Autoscale API from 2021-05-01-preview to 2022-10-01.

* Fix minor swagger issue. Default should be 'false'

* Fix swagger validation error

* Defining a new package 2022-10

* AutoscaleSettingResource now reference allOf 'resource' which is the actual autoscaleSetting resource definition

* Fix require property issue

* Run prettier against autoscale_API.json

* [Maps - Render & Spatial Services] add v2022-08-01 (Azure#19520)

* copy old swagger to new folders

* set api version to 2022-08-01

* apply api changes

Co-authored-by: Gigi Grajo <[email protected]>

* update appconfiguration (Azure#19330)

* update appconfiguration

* Update readme.python.md

* Update readme.python.md

* Update readme.python.md

* Update readme.python.md

* Update readme.python.md

* Update readme.python.md

* Update readme.python.md

* [Hub Generated] Publish private branch 'main' (Azure#19852)

* Add StorageMover specification for PubliC Preview

* SpellCheck fix

* Update custom-words

* Update specification/storagemover/resource-manager/readme.md

Co-authored-by: Abhishek Krishna <[email protected]>
Co-authored-by: Dapeng Zhang <[email protected]>

* Merging Dynatrace swagger in stable folder (Azure#19862)

* Committing base swagger version

* Removing preview tag from stable folder api version

* Changing version name in all the files

* Updating readme.go and readme.md files

* [CDN] Fix customDomains property type in Endpoint (Azure#19788)

* [CDN] Fix customDomains property type in Endpoint

* Fix linter error

Co-authored-by: Bo Zhang <[email protected]>

* Adding Microsoft.Sql AdvancedThreatProtectionSettings APIs for MI on v5 tag for 2022-02-01-preview (Azure#19866)

* update folders

* [Hub Generated] Review request for Microsoft.KeyVault to add version stable/7.3 (Azure#19844)

* Update description of exportable attribute and release_policy.data

* Remove submodule azure-reset-api-specs

* Fix description for exportable

Co-authored-by: Sunny Solanki <[email protected]>

* Add latest StorageMover updates (Azure#19876)

* Add StorageMover specification for PubliC Preview

* SpellCheck fix

* Update custom-words

* Update specification/storagemover/resource-manager/readme.md

* Add latest StorageMover updates

Co-authored-by: Abhishek Krishna <[email protected]>
Co-authored-by: Dapeng Zhang <[email protected]>

* Update readme.python.md (Azure#19899)

* Update readme.python.md

* Update readme.md

* Moving files from azure-rest-spec-pr to azure-rest-spec repo after api review (Azure#19878)

* Moving files from azure-rest-spec-pr to azure-rest-spec repo after api review

* Add known words

* Removed static IP allocation only from examples (Azure#19858)

* Removed static IP allocation

* Removed static only from examples

Co-authored-by: Arpit Gagneja <[email protected]>

* Update securityinsights readme.python (Azure#19903)

* update securityinsights readme.python

* Update readme.python.md

Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>

* fix lint errors in Synapse trigger.json (Azure#19660)

* put json files into RP folders

* update readme

* Add CONTRIBUTING.md (Azure#19257)

* Add CONTRIBUTING.md

* Apply suggestions from PR review

Co-authored-by: Heath Stewart <[email protected]>

* Apply suggestions from PR review

Co-authored-by: Weidong Xu <[email protected]>

* Regen toc for CONTRIBUTING.md

* Address PR review comments

* Address PR review comments

Co-authored-by: Heath Stewart <[email protected]>
Co-authored-by: Weidong Xu <[email protected]>

* fix devcenter readme.go.md config (Azure#19906)

* fix readme.go.md config

* rename to SkuInfo

* add annotation for labservices (Azure#19884)

* add to description of OS state (Azure#19764)

* [Hub Generated] Review request for Microsoft.KeyVault to add version preview/2021-06-01-preview (Azure#19767)

* Updated the managed hsm resource manager spec to include two additional properties for private endpoint connection item

* Update managed hsm private endpoint connection item in mhsm spec for latest api version

* Address LRO_RESPONSE_HEADER violation for managed hsm

Long running operations that are annotated with x-ms-long-running-operation:true
must return location header or azure-AsyncOperation in response.
Added the missing location header for managed hsm update command as well as to the corresponding
examples.

* [Microsoft.DeviceUpdate] Adding first stable API version (Azure#19846)

* Copied the most recent preview version into the first stable version

* Updated api version in new stable version, added the tag to readme.md

* Fixed typo

* Fixed the wrong path in readme.md

* Reverted VS Code automatic breaking change

* Fix broken link (Azure#19688)

* add aadObjectId property to kustoPool (Azure#19856)

Co-authored-by: Amit Elran <[email protected]>

* Updata securityinsights readme.python (Azure#19917)

* update securityinsights readme.python

* update readme.python

Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>

* modify readme.typescripy.md for compute package (Azure#19607)

Co-authored-by: ZiWei Chen (WICRESOFT NORTH AMERICA LTD) <[email protected]>

* Dev gubalasu frontdoor microsoft.network 2021 06 01 (Azure#19578)

* Adds base for updating Microsoft.Network from version stable/2020-05-01 to version 2021-06-01

* Updates readme

* Updates API version in new specs and examples

* update waf configs and examples from 2020-11-01

* Update api version in new specs and examples

* Migration api update

* Update readme

* Fix readme

* update readme

* Fix readme again

* Fix readme

* Fix readme

* update waf policy provisioning state

* Update securityinsights readme.python (Azure#19923)

* update securityinsights readme.python

* update readme.python

* last modify

* Update readme.python.md

Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>

* sync with changes made to master

* update folder structure

* small errors and CI check

* update folders

* put json files into RP folders

* update readme

* resolve capitalization and number misplacement accident

Co-authored-by: Theodore Chang <[email protected]>
Co-authored-by: Deyaaeldeen Almahallawi <[email protected]>
Co-authored-by: FumingZhang <[email protected]>
Co-authored-by: Bin Xia <[email protected]>
Co-authored-by: Matt Stam <[email protected]>
Co-authored-by: Jianping Zeng <[email protected]>
Co-authored-by: Or Parnes <[email protected]>
Co-authored-by: Alexander Batishchev <[email protected]>
Co-authored-by: PatrickTseng <[email protected]>
Co-authored-by: gigi <[email protected]>
Co-authored-by: Gigi Grajo <[email protected]>
Co-authored-by: zhenbiao wei <[email protected]>
Co-authored-by: Abhishek Krishna <[email protected]>
Co-authored-by: Abhishek Krishna <[email protected]>
Co-authored-by: Dapeng Zhang <[email protected]>
Co-authored-by: Divyansh Agarwal <[email protected]>
Co-authored-by: t-bzhan <[email protected]>
Co-authored-by: Bo Zhang <[email protected]>
Co-authored-by: Uriel Cohen <[email protected]>
Co-authored-by: susolank <[email protected]>
Co-authored-by: Sunny Solanki <[email protected]>
Co-authored-by: Ralf Beckers <[email protected]>
Co-authored-by: arpit-gagneja <[email protected]>
Co-authored-by: Arpit Gagneja <[email protected]>
Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>
Co-authored-by: YanjunGao <[email protected]>
Co-authored-by: Mike Kistler <[email protected]>
Co-authored-by: Heath Stewart <[email protected]>
Co-authored-by: Weidong Xu <[email protected]>
Co-authored-by: Jiahui Peng <[email protected]>
Co-authored-by: j-zhong-ms <[email protected]>
Co-authored-by: Tom FitzMacken <[email protected]>
Co-authored-by: neeerajaakula <[email protected]>
Co-authored-by: darkoa-msft <[email protected]>
Co-authored-by: Roy Wellington <[email protected]>
Co-authored-by: Amit Elran <[email protected]>
Co-authored-by: Amit Elran <[email protected]>
Co-authored-by: kazrael2119 <[email protected]>
Co-authored-by: ZiWei Chen (WICRESOFT NORTH AMERICA LTD) <[email protected]>
Co-authored-by: gubalasu <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
App Services customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

6 participants