Custom pages occasionally get provisioned as corrupted (`NoComponentId` error)
@jansenbe is already working on this.
Since Sep 28, 2022.
Assessment
This issue has not been assessed yet.
Description
Occasionally when provisioning out a page, the resultant page is corrupted. This crashes the provisioning process. Attempting to re-apply the template crashes at the same point with a null reference exception:
Object reference not set to an instance of an object.
Source = PnP.FrameworkTargetSite = Void CreatePage(Microsoft.SharePoint.Client.Web, PnP.Framework.Provisioning.Model.ProvisioningTemplate, PnP.Framework.Provisioning.ObjectHandlers.TokenParser, PnP.Framework.Diagnostics.PnPMonitoredScope, PnP.Framework.Provisioning.Model.BaseClientSidePage, System.String, Microsoft.SharePoint.Client.List, Int32 ByRef, System.Collections.Generic.List`1[System.String])
HResult = -2147467261StackTrace =
at PnP.Framework.Provisioning.ObjectHandlers.ObjectClientSidePages.CreatePage(Web web, ProvisioningTemplate template, TokenParser parser, PnPMonitoredScope scope, BaseClientSidePage clientSidePage, String pagesLibrary, List pagesLibraryList, Int32& currentPageIndex, List`1 preCreatedPages)
at PnP.Framework.Provisioning.ObjectHandlers.ObjectClientSidePages.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation)
at PnP.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo, Boolean calledFromHierarchy, TokenParser tokenParser)
at MKS.ClientPortalFunctions.Functions.SiteProvisioning.OnTeamCreated.ApplyTemplate(String siteUrl, Stream templateStream) in D:\a\1\s\functions\siteProvisioning\OnTeamCreated.cs:line 183
Attempting to open the page shows a "Something went wrong" error page citing NoComponentId with no further information.
This has happened maybe 150 times out of around 15,500. Deleting a site with the corrupted page and reprovisioning it has always resolved it. Both of these point to it looking like a race condition maybe?
We always apply the template to freshly created team sites using the out of the box team site template, so the sites have had no visitors or customizations to interfere with anything.
The below is a shortned version of the template we're using, containing only the full page that gets corrupted (minus the custom web part properties). The page contains four web parts:
- 1x OOTB text
- 2x custom web part
- 1x another custom web part
Minimal template
<?xml version="1.0" encoding="utf-8"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2021/03/ProvisioningSchema">
<pnp:Preferences Generator="PnP.Framework, Version=1.10.0.0, Culture=neutral, PublicKeyToken=0d501f89f11b748c"/>
<pnp:Templates ID="CONTAINER-TEMPLATE-BD216736552340C2B5B3FE8BD9291376">
<pnp:ProvisioningTemplate ID="TEMPLATE-BD216736552340C2B5B3FE8BD9291376" Version="1" BaseSiteTemplate="GROUP#0"
Scope="RootSite">
<pnp:ClientSidePages>
<pnp:ClientSidePage PromoteAsNewsArticle="false" PromoteAsTemplate="false" Overwrite="true"
Title="Administration" ThumbnailUrl="" PageName="Administration.aspx">
<pnp:Header Type="Custom" ServerRelativeImageUrl="/_LAYOUTS/IMAGES/SLEEKTEMPLATEIMAGETILE.JPG"
LayoutType="NoImage" ShowTopicHeader="false" ShowPublishDate="false" TopicHeader=""
AlternativeText="" Authors="[]" AuthorByLine="[]" AuthorByLineId="-1"/>
<pnp:Sections>
<pnp:Section Order="1" Type="OneColumn">
<pnp:Controls>
<pnp:CanvasControl WebPartType="Text" ControlId="77936784-91c8-44ae-909d-6064f32cf707"
Order="1" Column="1">
<pnp:CanvasControlProperties>
<pnp:CanvasControlProperty Key="Text"
Value="<div><div><span> INSTRUCTION TEXT </span></div></div>"/>
</pnp:CanvasControlProperties>
</pnp:CanvasControl>
</pnp:Controls>
</pnp:Section>
<pnp:Section Order="2" Type="ThreeColumn">
<pnp:Controls>
<pnp:CanvasControl WebPartType="Custom"
JsonControlData="{"id": "d2482049-dc6d-4275-84ae-8d4ff2e53e70", "instanceId": "b6973dc3-d6d0-42cd-a52e-ecdaa19fc4e5", "title": "Flow Trigger Form", "description": "Triggers HTTP Flows and Power Apps with form values.", "dataVersion": "1.0", "properties": {}, "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{},"links":{}}, "dynamicDataPaths": {}, "dynamicDataValues": {}}"
ControlId="d2482049-dc6d-4275-84ae-8d4ff2e53e70" Order="1"
Column="1"/>
<pnp:CanvasControl WebPartType="Custom"
JsonControlData="{"id": "d2482049-dc6d-4275-84ae-8d4ff2e53e70", "instanceId": "94addb58-d60f-47ab-8af5-8c4456030d08", "title": "Flow Trigger Form", "description": "Triggers HTTP Flows and Power Apps with form values.", "dataVersion": "1.0", "properties": {}, "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{},"links":{}}, "dynamicDataPaths": {}, "dynamicDataValues": {}}"
ControlId="d2482049-dc6d-4275-84ae-8d4ff2e53e70" Order="1"
Column="2"/>
<pnp:CanvasControl WebPartType="Custom"
JsonControlData="{"id":"4929fe9a-5e1a-427a-9e67-02a8eefe94da","instanceId":"a05a9e0a-2dc3-4e2f-a334-164ac8508019","title":"CORE Group Management","description":"View, add and remove users from SharePoint groups.","dataVersion":"1.0","properties":{},"serverProcessedContent":{"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{},"links":{}},"dynamicDataPaths":{},"dynamicDataValues":{}}"
ControlId="4929fe9a-5e1a-427a-9e67-02a8eefe94da" Order="1"
Column="3"/>
</pnp:Controls>
</pnp:Section>
<pnp:Section Order="3" Type="ThreeColumn"/>
<pnp:Section Order="4" Type="ThreeColumn"/>
</pnp:Sections>
</pnp:ClientSidePage>
</pnp:ClientSidePages>
</pnp:ProvisioningTemplate>
</pnp:Templates>
</pnp:Provisioning>
Platform: Windows Server (Azure Functions v4 serverless environment, NET 6)
Version: 1.10.0.0
If you need any more info, please let me know.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pnp/pnpframework
-
area: provisioning ⚙
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
pnp/pnpframework#1274 ·
-
area: provisioning ⚙
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pnp/pnpframework#1269 ·
-
area: provisioning ⚙
Difficulty 1/5 Under an hour Newbie friendliness 72/100
pnp/pnpframework#1170 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
pnp/pnpframework#913 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pnp/pnpframework#1283 ·
All issues in pnp/pnpframework
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100