Search code examples
microsoft-graph-apioffice365apimicrosoft-graph-mail

Why do I get Gateway Timeout whenever my MS Graph API mail search finds no results?


As of this week I am suddenly getting gateway timeout from Graph when my mail search finds no results.

I am using a query like this one:

https://graph.microsoft.com/v1.0/users/[email protected]/mailFolders/AllItems/messages?$search="participants:[email protected]"&$select=from,subject,HasAttachments,Id,SentDateTime&$top=100

This is a Graph query which requests up to 100 emails from the Office 365 mailbox of [email protected] where the sender or receiver includes [email protected]. [email protected] is a mailbox that is shared with the account making the call.

My app is authenticated with the oauth2 authentication code flow and has been granted all necessary permissions.

This has been working for about a year. But starting a few days ago, this query only succeeds if results are found. When no results are found, the query takes 30 seconds, Graph returns UnknownError and the response is 504 with reasonphrase Gateway Timeout.

It seems as though something has changed in the Graph API - or perhaps in the Office 365 API, but I can't find any mention of it anywhere.

Microsoft specifically directs questions about the Graph API to stackoverflow, so here I am. I hope the right people are reading.

Why has this suddenly started happening and how can I fix it?

Update: there are now numerous reports of this issue, confirming that it's at Microsoft's end.

Github issue


Solution

  • We saw this question and were actively investigating this kast week. With July 4th long weekend I hadn't got back to this thread until now.

    This issue has been resolved on the back end of the service and you should not be seeing this issue anymore.

    Thank you so much for sharing the service issue here.