pnpframework icon indicating copy to clipboard operation
pnpframework copied to clipboard

PnP.Framework ApplyProvisioningTemplate started failing

Open andriypshchk opened this issue 3 years ago • 1 comments

Hi,

We are provisioning the Sharepoint site using PnP.Framework ApplyProvisioningTemplate(package SharePointPnPCoreOnline tried both versions 3.20.2004, 3.28.2012). Recently we started getting problems with provisioning on some of our tenants Sharepoint sites:

  • tenantA - provisioning works fine since last year till now.
  • tenantB - provisioning was working fine till recently, now it fails
  • tenantC - provisioning fails

Error Details: Based on debug logs it's failing on "Search Settings" part.

Message : Bad request: Please export a new search configuration firstly and then use it to import if you are improting a stale exported search configuration file Exception type : Microsoft.SharePoint.Client.ServerException Failed method : OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate

Regards

andriypshchk avatar Jul 05 '22 11:07 andriypshchk

After trying manually to find out in the template what leads to the error, I've found the following field: under "pnp:SiteSearchSettings -> SearchConfigurationSettings -> SearchSchemaConfigurationSettings -> CategoriesAndCrawledProperties" section there is the dictionary containing items like this:

<d3p1:KeyValueOfguidCrawledPropertyInfoCollectionaSYUqUE_P>
                  <d3p1:Key>00130329-0000-0130-c000-000000131346</d3p1:Key>
                  <d3p1:Value xmlns:d5p1="http://schemas.datacontract.org/2004/07/Microsoft.Office.Server.Search.Administration">
                    <d5p1:LastItemName>ows_AverageRating</d5p1:LastItemName>
                    <d5p1:dictionary>
                      <d3p1:KeyValueOfstringCrawledPropertyInfoy6h3NzC8>
                        <d3p1:Key>ows_Challenge:ID</d3p1:Key>
                        <d3p1:Value>
                          <d5p1:Name>ows_Challenge:ID</d5p1:Name>
                          <d5p1:CategoryName>SharePoint</d5p1:CategoryName>
                          <d5p1:IsImplicit>false</d5p1:IsImplicit>
                          <d5p1:IsMappedToContents>true</d5p1:IsMappedToContents>
                          <d5p1:IsNameEnum>false</d5p1:IsNameEnum>
                          <d5p1:MappedManagedProperties />
                          <d5p1:Propset>00130329-0000-0130-c000-000000131346</d5p1:Propset>
                          <d5p1:Samples />
                          <d5p1:SchemaId>2065</d5p1:SchemaId>
                        </d3p1:Value>
                      </d3p1:KeyValueOfstringCrawledPropertyInfoy6h3NzC8>

The problem is with <d5p1:SchemaId>2065</d5p1:SchemaId> property, after changing it to <d5p1:SchemaId>0</d5p1:SchemaId>(found this value in the another site template which was provisioned 6m ago) provisioning is working fine again. Even though I'm not sure what this value should be and where to get it.

andriypshchk avatar Jul 19 '22 15:07 andriypshchk