New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to apply template, retying in 1 min: Invalid field name. {746bb255-b0f7-47d5-9a3e-1c8e52468420} #1788

Open
pgbhoyar opened this Issue May 24, 2018 · 18 comments

Comments

Projects
None yet
9 participants
@pgbhoyar

pgbhoyar commented May 24, 2018

Category

[X] Bug
[ ] Enhancement

Environment

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

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

Expected or Desired Behavior

We use PnP to provision new sites in Office 365. All the content types from the reference site should get provisioned in the target site.

Observed Behavior

The code was working fine until Monday (May 21st 2018) and suddenly we are getting the error message "Failed to apply template, retying in 1 min: Invalid field name. {746bb255-b0f7-47d5-9a3e-1c8e52468420}". This field is part of the out of the box "Repost Page" content type.

-<pnp:ContentType ID="0x0101009D1CB255DA76424F860D91F20E6C4118002A50BFCFB7614729B56886FADA02339B" Name="Repost Page" Description="Create a new repost page." Group="Document Content Types" DisplayFormUrl="" EditFormUrl="" NewFormUrl="">

-pnp:FieldRefs

<pnp:FieldRef ID="c042a256-787d-4a6f-8a8a-cf6ab767f12d" Name="ContentType"/>

<pnp:FieldRef ID="5f47e085-2150-41dc-b661-442f3027f552" Name="SelectFilename"/>

<pnp:FieldRef ID="8553196d-ec8d-4564-9861-3dbe931050c8" Name="FileLeafRef" Required="true"/>

<pnp:FieldRef ID="8c06beca-0777-48f7-91c7-6da68bc07b69" Name="Created" Hidden="true"/>

<pnp:FieldRef ID="fa564e0f-0c70-4ab9-b863-0177e6ddd247" Name="Title"/>

<pnp:FieldRef ID="28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f" Name="Modified" Hidden="true"/>

<pnp:FieldRef ID="822c78e3-1ea9-4943-b449-57863ad33ca9" Name="Modified_x0020_By"/>

<pnp:FieldRef ID="4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb" Name="Created_x0020_By"/>

<pnp:FieldRef ID="82642ec8-ef9b-478f-acf9-31f7d45fbc31" Name="LinkTitle"/>

<pnp:FieldRef ID="7efc33c1-b56b-490e-9c9b-1097e971ba96" Name="ClientSideApplicationId"/>

<pnp:FieldRef ID="daef58d7-ccfd-43fc-b776-2e292cc66bba" Name="PageLayoutType"/>

<pnp:FieldRef ID="4966388e-6e12-4bc6-8990-5b5b66153eae" Name="CanvasContent1"/>

<pnp:FieldRef ID="5baf6db5-9d25-4738-b15e-db5789298e82" Name="BannerImageUrl"/>

<pnp:FieldRef ID="fb3259ac-bd07-4397-b7aa-03e885b0838e" Name="BannerImageOffset"/>

<pnp:FieldRef ID="3f155110-a6a2-4d70-926c-94648101f0e8" Name="Description"/>

<pnp:FieldRef ID="f5ad16a2-85be-46b2-b5f0-2bb8b4a5074a" Name="PromotedState"/>

<pnp:FieldRef ID="c84f8697-331e-457d-884a-c4fb8f30ea74" Name="FirstPublishedDate"/>

<pnp:FieldRef ID="261075db-0525-4fb8-a6ea-772014186599" Name="LayoutWebpartsContent"/>

<pnp:FieldRef ID="746bb255-b0f7-47d5-9a3e-1c8e52468420" Name="Authors"/>

<pnp:FieldRef ID="8a8804d8-ad51-48ef-9acf-0df7b3cc7ef6" Name="OriginalSourceUrl"/>

<pnp:FieldRef ID="0e7b982f-698a-4d0c-aacb-f16906f66d30" Name="_OriginalSourceUrl"/>

<pnp:FieldRef ID="36193413-dd5c-4096-8c1e-1b40098b9ba3" Name="_OriginalSourceSiteId"/>

<pnp:FieldRef ID="3477a5bc-c605-4b2e-a7c1-8db8f13c017e" Name="_OriginalSourceWebId"/>

<pnp:FieldRef ID="139da674-dbf6-439f-98e0-4eb05fa9a669" Name="_OriginalSourceListId"/>

<pnp:FieldRef ID="91e86a43-75f2-426f-80da-35edfb47d55d" Name="_OriginalSourceItemId"/>

</pnp:FieldRefs>

<pnp:DocumentTemplate TargetName="/_layouts/15/CreateSitePage.aspx"/>

Steps to Reproduce

web.ApplyProvisioningTemplate(template, ptai);

@tangibledifference

This comment has been minimized.

tangibledifference commented May 31, 2018

Also having the same error when provisioning new team sites from a template in a workflow. Worked fine until 18th May 2018.

Error: Invalid field name. {746bb255-b0f7-47d5-9a3e-1c8e52468420} 

The site does provision, but the template fails, so all lists, logos etc are all default, which is not ideal.

Will there be a fix?

@pgbhoyar

This comment has been minimized.

pgbhoyar commented Jun 7, 2018

To fix this issue in SharePoint Online, we need to recreate the source template. The schema for "Repost Page" content type has changed. https://pgbhoyar.com/2018/06/06/pnp-provisioning-error-field-not-found-issue-with-the-repost-page-content-type/

@jwiersem

This comment has been minimized.

jwiersem commented Jun 28, 2018

Thanks for registering this bug @pgbhoyar !

@tangibledifference

This comment has been minimized.

tangibledifference commented Jun 28, 2018

agreed, recreating the source template worked

@vipulkelkar

This comment has been minimized.

Contributor

vipulkelkar commented Jul 3, 2018

I extracted the template again but I still see that the field is showing up in the XML. I cannot see that field in the site UI though. Any pointers ?

By re-creating the template do you mean creating a new site or just extracting a new template.

@jwiersem

This comment has been minimized.

jwiersem commented Jul 3, 2018

@vipulkelkar : You need to create a new site and configure it again and then extract the template

@vipulkelkar

This comment has been minimized.

Contributor

vipulkelkar commented Jul 3, 2018

@jwiersem Thanks !

@BillyK44

This comment has been minimized.

BillyK44 commented Jul 27, 2018

A team I worked on developed a solution using PnP Remote Provisioning engine and we encountered the same error and it all happened on the same day (May 18).

Has Microsoft or anyone in the PnP Remote Provisioning Community provided any guidance on how future changes to SharePoint might affect the PnP Provisioning Engine code and how to future-proof our scripts?

@mahpour

This comment has been minimized.

mahpour commented Jul 30, 2018

We're having the same problem too. Any solutions?

@gszdev

This comment has been minimized.

gszdev commented Aug 2, 2018

We're checking and modifying the provisioning template before applying it, to prevent such issues.
For this issue, we remove the following two FieldRefs from the "Repost Page" (0x0101009D1CB255DA76424F860D91F20E6C4118002A50BFCFB7614729B56886FADA02339B) content type:
746bb255-b0f7-47d5-9a3e-1c8e52468420 Authors
8a8804d8-ad51-48ef-9acf-0df7b3cc7ef6 OriginalSourceUrl

@ChrisAV81

This comment has been minimized.

ChrisAV81 commented Aug 2, 2018

How about just removing the 'Report Page' content type from the provisioning template XML before applying? It shouldn't be needed to include, since it's a built in content type, right?

@gszdev

This comment has been minimized.

gszdev commented Aug 2, 2018

Removing the content type from the provisioning template will lead to errors if it's used as list / lib content type.
When removing the (site) content type from the provisioning template, you'll have to check all elements depending on this content type (lists, libs, ...)

I'm of the same opinon, it should be done by the provisioning engine framework. Maybe someone from Microsoft / PNP Team can give you better direction or some background infos.

@ChrisAV81

This comment has been minimized.

ChrisAV81 commented Aug 2, 2018

Thanks! Seems to work to remove both the 'repost page' content type and 'site pages' list instance from the template. These are already in place when the site is created, so shouldn't be an issue to remove.

@jansenbe

This comment has been minimized.

Contributor

jansenbe commented Aug 7, 2018

By default, the pnp provisioning engine will, at extraction time, strip all artifacts that appear in the base template. To make this work we update that base template with each monthly release (see below the current data). The "stripping" is done by the CleanupEntities method in ObjectContentType.cs.

Did you for some reason specify basetemplate as part of your ProvisioningTemplateCreationInformation object?

        private ProvisioningTemplate CleanupEntities(ProvisioningTemplate template, ProvisioningTemplate baseTemplate, PnPMonitoredScope scope)
        {
            foreach (var ct in baseTemplate.ContentTypes)
            {
                var index = template.ContentTypes.FindIndex(f => f.Id.Equals(ct.Id, StringComparison.OrdinalIgnoreCase));
                if (index > -1)
                {
                    template.ContentTypes.RemoveAt(index);
                }
                else
                {
                    scope.LogDebug(CoreResources.Provisioning_ObjectHandlers_ContentTypes_Adding_content_type_to_template___0_____1_, ct.Id, ct.Name);
                }
            }

            return template;
        }
        <pnp:ContentType ID="0x0101009D1CB255DA76424F860D91F20E6C4118002A50BFCFB7614729B56886FADA02339B" Name="Repost Page" Description="Create a new repost page." Group="Document Content Types" NewFormUrl="" EditFormUrl="" DisplayFormUrl="">
          <pnp:FieldRefs>
            <pnp:FieldRef ID="c042a256-787d-4a6f-8a8a-cf6ab767f12d" Name="ContentType" />
            <pnp:FieldRef ID="5f47e085-2150-41dc-b661-442f3027f552" Name="SelectFilename" />
            <pnp:FieldRef ID="8553196d-ec8d-4564-9861-3dbe931050c8" Name="FileLeafRef" Required="true" />
            <pnp:FieldRef ID="8c06beca-0777-48f7-91c7-6da68bc07b69" Name="Created" Hidden="true" />
            <pnp:FieldRef ID="fa564e0f-0c70-4ab9-b863-0177e6ddd247" Name="Title" />
            <pnp:FieldRef ID="28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f" Name="Modified" Hidden="true" />
            <pnp:FieldRef ID="822c78e3-1ea9-4943-b449-57863ad33ca9" Name="Modified_x0020_By" />
            <pnp:FieldRef ID="4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb" Name="Created_x0020_By" />
            <pnp:FieldRef ID="82642ec8-ef9b-478f-acf9-31f7d45fbc31" Name="LinkTitle" />
            <pnp:FieldRef ID="7efc33c1-b56b-490e-9c9b-1097e971ba96" Name="ClientSideApplicationId" />
            <pnp:FieldRef ID="daef58d7-ccfd-43fc-b776-2e292cc66bba" Name="PageLayoutType" />
            <pnp:FieldRef ID="4966388e-6e12-4bc6-8990-5b5b66153eae" Name="CanvasContent1" />
            <pnp:FieldRef ID="5baf6db5-9d25-4738-b15e-db5789298e82" Name="BannerImageUrl" />
            <pnp:FieldRef ID="fb3259ac-bd07-4397-b7aa-03e885b0838e" Name="BannerImageOffset" />
            <pnp:FieldRef ID="3f155110-a6a2-4d70-926c-94648101f0e8" Name="Description" />
            <pnp:FieldRef ID="f5ad16a2-85be-46b2-b5f0-2bb8b4a5074a" Name="PromotedState" />
            <pnp:FieldRef ID="c84f8697-331e-457d-884a-c4fb8f30ea74" Name="FirstPublishedDate" />
            <pnp:FieldRef ID="261075db-0525-4fb8-a6ea-772014186599" Name="LayoutWebpartsContent" />
            <pnp:FieldRef ID="1a7348e7-1bb7-4a47-9790-088e7cb20b58" Name="_AuthorByline" />
            <pnp:FieldRef ID="0e7b982f-698a-4d0c-aacb-f16906f66d30" Name="_OriginalSourceUrl" />
            <pnp:FieldRef ID="36193413-dd5c-4096-8c1e-1b40098b9ba3" Name="_OriginalSourceSiteId" />
            <pnp:FieldRef ID="3477a5bc-c605-4b2e-a7c1-8db8f13c017e" Name="_OriginalSourceWebId" />
            <pnp:FieldRef ID="139da674-dbf6-439f-98e0-4eb05fa9a669" Name="_OriginalSourceListId" />
            <pnp:FieldRef ID="91e86a43-75f2-426f-80da-35edfb47d55d" Name="_OriginalSourceItemId" />
          </pnp:FieldRefs>
          <pnp:DocumentTemplate TargetName="/_layouts/15/CreateSitePage.aspx" />
        </pnp:ContentType>
@BillyK44

This comment has been minimized.

BillyK44 commented Aug 7, 2018

Thanks for the reply Bert! I showed your comment to one of our developers (I am not a developer) and he replied: "It seems like Bert is talking about provisioning site via CSOM i.e. C# code rather than by PnP PowerShell commands. So I do not believe it applies to our situation." Bert, any further comments or advice?

@jansenbe

This comment has been minimized.

Contributor

jansenbe commented Aug 7, 2018

I'm just explaining how things work (from a code perspective). Translating my question to PnP PS this means: "did you use the -NoBaseTemplate parameter for the Get-PnPProvisioningTemplate command?"

@BillyK44

This comment has been minimized.

BillyK44 commented Aug 8, 2018

Replying to Bert...

Interesting Bert. This parameter doesn't appear to be in the documentation. We couldn't find it...but we tried in PowerShell and it is a valid parameter. We will be looking at this closer in the near future. Thanks for your feedback!

@BillyK44

This comment has been minimized.

BillyK44 commented Aug 15, 2018

Replying to Bert and anyone else interested in this topic.

So in the latest release of SharePointPnPPowerShellOnline (July 2018 Release) the -NoBaseTemplate parameter is obsolete...but it appears that in one of the recent updates the PnP comandlet Get-ProvisioningTemplate now itself strips out the base content types from the XML extract it creates. We were using version 2.26.XXXX (we built our solution in September 2017) and it did NOT strip out base content types when doing the XML extract...which is why we stumbled on the Repost Page content type change (the author field was removed from the Repost page content type) which happened on May 18, 2018.

So I think the learning for us here is...stay up to speed on PnP PowerShell Remote Provisioning changes and if we run into issues, try using the newest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment