8

I'm working to integrate Microsoft Graph with a Rails web application. We're trying to send multiple email messages via Graph, but every now and then we get a 503 Service Unavailable with the following headers and body:

Response headers:

{
  "content-type": [
    "text/html; charset=us-ascii"
  ],
  "server": [
    "Microsoft-HTTPAPI/2.0"
  ],
  "date": [
    "Wed, 30 May 2018 22:05:31 GMT"
  ],
  "connection": [
    "close"
  ],
  "content-length": [
    326
  ]
}

Response body:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
    <TITLE>Service Unavailable</TITLE>
    <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
</HEAD>
<BODY>
    <h2>Service Unavailable</h2>
    <hr>
    <p>HTTP Error 503. The service is unavailable.</p>
</BODY>
</HTML>

We use the POST https://graph.microsoft.com/v1.0/me/sendMail call to send hundreds of outlook emails. After sending roughly 100-200 emails with the Graph API we get the 503 Service Unavailable error. This is problematic when we have to send 1000+ customized emails since it is unclear to me how we could properly handle the error without knowing how long to wait before retrying and other Graph API request.

I'm wondering if anyone has run into a similar issue before. I've read about something similar along the lines of client throttling (Microsoft Graph API - Throttling), but in this post, they're getting 409 (with a retry-after header), not 503.

Based on the Graph documentations, we're supposed to receive a JSON object that may contain a Retry-After header. However, as shown above, we're neither getting the Retry-After header nor a JSON object for the 503 error.

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
Jack
  • 441
  • 3
  • 13
  • Sorry that you are running into this issue. This is certainly not a case of throttling. Can you share the region where your client is calling to Microsoft Graph? Also, it would be helpful to know the time range of this failure. – Sriram Dhanasekaran-MSFT Jun 02 '18 at 02:56
  • @SriramDhanasekaran-MSFT: On **2018-05-30**, our server in **Oregon** tried at 8:16:21pm UTC / 9:07:43pm UTC / 10:05:42pm UTC (other attempts as well). Our server in **Virginia** sent a few tries on the same day, 12:43:39pm UTC / 3:04:14pm UTC / 10:22:03pm UTC. Let me know if that helps! – Jack Jun 02 '18 at 20:50
  • We also have the same issue ... any update ? – MoShe Jun 10 '18 at 07:53
  • After monitoring our servers for a while, it looks like we get them during the mornings (9-12pm EDT). We just got a few of those 503 errors a few minutes ago (11.15-11.20am EDT). Any news on this issue @SriramDhanasekaran-MSFT? – Jack Jun 18 '18 at 15:31
  • @SriramDhanasekaran-MSFT: To follow up on the issue, we got the same error a few hours ago but this time we're receiving a different message. We're now correctly receiving a **JSON** for both **503/504** server errors, but both of them return the error message **UnknownError** (instead of HTML with "Service Unavailable" or "Gateway Timeout" text). Let me know if this info helps fix this issue. – Jack Jul 11 '18 at 16:33

1 Answers1

1

As an update here. In future for any 500 error messages, you are best to raise these as service issues as per the instructions here https://developer.microsoft.com/en-us/graph/support

Have a paid Azure subscription? Visit the Azure Admin Center. https://ms.portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/newsupportreq

Have a Premier support contract for Microsoft 365? Visit the Microsoft 365 Admin Center and use the Support menu. https://admin.microsoft.com/

Jeremy Thake MSFT
  • 2,058
  • 2
  • 13
  • 11