SharePoint Online responds with HTTP 400 bad request from time to time since April 16, 2021

Brass Contributor

We are using CSOM to communicate with SharePoint Online.

 

Since April 16th, 2021 we recognize http 400 responses from different parts of our code using CSOM calls from time to time. We added status 400 to our internal retry logic. Executing the same call a few seconds later succeeds. So pretty much a wrong status code.

 

It seems like SharePoint should generate a 429 throttling response at that time and somehow generates an incorrect 400.

 

Does anybody else experience the same?

 

Regards Sven

4 Replies
Hey! Same here, many of our tenants suffer from the same HTTP 400 errors since approx. that date. We even used the same workaround to retry the CSOM calls, leveraging the retry mechanism for throttling. It seems to work but... people from MS, is this the right way?

Let me add more info to this. Since those dates, apart from the HTTP 400 errors with CSOM, we've also started to experience many other errors in these same tenants, in many different situations:
- Several times loading a SharePoint site collection in the browser (even before authenticating) shows an ASP.NET error.
- OAuth negotiation for SharePoint add-ins returns 403 many times.
- SharePoint Online PowerShell CMDlets are returning frequent "Unknown Error"'s:
- When retrieving site collections (Get-SPOSite)
- When adding users (Add-SPOUser)

All this happens very frequently but none of it is reproducible with a specific set of steps. It happens sometimes (and when it happens, it seems to get stuck on it) and sometimes it doesn't.

Did MS do any SPO updates during those dates? Could someone provide any other insights? Thank you!!
Microsoft has fixed the issue on May 7th as reported here: https://github.com/SharePoint/sp-dev-docs/issues/6955

We could not find any http 400 failures in our logs after 5/7, so the fix seems to work in our case.
We are facing issue recently at below line in TokenHelper which raise in exception mentioned below the url. Till end of april 2021 it was working fine.

webClient.DownloadData(acsMetadataEndpointUrlWithRealm);

acsMetadataEndpointUrlWithRealm url like this :



https://accounts.accesscontrol.windows.net/metadata/json/1?realm=https://sample.sharepoint.com



Exception:



System.Net.WebException
HResult=0x80131509
Message=The remote server returned an error: (400) Bad Request. - {"error":"invalid_request","error_description":"AADSTS90002: Tenant 'https://sample.sharepoint.com' not found. This may happen if there are no active subscriptions for the tenant. Check to make sure you have the correct tenant ID.