pnp / pnp/pnpframework

OfficeDevPnP.Core.Framework ApplyProvisioningTemplate gives error in subsite's based on root site's language

Open
#905 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: provisioning ⚙ question
Dominant language
C#
Stars
259
Forks
161
Avg merge
10h 33m
Merged PRs (30d)
1

Description

Hi,
We are facing an issue with the provisioning engine in our project. We can describe the problem as follows:

If the language of the root site where the subsite will be created is English, then we do not encounter any errors when applying pnp template into subsite.

However, if the language of the root site is Turkish, when provisioning the PnP template to a subsite using OfficeDevPnP.Core.Framework ApplyProvisioningTemplate, we encounter the following error during the installation of the first list in the PnP template.

ApplyPnPTest.exe Information: 0 : 2023-07-31 02:01:44.0395 [List instances] [1] [Debug] Creating list Test List 3180ms 165cff08-b4b0-4785-847d-06319df62026 ApplyPnPTest.exe Error: 0 : 2023-07-31 02:01:47.3326 [OfficeDevPnP.Core] [0] [Error] ExecuteQuery threw following exception: Microsoft.SharePoint.Client.ServerException: The request uses too many resources.

Some key notes:
A. This error happening when we create context with user-based authentication.
B. The language of the subsite does not affect the error.
C. The subsites where the error is encountered are modern team sites (STS#3) that do not contain 365 group. Additionally, the root sites where the subsites are located are publishing portal (BLANKINTERNET#0) type of sites.

We are using on our project:
1. Visual Studio 2022
2. .Net Framework 4.7.2
3. SharePointPnPCoreOnline 3.28.2012 version nuget package
4. PowerShell - “SharePointPnPPowerShellOnline” module with 3.29.21 version (The PowerShell module mentioned here was used for some of the solution attempts mentioned below.)

A sample pnp template that we applied to subsite:

<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema">
	<pnp:Preferences Generator="OfficeDevPnP.Core, Version=3.28.2012.0, Culture=neutral, PublicKeyToken=5e633289e95c321a"/>
	<pnp:Templates ID="CONTAINER-SharePointPalsDemo">
		<pnp:ProvisioningTemplate ID="SharePointPalsDemo" Version="1" BaseSiteTemplate="STS#3" Scope="Web">
			<pnp:SiteFields>
				<Field Type="Text" DisplayName="Description Text Test" Description="Informative description for administrative purposes." Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" Group="Test Group" ID="{db324795-e49c-4962-9821-3bab5b6848c1}" SourceID="{{siteid}}" StaticName="DescriptionTextTest" Name="DescriptionTextTest" CustomFormatter="" Customization="" ColName="nvarchar6" RowOrdinal="0"/>
			</pnp:SiteFields>
			<pnp:ContentTypes>
				<pnp:ContentType ID="0x01005B4991FDA85A40479EC389582125A65F3C" Name="Test Content Type" Description="" Group="Test Group" NewFormUrl="" EditFormUrl="" DisplayFormUrl="">
					<pnp:FieldRefs>
						<pnp:FieldRef ID="fa564e0f-0c70-4ab9-b863-0177e6ddd247" Name="Title" Required="true" UpdateChildren="true"/>
						<pnp:FieldRef ID="db324795-e49c-4962-9821-3bab5b6848c1" Name="DescriptionTextTest" Required="true" UpdateChildren="true"/>
					</pnp:FieldRefs>
				</pnp:ContentType>
			</pnp:ContentTypes>
			<pnp:Lists>
				<pnp:ListInstance Title="Test List" RemoveExistingContentTypes="true" Description=" " DocumentTemplate="" TemplateType="100" Url="Lists/TestList" EnableVersioning="true" MinorVersionLimit="0" MaxVersionLimit="50" DraftVersionVisibility="0" TemplateFeatureID="00bfea71-de22-43b2-a848-c05709900100" ContentTypesEnabled="true" EnableAttachments="false" EnableFolderCreation="false" DefaultDisplayFormUrl="{site}/Lists/TestList/DispForm.aspx" DefaultEditFormUrl="{site}/Lists/TestList/EditForm.aspx" DefaultNewFormUrl="{site}/Lists/TestList/NewForm.aspx" ImageUrl="/_layouts/15/images/itgen.png?rev=47" IrmExpire="false" IrmReject="false" IsApplicationList="false" ValidationFormula="" ValidationMessage="">
					<pnp:ContentTypeBindings>
						<pnp:ContentTypeBinding ContentTypeID="0x01005B4991FDA85A40479EC389582125A65F3C" Default="true"/>
					</pnp:ContentTypeBindings>
				</pnp:ListInstance>
			</pnp:Lists>
		</pnp:ProvisioningTemplate>
	</pnp:Templates>
</pnp:Provisioning> 

The output we get from visual studio after executing ApplyProvisioningTemplate code:

CSOMApplyPnPTest.exe Information: 0 : 2023-07-31 02:01:47.3386 [List instances] [1] [Debug] Code execution scope ended 6479ms 165cff08-b4b0-4785-847d-06319df62026 CSOMApplyPnPTest.exe Information: 0 : 2023-07-31 02:01:47.3406 [ProvisioningTemplate WebHook Call] [1] [Debug] Code execution scope started 0ms 165cff08-b4b0-4785-847d-06319df62026 CSOMApplyPnPTest.exe Information: 0 : 2023-07-31 02:01:47.3426 [ProvisioningTemplate WebHook Call] [1] [Debug] Code execution scope ended 1ms 165cff08-b4b0-4785-847d-06319df62026 Exception thrown: 'Microsoft.SharePoint.Client.ServerException' in OfficeDevPnP.Core.dll An unhandled exception of type 'Microsoft.SharePoint.Client.ServerException' occurred in OfficeDevPnP.Core.dll The request uses too many resources.

Also we tried to apply the PnP template using PowerShell to a sample subsite located in a root site with the Turkish language. We obtained same error and a similar output as the one we received on the code side. (For this reason, I didn't share the output obtained from PowerShell.)

I tried to summarize the error as much as possible. Additionally, we have tried many methods. However, for keeping the issue text less complex, we currently want to share only the error part. We have been facing this error for over a month, and we are still encountering it actively.

We are looking forward to your suggestions,
Thank you,
Caner

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ApplyProvisioningTemplate entry point and reproduce the failure using the sample provisioning XML against a Turkish-language publishing root site and STS#3 subsite. Compare the user-authenticated and PowerShell cases with SharePointPnPCoreOnline 3.28.2012 and identify the first list operation that triggers the resource error. Done means the language-dependent cause is isolated and a verified remediation or narrowly scoped fix is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.