Invoke-PnPSiteTemplate : Access is denied. Error updating field
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
Expected behavior
Execute without issue
Actual behavior
At [Fields] step, throws an error when updating field. The field is a site column (StaticName=_ExtendedDescription) of type Rich Text.
...
[Fields] [16] [Error] Updating field {cb19284a-cde7-4570-a980-1dab8bd74470} failed: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDEN
IED)) : à Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
à Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
à Microsoft.SharePoint.Client.ClientRequest.<ExecuteQueryToServerAsync>d__53.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.SharePoint.Client.ClientRequest.<ExecuteQueryAsync>d__39.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.SharePoint.Client.ClientRuntimeContext.<ExecuteQueryAsync>d__65.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.SharePoint.Client.ClientContext.<ExecuteQueryAsync>d__28.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
à Microsoft.SharePoint.Client.ClientContextExtensions.<ExecuteQueryImplementation>d__6.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
à Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryRetry(ClientRuntimeContext clientContext, Int32 retryCount, String userAgent)
à PnP.Framework.Provisioning.ObjectHandlers.ObjectField.UpdateField(Web web, String fieldId, XElement templateFieldElement, PnPMonitoredScope scope, TokenParser parser, String originalFieldXml)
à PnP.Framework.Provisioning.ObjectHandlers.ObjectField.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation) 1978ms 3
b4a3ab5-5315-434f-bb96-19eac104bfd1
PowerShell_ISE.exe Information: 0 : 2023-02-27 16:09:07.3198 [Fields] [16] [Debug] Code execution scope ended 1985ms 3b4a3ab5-5315-434f-bb96-19eac104bfd1
PowerShell_ISE.exe Information: 0 : 2023-02-27 16:09:07.3208 [ProvisioningTemplate WebHook Call] [16] [Debug] Code execution scope started 0ms 3b4a3ab5-5315-434f-bb96-19eac104bfd1
PowerShell_ISE.exe Information: 0 : 2023-02-27 16:09:07.3228 [ProvisioningTemplate WebHook Call] [16] [Debug] Code execution scope ended 1ms 3b4a3ab5-5315-434f-bb96-19eac104bfd1
PowerShell_ISE.exe Information: 0 : 2023-02-27 16:09:07.3248 [Provisioning] [16] [Debug] Code execution scope ended 8405ms 3b4a3ab5-5315-434f-bb96-19eac104bfd1
Steps to reproduce behavior
Connect-PnPOnline -Url https://$tenantDest.sharepoint.com -Interactive
New-PnPSite -Type TeamSite -Title "My site title" -Alias mysite
Disconnect-PnPOnline
Connect-PnPOnline -Url https://$tenantDest.sharepoint.com/sites/mysite -Interactive
Invoke-PnPSiteTemplate -Path $templateFileName
What is the version of the Cmdlet module you are running?
PnP.PowerShell version 1.12.0
Which operating system/environment are you running PnP PowerShell on?
Windows 10
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.
Research direction
Start at PnP.Framework.Provisioning.ObjectHandlers.ObjectField.UpdateField, which appears in the reported stack trace, and reproduce the issue with the listed Connect-PnPOnline, New-PnPSite, and Invoke-PnPSiteTemplate commands. Done means the template applies successfully when updating the Rich Text site column without the access-denied error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100