Replies: 2 comments
-
With no code and real errors it's hard to figure out exactly what is failing. Related to this, as this is something that can trigger a restart, always make sure that code that returns something is either assigned to variables or piped to out-null (especially when calling PnP methods on objects such as Add() and similar Release connections when used. Use proper error handling and pipe to relevant streams (verbose, warning, error, output). Setting up diagnostics will enable sending logs to log analytics and Azure monitor where alerts can be configured Even though throttling should be handled in PnP core I still have response http error checks and retry logic for dropped connections Hope this helps |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. Yes I'm aware of what you mentioned in regards to assigning return values to variables and I've made sure of that. Here's a piece of code that was hanging on Access Denied error the whole day and when it was retried later in the afternoon it executed without issue.
The complete stack trace: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We are using PnP Powershell and the Provisionning engine to enforce governance and control on the SharePoint and Teams sites that get created across the organization.
SharePoint sites, Teams and Groups are created and configured by Azure Automation PowerShell Runbooks (with the help of PnP.PowerShell vers 1.10.0 cmdlets). The runbooks are executed with a client app/certificate which has proper permissions on the tenant.
However, we are experiencing some very sporadic and random errors all over the place. Errors that would get resolved by simply retrying the runbook. Sometimes it would run fine, and sometimes it would give all sorts of errors and fail.
I've been thinking could throttling be causing us all these problems? It's especially troublesome when we try to provision multiple sites at the time. The concurrency had been manually reduced to 1 site at a time but it's still sluggish sometimes.
We would get random Access Denied errors, "Object reference not set to an instance of an object" errors, or "Cannot find an overload for Add and the argument count: 1" when doing Invoke-PnPQuery or Invoke-PnPSiteTemplate.
Anyone has some insights, ideas or tips that they can share?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions