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

Recovery Services API 2018-07-10 returns 400 rather than 404 when a Site Recovery Fabric cannot be found #12759

Open
tombuildsstuff opened this issue Feb 1, 2021 · 12 comments
Labels
Recovery Services Site-Recovery Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@tombuildsstuff
Copy link
Contributor

Upon upgrading from API version 2018-01-10 to API version 2018-07-10 - we've noticed that the Site Recovery Fabric API returns a 400, rather than a 404 when a Fabric does not exist, for example:

siterecovery.ReplicationFabricsClient#Get: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="The resource with ID 2195638768288125375 isn't registered with the service." Details=[{"activityId":"689647ac-7f72-7f8b-e344-93183a09e18a","clientRequestId":"6cac2a93-9f39-48f7-abb8-a62785eeaf97","code":"SubscriptionIdNotRegisteredWithSrs","message":"The resource with ID 2195638768288125375 isn't registered with the service.","possibleCauses":"The operation failed due to an internal error.","recommendedAction":"Retry the last action. If the issue persists, contact Support."}]

Can this API be fixed to match the Swagger definition and most the convention amongst API's here?

Thanks!

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 1, 2021
tombuildsstuff added a commit to MitchDrage/terraform-provider-azurerm that referenced this issue Feb 1, 2021
@ArcturusZhang ArcturusZhang added Recovery Services Site-Recovery Service Attention Workflow: This issue is responsible by Azure service team. labels Feb 2, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 2, 2021
@ghost
Copy link

ghost commented Feb 2, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Sharmistha-Rai.

Issue Details

Upon upgrading from API version 2018-01-10 to API version 2018-07-10 - we've noticed that the Site Recovery Fabric API returns a 400, rather than a 404 when a Fabric does not exist, for example:

siterecovery.ReplicationFabricsClient#Get: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="The resource with ID 2195638768288125375 isn't registered with the service." Details=[{"activityId":"689647ac-7f72-7f8b-e344-93183a09e18a","clientRequestId":"6cac2a93-9f39-48f7-abb8-a62785eeaf97","code":"SubscriptionIdNotRegisteredWithSrs","message":"The resource with ID 2195638768288125375 isn't registered with the service.","possibleCauses":"The operation failed due to an internal error.","recommendedAction":"Retry the last action. If the issue persists, contact Support."}]

Can this API be fixed to match the Swagger definition and most the convention amongst API's here?

Thanks!

Author: tombuildsstuff
Assignees: zhenglaizhang
Labels:

Recovery Services Site-Recovery, Service Attention, needs-triage, question

Milestone: -

@ArcturusZhang ArcturusZhang removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Feb 2, 2021
@Sharmistha-Rai
Copy link

Hi @tombuildsstuff - thank you for bringing this to our attention. This looks like a bug. Let me check this with our team and confirm.

@tombuildsstuff
Copy link
Contributor Author

Actually it appears this is also broken in 2018-01-10 too, so it appears that both API's are affected.

@Sharmistha-Rai
Copy link

@tombuildsstuff

We use the Resource ID, that you have also passed, to check for Fabric's existence. But it seems like the registration for the resource ID that you're passing is missing. As the registration is missing, we are not able to fetch the fabric itself and it was never checked.

So, this 400 response which you received is for the missing registration. If the fabric is missing, then we continue to throw the error 404.

This is not a bug, this is expected behavior.

@tombuildsstuff
Copy link
Contributor Author

@Sharmistha-Rai if a resource doesn't exist (which in this case a missing registration for this resource against the Recovery Service Fabric would indicate) - then the ARM spec expects this to be a 404. This is the same when accessing children of parent items - if the parent doesn't exist then child endpoints/routes must return a 404.

Whilst I can appreciate a 400 could be returned were this part of the payload (for example referencing another resource that doesn't exist in the HTTP Body) - a 404 must be returned since this issue is coming from the URI, as per the ARM spec afaik - as such I believe this is an API bug?

It's worth noting introducing a 400 rather than a 404 as this was previously is a breaking change too?

Thanks!

@Sharmistha-Rai
Copy link

@tombuildsstuff - We have decided to take up the work required for fixing this issue. We plan to release a fix in our upcoming update, so please look forward for a fix in our March release. It should be live in all geos by end of March.

Please close this thread once you find some time. You can open in again once you have tested out the fix.

@tombuildsstuff
Copy link
Contributor Author

@Sharmistha-Rai thanks for the update, that's great.

Since this is an active API Bug, I'm going to leave this open until the issue is resolved though - but we'll close this once we can confirm this has been rolled out around the end of the month, as otherwise folks may believe this has been fixed (since the issues closed preemptively).

Thanks!

@jenny-curry
Copy link

@Sharmistha-Rai Any update on this issue?

@Sharmistha-Rai
Copy link

Hi @jmeadowcroft -
Sorry for the delay.
We are already in the process of releasing a fix for this issue in our April release. We had no new release in the month of March, thus couldn't fix this earlier.

@samhodgkinson
Copy link

I came across this issue today, did this fix get pushed ?

checking for presence of existing site recovery replication policy XXXXXXXX : siterecovery.ReplicationPoliciesClient#Get: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="The resource with ID 3917603715439329859 isn't registered with the service." Details=[{"activityId":"ab28e994-2ae0-9387-76ef-2f45d8744a10","clientRequestId":"e67f6cc8-4610-4c19-86fa-dc3016d43055","code":"SubscriptionIdNotRegisteredWithSrs","message":"The resource with ID 3917603715439329859 isn't registered with the service.","possibleCauses":"The operation failed due to an internal error.","recommendedAction":"Retry the last action. If the issue persists, contact Support."}]

@ziyeqf
Copy link
Contributor

ziyeqf commented Nov 22, 2022

It appears on ReplicationPolicies_Get with recoveryServicesSiteRecovery@2022-09-10 too.

Error: checking for presence of existing site recovery replication policy acctest-policy-221122161120485784: replicationpolicies.ReplicationPoliciesClient#Get: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="The resource with ID 3462117858533427629 isn't registered with the service." Details=[{"activityId":"49470e6d-0246-2ee8-55b5-033d457710d4","clientRequestId":"9e237ce5-d514-4307-af81-00537282d0ca","code":"SubscriptionIdNotRegisteredWithSrs","message":"The resource with ID 3462117858533427629 isn't registered with the service.","possibleCauses":"The operation failed due to an internal error.","recommendedAction":"Retry the last action. If the issue persists, contact Support."}]

@tombuildsstuff
Copy link
Contributor Author

ping @Sharmistha-Rai - any update here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Recovery Services Site-Recovery Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

8 participants
@tombuildsstuff @zhenglaizhang @samhodgkinson @ArcturusZhang @jenny-curry @ziyeqf @Sharmistha-Rai and others