Random CSOM 503 errors

%3CLINGO-SUB%20id%3D%22lingo-sub-1247390%22%20slang%3D%22en-US%22%3ERandom%20CSOM%20503%20errors%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1247390%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20am%20seeing%20random%20503%20errors%20in%20Fiddler%20when%20running%20CSOM%20code.%20As%20an%20example%20(using%20PnP%20ExecuteQueryRetry)%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3Eusing%20(var%20clientContext%20%3D%20new%20ClientContext(url))%0A%20%20%7B%0A%20%20%20%2F%2F%20(code%20to%20add%20credentials%20goes%20here)%0A%20%20%20clientContext.Load(clientContext.Web)%3B%0A%20%20%20var%20web%20%3D%20clientContext.Web%3B%0A%20%20%20var%20list%20%3D%20web.Lists.GetByTitle(%22Status%22)%3B%0A%20%20%20clientContext.Load(list)%3B%0A%20%20%20var%20StatusTask%20%3D%20list.GetItemById(2665)%3B%20%2F%2F%20using%20this%20item%20just%20to%20test%0A%20%20%20clientContext.Load(StatusTask%2C%20item%20%3D%26gt%3B%20item%5B%22Status%22%5D)%3B%0A%20%20%20clientContext.ExecuteQueryRetry()%3B%0A%20%20%20if%20(StatusTask%5B%22Status%22%5D.ToString()%20%3D%3D%20%22Status%22)%20%2F%2F%20this%20is%20where%20I%20get%20a%20C%23%20error%2C%20but%20in%20Fiddler%20I%20can%20already%20see%20the%20503%20error%0A%20%20%20%20%7B%0A%20%20%20%20%20%2F%2F%20do%20stuff%0A%20%20%20%20%7D%0A%20%20%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThis%20code%20works%20the%20vast%20majority%20of%20the%20time%2C%20but%20sometimes%20errors%20out%2C%20and%20it's%20only%20one%20call%20against%20SharePoint.%20If%20we%20have%20a%20process%20that%20runs%20ExecuteQuery()%20dozens%20of%20times%20(and%20we%20do)%2C%20it%20lowers%20our%20success%20rate%20quite%20a%20bit.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI've%20noticed%20various%20threads%20on%20Twitter%20today%20having%20this%20issue%20but%20wanted%20to%20post%20here%20in%20case%20other%20people%20are%20looking.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EExample%20twitter%20threads%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2FFrankyyh%2Fstatus%2F1242025700133081088%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftwitter.com%2FFrankyyh%2Fstatus%2F1242025700133081088%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fpwmather%2Fstatus%2F1242048897444446208%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftwitter.com%2Fpwmather%2Fstatus%2F1242048897444446208%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1247586%22%20slang%3D%22en-US%22%3ERe%3A%20Random%20CSOM%20503%20errors%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1247586%22%20slang%3D%22en-US%22%3EVery%20common%20issue%20those%20days%20with%20a%20lot%20of%20people%20working%20from%20home%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1249185%22%20slang%3D%22en-US%22%3ERe%3A%20Random%20CSOM%20503%20errors%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1249185%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5099%22%20target%3D%22_blank%22%3E%40Charles%20Willwerth%3C%2FA%3E%26nbsp%3BWe%20see%20this%20sporadically%20(and%20quite%20extensively)%20at%20multiple%20of%20our%20customers'%20tenants%20since%20last%20week.%20It%20has%20a%20huge%20impact%20on%20our%20ISV%20solutions.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20far%20we%20have%20seen%20no%20public%20information%20from%20MS%20about%20this%20issue%20even%20existing%20but%20it%20is%20very%20wide%20spread%20and%20seems%20to%20increase%20during%20hours%20of%20high%20demand.%20I%20guess%20it%20is%20related%20to%20more%20people%20using%20Teams%20and%20WFH%20and%20that%20this%20stresses%20the%20underlying%20infrastructure.%20But%20even%20so%2C%20we%20need%20offical%20information%20%2F%20recognition%20from%20MS!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1249480%22%20slang%3D%22en-US%22%3ERe%3A%20Random%20CSOM%20503%20errors%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1249480%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F79053%22%20target%3D%22_blank%22%3E%40Robert%20Lindgren%3C%2FA%3E%26nbsp%3BYes%2C%20I'd%20like%20to%20see%20it%20acknowledged%20by%20Microsoft.%20I%20don't%20think%20going%20through%20all%20code%20everywhere%20to%20have%20multiple%20retries%20on%20503%20errors%20is%20a%20good%20idea%20at%20this%20point%2C%20but%20any%20sort%20of%20support%20ticket%20request%20is%20met%20with%20%22hey%20can't%20support%20any%20custom%20scripting.%22%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hello,

I am seeing random 503 errors in Fiddler when running CSOM code. As an example (using PnP ExecuteQueryRetry):

 

using (var clientContext = new ClientContext(url))
  {
   // (code to add credentials goes here)
   clientContext.Load(clientContext.Web);
   var web = clientContext.Web;
   var list = web.Lists.GetByTitle("Status");
   clientContext.Load(list);
   var StatusTask = list.GetItemById(2665); // using this item just to test
   clientContext.Load(StatusTask, item => item["Status"]);
   clientContext.ExecuteQueryRetry();
   if (StatusTask["Status"].ToString() == "Status") // this is where I get a C# error, but in Fiddler I can already see the 503 error
    {
     // do stuff
    }
  }

 

 

This code works the vast majority of the time, but sometimes errors out, and it's only one call against SharePoint. If we have a process that runs ExecuteQuery() dozens of times (and we do), it lowers our success rate quite a bit.

 

I've noticed various threads on Twitter today having this issue but wanted to post here in case other people are looking. 

Example twitter threads: 

https://twitter.com/Frankyyh/status/1242025700133081088

https://twitter.com/pwmather/status/1242048897444446208

3 Replies
Highlighted
Very common issue those days with a lot of people working from home
Highlighted

@Charles Willwerth We see this sporadically (and quite extensively) at multiple of our customers' tenants since last week. It has a huge impact on our ISV solutions.

 

So far we have seen no public information from MS about this issue even existing but it is very wide spread and seems to increase during hours of high demand. I guess it is related to more people using Teams and WFH and that this stresses the underlying infrastructure. But even so, we need offical information / recognition from MS!

Highlighted

@Robert Lindgren Yes, I'd like to see it acknowledged by Microsoft. I don't think going through all code everywhere to have multiple retries on 503 errors is a good idea at this point, but any sort of support ticket request is met with "hey can't support any custom scripting."