Jan 18 2018 03:05 PM
Here is my scenario if you keep creating a template of a site and create a site with that template it fails on the third occurrence with below message.
Here is PowerShell script to reproduce the issue,
Add-PSSnapin Microsoft.SharePoint.PowerShell Connect-PnPOnline "http://officedevpnp/" -CurrentCredentials Get-PnPProvisioningTemplate -Out "D:\Ravi\PnP\Template\pnp\template01.pnp" -PersistBrandingFiles New-PnPTenantSite -Url "http://officedevpnp/sites/fromxmltemplate" ` -Title "RaviSite01" ` -Owner "ravi" ` -TimeZone 10 Connect-PnPOnline "http://officedevpnp/sites/fromxmltemplate" -CurrentCredentials Apply-PnPProvisioningTemplate -Path "D:\Ravi\PnP\Template\pnp\template01.pnp" ######### Connect-PnPOnline "http://officedevpnp/sites/fromxmltemplate" -CurrentCredentials Get-PnPProvisioningTemplate -Out "D:\Ravi\PnP\Template\pnp\template02.pnp" -PersistBrandingFiles Connect-PnPOnline "http://officedevpnp/" -CurrentCredentials New-PnPTenantSite -Url "http://officedevpnp/sites/fromxmltemplate02" ` -Title "RaviSite02" ` -Owner "ravi" ` -TimeZone 10 Connect-PnPOnline "http://officedevpnp/sites/fromxmltemplate02" -CurrentCredentials Apply-PnPProvisioningTemplate -Path "D:\Ravi\PnP\Template\pnp\template02.pnp" ######### Connect-PnPOnline "http://officedevpnp/sites/fromxmltemplate02" -CurrentCredentials Get-PnPProvisioningTemplate -Out "D:\Ravi\PnP\Template\pnp\template03.pnp" -PersistBrandingFiles Connect-PnPOnline "http://officedevpnp/" -CurrentCredentials New-PnPTenantSite -Url "http://officedevpnp/sites/fromxmltemplate03" ` -Title "RaviSite03" ` -Owner "ravi" ` -TimeZone 10 Connect-PnPOnline "http://officedevpnp/sites/fromxmltemplate03" -CurrentCredentials Apply-PnPProvisioningTemplate -Path "D:\Ravi\PnP\Template\pnp\template03.pnp"
Jan 18 2018 10:29 PM
Do you also have the XML of your template?
Jan 19 2018 05:52 AM
Sorry to say but I am working on a restricted environment and can not share that with you.
But if you follow the PowerShell commands I posted you should be able to reproduce the issue.
When I applied the template on step #2 it creates this view. Here is the screen of the xml file where you can see additional view named "Calendar1.aspx". Once this view is there I can not apply this template. So the problem is with Apply-PnPProvisioningTemplate and not sure why it creates this view.
Jan 21 2019 02:17 AM
New-PnPTenantSite -Url "http://officedevpnp/sites/fromxmltemplate" ` -Title "RaviSite01" ` -Owner "ravi" ` -TimeZone 10
Is an Async call. If you try to apply a template before the site creation is finished it will fail.
You can add the option -wait to make sure the site creation is finished.
Regards Marc