PnP-PowerShell
PnP-PowerShell copied to clipboard
[BUG] Add-PnPClientSideWebPart : One or more errors occurred.
Expected behavior
Using "Add-PnPClientSideWebPart" will add a new webpart to an existing page.
Actual behavior
Unable to add any webpart to the page. Command will terminate with error message:
Add-PnPClientSideWebPart : Mindestens ein Fehler ist aufgetreten.
In Zeile:1 Zeichen:1
+ Add-PnPClientSideWebPart -Page $page -DefaultWebPartType Image
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Add-PnPClientSideWebPart], AggregateException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.WebParts.AddClientSideWebPart
Steps to reproduce behavior
Issue obviously depends on the tenant. We've the issue currently on one customer tenant and there it is reproducible in each and every case - no matter what kind of web part I try to add.
I had the issue once and again on several tenants over the last month (approximately since Oktober 2019). It mostly resolved after a while or I was able to circumvent it by changing back to an older PnP version. In our current case version 2004 was working for a while, but then stopped as well.
You might notice the same effect while applying a PnP-Template provisioning some client side pages. Outcome in that case is a normal script run, template got applied, but I will see the same error message as stated above at the end. As could be expected - the provisioned pages are just blank: No web parts deployed.
The best stripped down scenario to reproduce the error is as follows, but please keep in mind that the actual error scenario is tenant dependant - we've currently "only" one tenant that fails in that matter. But as said before - we had the same situation on several tenants in the last couple of month.
Connect-PnPOnline https://<mytenant>.sharepoint.com/sites/sample-site -UseWebLogin
$page = Get-PnPClientSidePage -Identity sample-page.aspx
Add-PnPClientSideWebPart -Page $page -DefaultWebPartType Image
Which version of the PnP-PowerShell Cmdlets are you using?
- [ ] PnP PowerShell for SharePoint 2013
- [ ] PnP PowerShell for SharePoint 2016
- [ ] PnP PowerShell for SharePoint 2019
- [X] PnP PowerShell for SharePoint Online
What is the version of the Cmdlet module you are running?
SharePointPnPPowerShellOnline 3.25.2009.1
How did you install the PnP-PowerShell Cmdlets?
- [ ] MSI Installed downloaded from GitHub
- [X] Installed through the PowerShell Gallery with Install-Module
- [ ] Other means
I'm experiencing the same issue currently. Couple of weeks ago everything worked well. Have been trying most recent version of PnP PowerShell and with version 3.22.2006.2.
@ohaak, do you have this issue still present on some tenants?
For me call to /_api/web/GetClientSideWebParts returns 403, could that be the issue here?
Only just begun to use SharePoint Online PnP PowerShell. When I try the example above:
Add-PnPClientSideWebPart -Page $page -DefaultWebPartType Image
I see the same error as @ohaak.
SharePointPnPPowerShellOnline version 3.26.2010.0