Random 500 internal server errors with different APIs and operations at SharePoint Online
Category
[X] Bug [ ] Enhancement
Environment
[X] Office 365 / SharePoint Online [ ] SharePoint 2016 [ ] SharePoint 2013
Expected or Desired Behavior
Template is applied without errors (or at least with detailed errors)
Observed Behavior
We get an Intermittant 500 server error on applying a template with the following tracelog:
powershell.exe Information: 0 : 2019-10-08 14:40:40.6587 [OfficeDevPnP.Core] [0] [Information] Adding field (382aae1d-7054-4b5d-85ca-ead7dfdd96f0) to content type (0x01010043443884AE06CF4D9F9C2D75C47BF75A). 0ms
powershell.exe Information: 0 : 2019-10-08 14:40:42.7683 [OfficeDevPnP.Core] [0] [Information] Adding field (eea8f2b4-9508-46a0-9f42-69008561a746) to content type (0x01010043443884AE06CF4D9F9C2D75C47BF75A). 0ms
powershell.exe Error: 0 : 2019-10-08 14:40:42.8361 [OfficeDevPnP.Core] [0] [Error] ExecuteQuery threw following exception: System.Net.WebException: De externe server heeft een fout geretourneerd: (500) Interne serverfout.
bij System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
bij System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bij Microsoft.SharePoint.Client.SPWebRequestExecutor.<ExecuteAsync>d__0.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bij Microsoft.SharePoint.Client.ClientRequest.<ExecuteQueryToServerAsync>d__6.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bij Microsoft.SharePoint.Client.ClientRequest.<ExecuteQueryAsync>d__0.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bij Microsoft.SharePoint.Client.ClientRuntimeContext.<ExecuteQueryAsync>d__0.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bij Microsoft.SharePoint.Client.ClientContext.<ExecuteQueryAsync>d__4.MoveNext()
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bij Microsoft.SharePoint.Client.ClientContextExtensions.<ExecuteQueryImplementation>d__7.MoveNext(). 0ms
powershell.exe Information: 0 : 2019-10-08 14:40:42.8371 [Content Types] [15] [Debug] Code execution scope ended 115033ms 57b414c0-2d01-471d-b956-b5bab9c3667f
powershell.exe Information: 0 : 2019-10-08 14:40:42.8371 [Provisioning] [15] [Debug] Code execution scope ended 168283ms 57b414c0-2d01-471d-b956-b5bab9c3667f
Steps to Reproduce
execute the following PowerShell:
Apply-PnPProvisioningTemplate -Path "C:\temp\SiteTemplate(1).xml" -Verbose
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Similar error here but with c#. 2 days ago we have applied Templates to created sites without any problem.
2019-11-14 10:28:09,594 ERROR MSF_Meetig_Site_v2.Program - ERROR: The remote server returned an error: (500) Internal Server Error.
2019-11-14 10:28:09,595 ERROR MSF_Meetig_Site_v2.Program - STACK:
2019-11-14 10:28:09,630 ERROR MSF_Meetig_Site_v2.Program - at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.SPWebRequestExecutor.
Any solution?
Kind regards,
We still see the same behaviour in our logging system. In our Provisioning solution we retry applying the template for 2 times (so 3 in total) this seems to cover most of the scenarios where we get these errors but that sometimes causes massive delays in provisoning a ready-to-use collaboration environment while some templates might take up to 30 minutes to apply. Depending on in what stage of the template the error is thrown it can take up to 2 to 3 times the normal time to get a fully operational site.
Same here, yesterday for some sites we had to retry more than 5 times, being a mess for our customer :(
We have been encountering the same issue over the last 2 months or so. From our logging it seems to happen across different stages of the provisioning, sometimes after configuring Search Settings, sometimes during configuring List Instances.
I can confirm I have the same issue as well. I had a provisioning script that worked just fine up until 1-2 weeks ago.
Now all of a sudden the provisioning engine stops at what I can only describe as random points in the XML execution, just like @richardb52 testifies as well. Sometimes it stops right away when applying security, sometimes after applying site settings and sometimes when updating/creating a list.
What is always happening though is that the code execution stops with the error "The remote server returned an error: (500) Internal Server Error."
I can confirm I have the same issue as well.
"The remote server returned an error: (500) Internal Server Error."
We see an increasing number of 500 errors on multiple environments since a couple of hours. The service health message points out it's a 'global' issue

we are also facing the same issue. At various stages of the site creation it gives the "500 Internal Server error". Also noted that it took 20 minutes to create a modern communication site using the provisioning engine.
We are also experiencing this issue, we can stumble our way through by continually trying to apply the template again and again, but that's not really a feasible solution.
Since today we are also facing the same issue. The same template can be provisioned several times without any problem, but next several times comes this error.
Same issue here.
Same issue .
Same issue on several tenants. Random Internal Server Errors when deploying a template.
same issue on multiple tenants
During the last weeks/month the overall SPO infractructure is getting worse and worse. This is a really annoying situation for us and all of our customers. Again a great firework of new UI features Microsoft announced at Inspire but there is no single word about Microsoft's invest in hardening or performance improvements for the overall infrastructure... (Mostly all of our customer tenants have a SharePoint Healthscore greater 7 ;-( )
And what is even more frustrating is the overall Communication of Microsoft! The so called "Network Incident" they notified about yesterday (see above) was visible for 2 hours...
@VesaJuvonen @PaoloPia @
same issue here on several tenants.
Same issue, it fails at different steps on multiple tenants.
Same issue for me on several tenants. 500 server errors randomly retrieve when try apply template. Situation went wrong couple of days ago.
We have lot of provisioning systems based on pnp templating and situation is frustrating for me when i must repeat and repeat provisioning manually for each individual fail.
Same issue here. Has anyone reported this one to support?
My experience is that they will point to PnP and close the issue. Maybe we could join forces - I am happy to escalate to our account manager at MSFT