504 gateway timeout on grant permission to one drive shared link

Pooja Vernekar - External 0 Reputation points
2023-09-26T15:38:21.1366667+00:00

We are receiving 504 gateway timeout on graph when we try to grant permission to 234 recipients to shared one drive link

Caused by: com.microsoft.graph.http.GraphFatalServiceException: Unexpected exception returned from the service.Error code: UnknownError

Error message:

POST https://graph.microsoft.com/v1.0/shares/u!aHR0cHM6Ly9vMzY1dGVzdGRldmFob2xkZGVsaGFpemUtbXkuc2hhcmVwb2ludC5jb20vOmk6L2cvcGVyc29uYWwvcG5sdGdmOGhfZW1lYWR0YV9yb3lhbGFob2xkZHRhX25ldC9FZTJTeDd3R25PWkZnTWpVNlJFZEZra0JsUldsdGk4NU83cGNrRC1rNXpwSTlR/permission/microsoft.graph.grant

SdkVersion : graph-java/v5.49.0

[...]

504 : Gateway Timeout

[...]

Is there any limit on the recipient numbers

Microsoft Teams | Development
Microsoft Security | Microsoft Graph
{count} votes

2 answers

Sort by: Most helpful
  1. Prasad-MSFT 9,071 Reputation points Microsoft External Staff Moderator
    2023-09-27T06:02:24.36+00:00

    The 504 Gateway Timeout error typically indicates that a server did not receive a timely response. In this case, it's possible that the operation of granting permissions to a large number of recipients is taking longer than the server's wait time, hence the timeout error.

    As a workaround, you could try to split the operation into smaller batches and add some delay between each batch to avoid hitting the rate limit.

    Thanks, 

    Prasad Das

    ************************************************************************* 

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    1 person found this answer helpful.
    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

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.