TerminatingError(Get-PnPListItem)The remote server returned an error: (503) #3473
-
SharePoint Online / PowerShell 7.3.6 I am using -PageSize 1000 -ScriptBlock, so kind of confused what this 503 means. TerminatingError(Get-PnPListItem): "Exception calling "ExecuteQuery" with "0" argument(s): "The remote server returned an error: (503)" `Set-Location C:\Scripts\SPOCharacterCount $filerandom = get-random #Specify SharePoint Online Site URL or User's OneDrive Site URL Foreach ($Site in $SiteURL)
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Here is a random 503 error, @ CIM8186.JPG there are actually over another 100 files it does not query, but the 503 appears and stops querying the library, then moves on the next library. Checking file length: 91 /teams/SiteCollection_001/GCG-Corporate_00/00 Meeting 2012 at burg/CIMG8184.JPG Get-PnPListItem: C:\Scripts\SPOCharacterCount\GetCharacterCount_New.ps1:30:9 Get-PnPListItem: C:\Scripts\SPOCharacterCount\GetCharacterCount_New.ps1:30:9 moving on.... |
Beta Was this translation helpful? Give feedback.
-
I see this post [https://github.com//discussions/62] here as well about 429 and powershell is already trying to resolve the issue. Would this work where the 429 happens and the catch returns back to the function? I ask, because the $retryAfter does not go away. catch [System.Net.WebException] { |
Beta Was this translation helpful? Give feedback.
-
Is someone working to implement this in PnP PowerShell: https://github.com/pnp/pnpframework/blob/dev/src/lib/PnP.Framework/Extensions/ClientContextExtensions.cs#L178 |
Beta Was this translation helpful? Give feedback.
503 means that you are getting hard throttled.
Meaning that you have ignored soft throttling (429 error code) and are currently blocked.
I recommend read up on throttling, because when you attack the endpoints hard enough to get 503 (it takes an effort!) you will also affect other services on your tenant such as Onedrive sync, backup, other tasks using the endpoints.
Your tenant has an amount of Resource Units available per minute/day. How many depends on your number of licenses. Every request takes between 1 and 5 RU.
Once the request per minute are 80% used you will begin to receive rate limit headers telling you to slow down sending requests. Once you have used 90% of RU within a minut…