pnp / PnP-Sites-Core

Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
Other
416 stars 642 forks source link

Apply-PnPProvisioningTemplate : Field with name "p8628bda0807413da3ad070d5f0a43fa" was not found. #1813

Open khha opened 6 years ago

khha commented 6 years ago

Category

[X ] Bug [ ] Enhancement

Environment

[ ] Office 365 / SharePoint Online [ ] SharePoint 2016 [ X] SharePoint 2013

If SharePoint on-premises, what's exact CU version: 15.0.4569.1506

Expected or Desired Behavior

I expect a new managed metadata field after using the pnp powershell command "Apply-PnPProvisioningTemplate".

Observed Behavior

I downloaded the latest sharepoint 2013 pnp powershell msi file (June 2018 Release, 2.27.1806.0 ). I created a pnp template to create a new manage metadata field. I run the pnp powershell command "Apply-PnPProvisioningTemplate".

I receive this error:

Apply-PnPProvisioningTemplate : Field with name "o1b0d8a7ae5043afbb478d247fa91ac6" was not found.
At line:1 char:1
+ Apply-PnPProvisioningTemplate -Path C:\siteprovisioninglist.xml
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate

I run the pnp powershell command "Apply-PnPProvisioningTemplate" again and it works fine without error. Why the first time on each new site collection I receive this error?

Here is my pnp template:

`<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2018/01/ProvisioningSchema">
  <pnp:Preferences Generator="OfficeDevPnP.Core, Version=2.23.1802.0, Culture=neutral, PublicKeyToken=5e633289e95c321a" />
  <pnp:Templates ID="CONTAINER-TEMPLATE-DD8FF2411C6D4EEEA6A0A5349D4F0AFD">
    <pnp:ProvisioningTemplate ID="TEMPLATE-DD8FF2411C6D4EEEA6A0A5349D4F0AFD" Version="1" BaseSiteTemplate="STS#0" Scope="RootSite">
      <pnp:SiteFields>
        <Field ID="{818a4863-7556-4380-a3b9-d525e3aac646}" Name="OK-Sector_TaxHTField0" DisplayName="Sector_0" Type="Note" Required="FALSE" Group="OK" ShowInViewForms="FALSE" Hidden="TRUE" StaticName="p8628bda0807413da3ad070d5f0a43fa" SourceID="{8e81f00e-59ab-476e-b91a-99381ae2bc88}" />

        <Field ID="{98628bda-0807-413d-a3ad-070d5f0a43fa}" Name="OK-Sector1" DisplayName="Sector" Type="TaxonomyFieldType" Required="FALSE" ShowField="Term1033" Group="OK" List="{{listid:TaxonomyHiddenList}}" WebId="{webid}" SourceID="{8e81f00e-59ab-476e-b91a-99381ae2bc88}" StaticName="OK-Sector1">
          <Default>1;#Banken|a3894539-b2a7-4838-b8e5-e496111b3525</Default>
          <Customization>
            <ArrayOfProperty>
              <Property>
                <Name>SspId</Name>
                <Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{sitecollectiontermstoreid}</Value>
              </Property>
              <Property>
                <Name>GroupId</Name>
              </Property>
              <Property>
                <Name>TermSetId</Name>
                <Value xmlns:q2="http://www.w3.org/2001/XMLSchema" p4:type="q2:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{termsetid:Bankbrede Term Sets:Sector}</Value>
              </Property>
              <Property>
                <Name>AnchorId</Name>
                <Value xmlns:q3="http://www.w3.org/2001/XMLSchema" p4:type="q3:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">00000000-0000-0000-0000-000000000000</Value>
              </Property>
              <Property>
                <Name>UserCreated</Name>
                <Value xmlns:q4="http://www.w3.org/2001/XMLSchema" p4:type="q4:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false</Value>
              </Property>
              <Property>
                <Name>Open</Name>
                <Value xmlns:q5="http://www.w3.org/2001/XMLSchema" p4:type="q5:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false</Value>
              </Property>
              <Property>
                <Name>TextField</Name>
                <Value xmlns:q6="http://www.w3.org/2001/XMLSchema" p4:type="q6:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{818a4863-7556-4380-a3b9-d525e3aac646}</Value>
              </Property>
              <Property>
                <Name>IsPathRendered</Name>
                <Value xmlns:q7="http://www.w3.org/2001/XMLSchema" p4:type="q7:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false</Value>
              </Property>
              <Property>
                <Name>IsKeyword</Name>
                <Value xmlns:q8="http://www.w3.org/2001/XMLSchema" p4:type="q8:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false</Value>
              </Property>
              <Property>
                <Name>TargetTemplate</Name>
                <Value xmlns:q9="http://www.w3.org/2001/XMLSchema" p4:type="q9:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">
                </Value>
              </Property>
              <Property>
                <Name>CreateValuesInEditForm</Name>
                <Value xmlns:q10="http://www.w3.org/2001/XMLSchema" p4:type="q10:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false</Value>
              </Property>
              <Property>
                <Name>FilterAssemblyStrongName</Name>
                <Value xmlns:q11="http://www.w3.org/2001/XMLSchema" p4:type="q11:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">Microsoft.SharePoint.Taxonomy, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Value>
              </Property>
              <Property>
                <Name>FilterClassName</Name>
                <Value xmlns:q12="http://www.w3.org/2001/XMLSchema" p4:type="q12:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">Microsoft.SharePoint.Taxonomy.TaxonomyField</Value>
              </Property>
              <Property>
                <Name>FilterMethodName</Name>
                <Value xmlns:q13="http://www.w3.org/2001/XMLSchema" p4:type="q13:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">GetFilteringHtml</Value>
              </Property>
              <Property>
                <Name>FilterJavascriptProperty</Name>
                <Value xmlns:q14="http://www.w3.org/2001/XMLSchema" p4:type="q14:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">FilteringJavascript</Value>
              </Property>
            </ArrayOfProperty>
          </Customization>
        </Field>

      </pnp:SiteFields>

    </pnp:ProvisioningTemplate>
  </pnp:Templates>
</pnp:Provisioning>`
kalvaanirudh commented 5 years ago

I am facing the same issue.I have got multiple fields in my template which are causing this error. For ex: Security_Note , PrimaryActivity_Note When rerun the provisioning tool it doesn’t occur. Not able to find any solution for this .