pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
987 stars 665 forks source link

Random errors from cmdlets #2734

Closed MortenPedersenDK closed 3 years ago

MortenPedersenDK commented 4 years ago

Reporting an Issue or Missing Feature

I have a script for provisioning site artifacts. When running them, I get random errors. Most often I just reissue the command a few times, and all of a sudden i works.

One of the errors I currently see a lot is: Add-PnPClientSidePage : Objekt-id'et "site:91866902-2509-4425-a591-ad749a9694a0:web:2bdf94e4-aab9-47e4-a28a-dfec3674295c" er ugyldigt.

Which is in danish and means that the object id is invalid.

It is not limited to Add-PnPClientSidePage. I also often see it in Add-PnPField too.

After 1-5 retries, it completes without error.

Expected behavior

Cmdlet completes without error.

Actual behavior

Add-PnPClientSidePage : Objekt-id'et "site:91866902-2509-4425-a591-ad749a9694a0:web:2bdf94e4-aab9-47e4-a28a-dfec3674295c" er ugyldigt. At line:1 char:9

Steps to reproduce behavior

$page = Add-PnPClientSidePage -Name "My page" -LayoutType Home

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

3.22.2006.2

How did you install the PnP-PowerShell Cmdlets?

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

KoenZomers commented 4 years ago

Random errors are unfortunately extremely hard to troubleshoot. Are you familiar with Fiddler and could you let it run, capturing your network traffic from your PowerShell session, while you execute your scripts? Would be interesting to see what it reports on the network traffic level. Could very well be that the problem lies with the SharePoint and/or Graph APIs.

KoenZomers commented 4 years ago

Feels like it could be related to https://github.com/pnp/PnP-PowerShell/pull/2735. Do you have the same experience when using a PnP PowerShell of March 2020 or older?

MortenPedersenDK commented 4 years ago

Sorry for late feedback.. I managed to configure the sites by partly PowerShell and partly mouse/keyboard. I have a bunch of sites I need to configure next week, and if problem is still there, I will try earlier version of PnP PowerShell as well as Fiddler trace.

Regarding Fiddler, I do have a concern, that it will disclose access tokens, which I then would have to remove first. Anyone having any experience with this, and can tell if this would pose a security risk?

I do not think that #2735 is related.

MortenPedersenDK commented 3 years ago

Did not have the problems with the next sites....