sendgrid-csharp: Intermittent HTTP500 response from API
In the last few days I have bee getting a lot of HTTP 500 responses from SendGrid API. What’s more confusing is that these exception seem random: what I mean is that sometimes a given HTTP request will work fine but repeating the exact same HTTP request a few seconds later results in a HTTP 500 response.
I didn’t worry about it at first because it seemed like these exceptions started occurring around the time that SendGrid disclosed a technical issue which was followed by a scheduled maintenance. Both incidents have been resolved and I continue to experience the HTTP500 exceptions so I’m starting to worry about it.
Sometimes, the response looks like this:
HTTP/1.1 500 INTERNAL SERVER ERROR
{"errors":[{"message":"Sorry, some unexpected error occurred."}]}
but most of the time the response looks like this:
HTTP/1.1 500 INTERNAL SERVER ERROR
{"errors": [{"field": null, "message": "internal server exception"}]}
Sometimes I’m getting this exception when issuing a very simple HTTP GET such as:
GET https://api.sendgrid.com/v3/user/profile
or
GET https://api.sendgrid.com/v3/tracking_settings?limit=25&offset=0
and sometimes I’m getting this exception when issuing a more complex HTTP POST such as:
POST https://api.sendgrid.com/v3/templates/af51921e-f942-4477-8a1b-95044b092108/versions
{"name":"StrongGrid Integration Testing: version 2","subject":"My second Subject <%subject%>","html_content":"<html<body>Qwerty<br/><%body%></body></html>","plain_content":"Qwerty <%body%>","active":1}
Here’s a trace captured in Fiddler showing the exact same HTTP GET call repeated 4 times only a few seconds apart. As you can see, it failed the first three times and it finally succeeded on the fourth attempt:

So far I haven’t been able to detect any pattern and the fact that my HTTP calls sometimes work and sometimes fail leads me to believe my calls and/or the data posted in my calls is most likely not the culprit (although I’m keeping an open mind).
I know this is not a C# client issue so I have already contacted SendGrid support (ticket number 1348907) about this, but I figured I would post here in case someone else is experiencing the same problem.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 29 (13 by maintainers)
@childish-sambino I guess you didn’t take the time to review this issue because you would have noticed that I opened a case with SendGrid support more than two years ago! To be frank with you, I gave up in September 2018 when I was told by SendGrid’s support that the repeatable issue I was experiencing was not high enough priority to warrant someone investigating it (I invite you to review case number 1362778 if you are interested in more details).
@davidmwilliams I raised this issue and opened a case with SendGrid’s support team over two years ago and nobody ever got back to me. Last time I contacted support to ask for an update was in September 2018 and I was told that my case
has not been high enough priorityand thatother issues with more priority have been keeping it from being worked on. Soon after that the case was closed without an explanation.The
HTTP 500errors have slowly subsided over time and as of today I am no longer experiencing these errors but I have no idea why.I hope that SendGrid support takes you more seriously than they did me when I reported the problem and that you get a resolution in a more reasonable time frame. Good luck!
Did this ever get resolved? We’re getting curious “Internal server error” failures from SendGrid too.
1362778
In the mean time, I heard from Kyle: he says the Ops team is still investigating and they asked him for additional information. His latest theory is that this is related to HTTP DELETE calls but I replied to him that I am able to reproduce the issue even when eliminating DELETE calls from my testing script.
I was contacted on Thursday and told that the team is now able to reproduce the issue and that the ticket was escalated to the Ops team.