Skip to content

Set-PnPListItem: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing #3336

Answered by jpwegmuller50
gruering asked this question in General
Discussion options

You must be logged in to vote

I'm running into the same issue updating 55,000+ items. I'm using a quick and dirty way around this by retrying one time if it times out (sample code below). So far that's been enough of a workaround.

          try {
            Set-PnPListItem -List $MatrixList -Identity $matrixItemId -Values $values -UpdateType UpdateOverwriteVersion -Batch $batch
          } catch {
            # if timed out, try again
            if ($PSItem.Exception.Message.IndexOf("HttpClient.Timeout") -ne -1) {
              Write-Host "  timed out, trying again..."
              Set-PnPListItem -List $MatrixList -Identity $matrixItemId -Values $values -UpdateType UpdateOverwriteVersion -Batch $batch
            …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gruering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants
Converted from issue

This discussion was converted from issue #3306 on August 09, 2023 18:11.