Forum Discussion
Graph API to SPO is returning 504 responses and is taking more than usual time to complete requests
I have Http triggered Azure functions that interacts with SharePoint Online using Microsoft Graph SDK, the solution is in production for couple of years - it creates documentsets/uploads files/updates metadata etc.,. In past month or so it appears that the http calls are taking more than usual time to complete. Below is one such example,
Few observations,
1) The Graph api calls are retried multiple times (exponential back-off) due to gateway timeout errors (504 response).
2) The first 3 Graph calls terminates around 30 seconds due to 504.
3) The last Graph call errors out with 409 - eTag mismatch error,
Code: resourceModified
Message: The resource has changed since the caller last read it; usually an eTag mismatch
Inner error:
AdditionalData:
date: 2023-03-01T11:21:53
request-id: 570d092f-8980-44f1-a1a1-8d5185e6006a
client-request-id: 570d092f-8980-44f1-a1a1-8d5185e6006a
ClientRequestId: 570d092f-8980-44f1-a1a1-8d5185e6006a
4) We believe the number of calls are within the throttling threshold.
Questions:
1) Why are Graph API calls are terminating at 30th second? Is this a default setting of the Graph SDK? If so, is it recommended to change?
2) How to avoid eTag mismatch error while updating metadata, or, uploading files? In our use case, all operations are replace of existing data. (Note: We have observed this error in scenarios where there is only one call targeting an item in SharePoint.)
3) Is there a way to determine which applications is contributing to breaking throttling threshold?