Open sheedydan opened 5 years ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Output from PnPTraceLog:
powershell.exe Information: 0 : 2019-10-29 16:50:25.3487 [Extensibility Providers] [15] [Debug] Code execution scope started 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:25.3487 [Extensibility Providers] [15] [Debug] Code execution scope ended 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:25.3487 [ProvisioningTemplate WebHook Call] [15] [Debug] Code execution scope started 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:25.3487 [ProvisioningTemplate WebHook Call] [15] [Debug] Code execution scope ended 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:25.3597 [ProvisioningTemplate WebHook Call] [15] [Debug] Code execution scope started 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:25.3597 [ProvisioningTemplate WebHook Call] [15] [Debug] Code execution scope ended 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:25.3597 [Fields] [15] [Debug] Code execution scope started 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:25.4847 [Fields] [15] [Debug] Updating field {fcbb4801-fc8b-43f3-8a6e-7d6d956c98e5} in site 124ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:26.0697 [Fields] [15] [Debug] Code execution scope ended 709ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:26.0787 [ProvisioningTemplate WebHook Call] [15] [Debug] Code execution scope started 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:26.0787 [ProvisioningTemplate WebHook Call] [15] [Debug] Code execution scope ended 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:26.0877 [ProvisioningTemplate WebHook Call] [15] [Debug] Code execution scope started 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:26.0877 [ProvisioningTemplate WebHook Call] [15] [Debug] Code execution scope ended 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:26.0887 [Content Types] [15] [Debug] Code execution scope started 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:27.3087 [Content Types] [15] [Debug] Recreating existing Content Type: 0x01010004A139153DBCBD4A92567443CE5AE346 - Sensitive Access Document 1220ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:27.4398 [OfficeDevPnP.Core] [0] [Information] Creating content type 'Sensitive Access Document' (0x01010004A139153DBCBD4A92567443CE5AE346). 0ms
powershell.exe Information: 0 : 2019-10-29 16:50:28.6498 [OfficeDevPnP.Core] [0] [Information] Adding field (fcbb4801-fc8b-43f3-8a6e-7d6d956c98e5) to content type (0x01010004A139153DBCBD4A92567443CE5AE346). 0ms
powershell.exe Information: 0 : 2019-10-29 16:50:29.1137 [Content Types] [15] [Debug] Code execution scope ended 3024ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:29.1137 [ProvisioningTemplate WebHook Call] [15] [Debug] Code execution scope started 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:29.1137 [ProvisioningTemplate WebHook Call] [15] [Debug] Code execution scope ended 0ms acb2331f-d763-459b-8de4-2d7ac1c1509c
powershell.exe Information: 0 : 2019-10-29 16:50:29.1137 [Provisioning] [15] [Debug] Code execution scope ended 4057ms acb2331f-d763-459b-8de4-2d7ac1c1509c
Same issue here, works subsequent time for each content type. Also on 3.14.1910.1 of PnP-PowerShell Online-version.
I found this error, then I have more that 1 content type in the template. Each time I ran the provisioning a content type is created okay, but it errors after creating the content type. But if I just create the content types first with "Add-PnPContentType" the provisioning does not error.
From what I have seen based on the trace log is that it now appears that lookup columns are being skipped. In both content types that were created it has only restored the non lookup columns. My site or list structure hasn't changed and I have generated templates and restored them recently without error. I now get the same error while running the most recent build. Only change is a change for how I generated the template now using, -ContentTypeGroup and -Handlers switches.
It seems that this behavior does not occur with version: SharePointPnPPowerShellOnline 3.13.1909.0. I downgraded using uninstall-module SharePointPnPPowerShellOnline -AllVersions -Confirm and generated a new template and applied it to a new communications site. The order of the restore also seems different. At some point it does Lists, Site Columns for List, Fields and Content Types in that order whereas I believe with the 1901 build it does Fields, Content Types which would explain my theory of why the lookup columns fail now. Hopefully this helps someone
After updating to SharePointPnPPowerShellOnline 3.15.1911.0 version the content type issues was fixed, but I did have a new issues, was not able to find a cause, I did a work around, I have a provisioning template the site columns, content types and lists, that errored. The work around was to use 3 separate templates 1 for the site columns, 1 for the content types and 1 for the lists. Note: the issues was in Azure Automation run book.
Reporting an Issue or Missing Feature
Issue observed when deploying a content type from a PnP provisioning template.
Expected behavior
Successful provisioning of the content type.
Actual behavior
When applying a PnP template containing a content type definition, the cmdlet returns the exception message:
This will error will only occur on the first instance of attempting to provision the content type. Subsequent provisioning attempts will provision successfully with out exception.
Steps to reproduce behavior
XML template used to reproduce:
Which version of the PnP-PowerShell Cmdlets are you using?
What is the version of the Cmdlet module you are running?
3.14.1910.1
How did you install the PnP-PowerShell Cmdlets?