Forum Discussion
Apply-PnPProvisioningTemplate : File not Found
- DeletedSep 16, 2018I've found the lines causing the Error:
After each List Instance, there is a Field "_DisplayName" that gets updated: the .xml looks like this:
<pnp:Fields>
<Field ID="{1a53ab5a-11f9-4b92-a377-8cfaaf6ba7be}" Name="_DisplayName" DisplaceOnUpgrade="TRUE" Sortable="FALSE" Filterable="FALSE" Hidden="FALSE" ReadOnly="TRUE" ShowInFileDlg="FALSE" Type="Lookup" DisplayName="Sensitivity" List="Docs" ListInternal="IpLabelCache" FieldRef="LabelId" ShowField="DisplayName" LeftList="Docs" LeftColumnName="IpLabelId" JoinColName="LabelId" JoinRowOrdinal="0" JoinType="LEFT OUTER" SchemaVersion="16.0.162.0" RecreateIfMissing="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="_DisplayName" FromBaseType="TRUE" />
</pnp:Fields>
I removed this Field Updates and was able to apply my template as I wanted. This bug seems to have been reported already (And fixes but not merged yet): https://github.com/SharePoint/PnP-Sites-Core/pull/1911
A common solution to that error is to open the template file look for the File references and ensure that all those files are available on the relative location where your template is located.
For example, if you have a <pnp:File> element referencing a file on "/MyFilesExample/MyFile.txt", next to the template file you will need a "MyFilesExample" folder and inside that folder a "MyFile.txt".
This happens in some scenarios, but it's generally easy to fix as you can just create the required folders and download the required files from the original site that was used as a template.
Note: I have assumed that you are doing this in 2 steps
- create site and save template
("fix" template)
- create site and apply template
Hope this helps
Hi, Yes I have already read about this.
To be sure that it is not this problem, I have made my test on an empty website.
How you can see, my command Get-PnPProvisioningTemplate -Out arrive just after the creation of the website. I haven't added/deleted/changed nothing before...
I have read that it was possible to rename the .pnp to .zip, and to look if there is a "pnp:file" in the <guid>.xml file of the folder named "Files".
But there is nothing....
- Aug 24, 2018That's correct, you can extract the contents of the file as if it was a zip.
Check also for other references other than pnp:file elements. For example, a custom site icon can also cause this if I'm not wrong.
It will be worth quickly checking your entire template.
Also, check if the master pages are not referenced (generally close to the bottom of the template)- Aug 24, 2018And forgot about theme files as well.
And also, very likely, the link to the OneNote file on the navigation element. Quite sure this is a common issue as well. There is a way to generate that link dynamically