[X] Bug
[ ] Enhancement
[X] Office 365 / SharePoint Online
[ ] SharePoint 2016
[ ] SharePoint 2013
PnP Provisioning engine fails setting the default content type while creating document libraries or lists since this week but i think it more of a server side issue because it can be reproduced also on UI by enabling content type management on the list settings or changing the content type order / setting default content type. The error is always the same: Object reference not set to an instance of an object.
Microsoft.SharePoint.Client.ServerException: Object reference not set to an instance of an object.
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientRequest.d__6.MoveNext()
--- 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.ClientRequest.d__0.MoveNext()
--- 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.ClientRuntimeContext.d__0.MoveNext()
--- 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.ClientContext.d__4.MoveNext()
--- 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.ClientContextExtensions.d__7.MoveNext()
--- 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.ClientContextExtensions.ExecuteQueryRetry(ClientRuntimeContext clientContext, Int32 retryCount, Int32 delay, String userAgent)
at Microsoft.SharePoint.Client.FieldAndContentTypeExtensions.SetDefaultContentType(List list, ContentTypeId contentTypeId)
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectListInstance.ConfigureContentTypes(Web web, List list, ListInstance templateList, Boolean isNewList, PnPMonitoredScope scope)
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectListInstance.CreateList(Web web, ListInstance templateList, TokenParser parser, PnPMonitoredScope scope, Boolean isNoScriptSite)
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectListInstance.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation)
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo, Boolean calledFromHierarchy, TokenParser tokenParser)
at Microsoft.SharePoint.Client.WebExtensions.ApplyProvisioningTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation applyingInformation)
@VesaJuvonen
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Yes, I think there is a server side issue. I spent all day yesterday digging into it and didn't find a way around it. Someone else started an issue in sp-dev-docs. Surprised there isn't more talk about this though because it would definitely be breaking a lot of provisioning scenarios. https://github.com/SharePoint/sp-dev-docs/issues/4438
Yes, @VesaJuvonen gave a link to and said the bug report (#4438) should go there.
I'm getting the same result using the PowerShell cmdlet Apply-PnPProvisioningTemplate. This was previously working and broke sometime after August 7. No changes to my template have been made.
Portion of the trace log:
powershell_ise.exe Information: 0 : 2019-08-12 15:50:03.3558 [Content Types] [11] [Debug] Code execution scope ended 1588ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:03.3569 [ProvisioningTemplate WebHook Call] [11] [Debug] Code execution scope started 0ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:03.3588 [ProvisioningTemplate WebHook Call] [11] [Debug] Code execution scope ended 2ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:03.3598 [ProvisioningTemplate WebHook Call] [11] [Debug] Code execution scope started 0ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:03.3608 [ProvisioningTemplate WebHook Call] [11] [Debug] Code execution scope ended 0ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:03.3618 [List instances] [11] [Debug] Code execution scope started 0ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:04.3087 [List instances] [11] [Debug] Updating list Documents 947ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Warning: 0 : 2019-08-12 15:50:04.7663 [List instances] [11] [Information] Skip adding/updating custom actions because the site has "noscript" enabled. 1404ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:10.8759 [List instances] [11] [Debug] Code execution scope ended 7514ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:10.8839 [ProvisioningTemplate WebHook Call] [11] [Debug] Code execution scope started 0ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:10.8879 [ProvisioningTemplate WebHook Call] [11] [Debug] Code execution scope ended 4ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:10.8919 [ProvisioningTemplate WebHook Call] [11] [Debug] Code execution scope started 0ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:10.9019 [ProvisioningTemplate WebHook Call] [11] [Debug] Code execution scope ended 9ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:10.9039 [List instances] [11] [Debug] Code execution scope started 0ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:12.4087 [List instances] [11] [Debug] Updating list Documents 1504ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Warning: 0 : 2019-08-12 15:50:12.7792 [List instances] [11] [Information] Skip adding/updating custom actions because the site has "noscript" enabled. 1875ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:20.3960 [List instances] [11] [Debug] Creating view All Documents 9491ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:22.5021 [List instances] [11] [Debug] Creating view By Document Category 11597ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:23.9195 [List instances] [11] [Debug] Creating view No Folders 13015ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:26.8523 [List instances] [11] [Debug] Code execution scope ended 15947ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
powershell_ise.exe Information: 0 : 2019-08-12 15:50:26.8553 [Provisioning] [11] [Debug] Code execution scope ended 74677ms 42ff01d2-0604-4fa4-81fc-1717d6a209f1
Apply-PnPProvisioningTemplate : Object reference not set to an instance of an object.
At line:3 char:1
+ Apply-PnPProvisioningTemplate -Path "C:\pnptemplates\Template.xml" -Clear ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate
We also have this in our production provisioning process. And is now blocking provisioning of our production sites.
We are seeing the same issue on multiple production tenants. Support Tickets have been opened, but maybe @VesaJuvonen can speed up the process internally to stop further rollout? Not all Tenants are affected by this yet.
Setting "Allow management of content types" to yes via UI also fails on those tenants.
As it was mentioned that this is a server-side issue. Do we have exact oob API which is now throwing this exception already? Would speed up the investigation as we can't use official support channels for PnP engine, but if we can produce the issue with native CSOM - then it's a separate story. All additional details would be more than welcome.
Sorry - missed that we can reproduce this also from UI - that helps already enormously, but if we can pinpoint the native CSOM API which is causing it, that would be also highly helpful to speed up the internal process. Thx.
And mixing things - Let's moved the the discussion to the sp-dev-docs issue at following location as this is related on oob SharePoint CSOM - not just on the PnP topics. Will help on the messaging internally. Will resubmit the above ask there - https://github.com/SharePoint/sp-dev-docs/issues/4438.
https://github.com/SharePoint/sp-dev-docs/issues/4438 is really the one to follow, but issue has been recognized in the server side and is being worked on. The situation should normalize soon. This was caused by a human error on the oob APIs.
Most helpful comment
Yes, I think there is a server side issue. I spent all day yesterday digging into it and didn't find a way around it. Someone else started an issue in sp-dev-docs. Surprised there isn't more talk about this though because it would definitely be breaking a lot of provisioning scenarios. https://github.com/SharePoint/sp-dev-docs/issues/4438