Microsoft.Graph.ServiceException: Code: timeout Message: The request timed out.

Tim Cusick 6 Reputation points
2021-02-06T10:29:58.973+00:00

We are periodically experiencing Microsoft Graph ServiceException timeouts while trying to read write documents to Sharepoint Online and are unable to determine why. We are using the latest version of the Microsoft Graph SDK. Some initial research has led us to the throttling page, which outlines that throttling could be an issue.

https://learn.microsoft.com/en-us/graph/throttling

This seems unlikely given that we have small usage numbers which should never approach 10,000 requests in a 10 minute window. It also looks like the Graph SDK automatically handles retries when being throttled. Any suggestions on how to determine what is causing these timeouts or better determine if throttling is happening through the SDK?

Thanks!

Community Center | Not monitored
{count} vote

1 answer

Sort by: Most helpful
  1. Mike Crowley 216 Reputation points
    2022-09-27T19:08:55.41+00:00

    I may have the same issue, though in my case, I'm not trying a bulk operation, just deleting a single, very large mailFolder. I get timeout errors with the SDK, though I've tried working around the SDK to no avail:

    #approach 1  
    Invoke-WebRequest -TimeoutSec <big number>  
      
    #approach 2  
    Invoke-RestMethod -TimeoutSec <big number>  
      
    #approach 3  
    $uri = 'https://graph.microsoft.com/v1.0/users/<redacted>'  
    $req = [Net.HttpWebRequest]::Create($uri)  
    $req.Headers.Add("Authorization", "Bearer $($token.AccessToken)")  
    $req.Method = "DELETE"  
    $req.Timeout = ($req.Timeout * 10) # Default is 100000  
      
    $response = $req.GetResponse()  
    $req      | fl  
    $response | fl  
      
    

    Are there better ways to manage/troubleshoot timeouts?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.