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

%3CLINGO-SUB%20id%3D%22lingo-sub-2291487%22%20slang%3D%22en-US%22%3ESharePoint%20Online%20responds%20with%20HTTP%20400%20bad%20request%20from%20time%20to%20time%20since%20April%2016%2C%202021%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2291487%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20are%20using%20CSOM%20to%20communicate%20with%20SharePoint%20Online.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESince%20April%2016th%2C%202021%20we%20recognize%20http%20400%20responses%20from%20different%20parts%20of%20our%20code%20using%20CSOM%20calls%20from%20time%20to%20time.%20We%20added%20status%20400%20to%20our%20internal%20retry%20logic.%20Executing%20the%20same%20call%20a%20few%20seconds%20later%20succeeds.%20So%20pretty%20much%20a%20wrong%20status%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20seems%20like%20SharePoint%20should%20generate%20a%20429%20throttling%20response%20at%20that%20time%20and%20somehow%20generates%20an%20incorrect%20400.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anybody%20else%20experience%20the%20same%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%20Sven%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2334836%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20responds%20with%20HTTP%20400%20bad%20request%20from%20time%20to%20time%20since%20April%2016%2C%202021%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2334836%22%20slang%3D%22en-US%22%3EHey!%20Same%20here%2C%20many%20of%20our%20tenants%20suffer%20from%20the%20same%20HTTP%20400%20errors%20since%20approx.%20that%20date.%20We%20even%20used%20the%20same%20workaround%20to%20retry%20the%20CSOM%20calls%2C%20leveraging%20the%20retry%20mechanism%20for%20throttling.%20It%20seems%20to%20work%20but...%20people%20from%20MS%2C%20is%20this%20the%20right%20way%3F%3CBR%20%2F%3E%3CBR%20%2F%3ELet%20me%20add%20more%20info%20to%20this.%20Since%20those%20dates%2C%20apart%20from%20the%20HTTP%20400%20errors%20with%20CSOM%2C%20we've%20also%20started%20to%20experience%20many%20other%20errors%20in%20these%20same%20tenants%2C%20in%20many%20different%20situations%3A%3CBR%20%2F%3E-%20Several%20times%20loading%20a%20SharePoint%20site%20collection%20in%20the%20browser%20(even%20before%20authenticating)%20shows%20an%20ASP.NET%20error.%3CBR%20%2F%3E-%20OAuth%20negotiation%20for%20SharePoint%20add-ins%20returns%20403%20many%20times.%3CBR%20%2F%3E-%20SharePoint%20Online%20PowerShell%20CMDlets%20are%20returning%20frequent%20%22Unknown%20Error%22's%3A%3CBR%20%2F%3E-%20When%20retrieving%20site%20collections%20(Get-SPOSite)%3CBR%20%2F%3E-%20When%20adding%20users%20(Add-SPOUser)%3CBR%20%2F%3E%3CBR%20%2F%3EAll%20this%20happens%20very%20frequently%20but%20none%20of%20it%20is%20reproducible%20with%20a%20specific%20set%20of%20steps.%20It%20happens%20sometimes%20(and%20when%20it%20happens%2C%20it%20seems%20to%20get%20stuck%20on%20it)%20and%20sometimes%20it%20doesn't.%3CBR%20%2F%3E%3CBR%20%2F%3EDid%20MS%20do%20any%20SPO%20updates%20during%20those%20dates%3F%20Could%20someone%20provide%20any%20other%20insights%3F%20Thank%20you!!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2344061%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20responds%20with%20HTTP%20400%20bad%20request%20from%20time%20to%20time%20since%20April%2016%2C%202021%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2344061%22%20slang%3D%22en-US%22%3EMicrosoft%20has%20fixed%20the%20issue%20on%20May%207th%20as%20reported%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-docs%2Fissues%2F6955%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-docs%2Fissues%2F6955%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20could%20not%20find%20any%20http%20400%20failures%20in%20our%20logs%20after%205%2F7%2C%20so%20the%20fix%20seems%20to%20work%20in%20our%20case.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2374640%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20responds%20with%20HTTP%20400%20bad%20request%20from%20time%20to%20time%20since%20April%2016%2C%202021%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2374640%22%20slang%3D%22en-US%22%3EThank%20you%20Sven!%3C%2FLINGO-BODY%3E
New 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.