Nylas returns 500
responses when it encounters a server-side error.
Error 500
- Server Error
Cause: An error occurred on the Nylas server.
Solution: If the error persists, check the Nylas status page for ongoing outages.
Error 502
- Bad Gateway
The upstream server is unavailable, please try again…
Cause: An error occurred on the Nylas server.
Solution: If the error persists, check the Nylas status page for ongoing outages.
Error 502
- Server Error
Cause: An error occurred on the Nylas server.
Solution: If the error persists, check the Nylas status page for ongoing outages.
Error 503
- Service Unavailable
Microsoft
Cause: The Nylas Folders API received too many requests.
Solution: Implement an exponential back-off retry strategy.
Error 503
- Server Unavailable
Microsoft
Error 503’ Throttle Header, ‘X-MS-ASThrottle: CommandFrequency
Cause: The server received too many commands.
Solution: If you’re using a managed Microsoft Exchange account, contact your email administrator to increase the CommandFrequency
threshold. By default, Exchange servers block requests after receiving 400 commands within 10 minutes.
Error 503
- Server Error
Cause: An error occurred on the Nylas server.
Solution: If the error persists, check the Nylas status page for ongoing outages.
Error 504
- Provider Error
Cause: Nylas is having trouble connecting to the provider. The error message gives more information about the details of the failure.
In most cases, if your project implements an exponential back-off retry strategy, the request eventually succeeds. Some common reasons a request could fail with a 504
error are listed below.
Request timed out
This error happens when a request takes too long to process. Nylas has a request SLA of 90 seconds, after which it terminates the request and sends a timeout error. You might run into timeout errors in the following scenarios:
- Request fanout: For Microsoft grants, a single request to the Nylas Threads API can cause Nylas to make multiple Microsoft Graph API requests. Nylas has to make at least one Microsoft Graph API request per message in the thread you’re working with. Because of this, the total time for all the requests can easily exceed 90 seconds. To avoid this, try to retrieve, update, and delete individual messages from a thread instead of working with the thread itself. If you’re experiencing timeout errors when making a Get all Threads request, try again with a smaller
limit
. - Server busy: For on-prem Exchange grants, a request might time out when your Exchange server has too many requests to process. When this happens, you might also see
429
errors. When an Exchange server is overloaded, it can tell new requests to wait and try again later. The wait time could be 90 seconds or longer, which means that the request might exceed Nylas’ SLA. To avoid this, try making fewer concurrent requests, and implement an exponential backoff strategy. - Slow IMAP server: For IMAP, a request can timeout when the email server responds slowly to large requests (for example, when you update or delete a thread). If this happens often, we recommend contacting your IMAP administrator and asking them to scale up their servers.
- Post filtering: Nylas supports many request filters that provider APIs might not use, or that might be case-sensitive on the provider. In these cases, Nylas makes a request to the provider APIs without the filter, receives the response, and searches for results that match the filter in your request. This might result in a request timeout, especially if the provider returns a long list of results or there are no results that match your filter. To avoid timeouts, try searching for objects in a smaller window of time, or use a larger
limit
so Nylas can paginate through the results more quickly.
IMAP server errors
IMAPThis error happens when an IMAP server doesn’t support certain operations, like renaming or removing a system folder. It can also happen if the IMAP server is unstable.
There’s nothing Nylas can do in these cases, because this is an issue with the IMAP provider’s server. Your best course of action is to contact your IMAP administrator and ask them to support specific IMAP commands, or find what’s making the server unstable (and fix it).
Internal errors
Microsoft GoogleSometimes, the Google or Microsoft Graph APIs return internal errors. This is usually caused by bugs on the provider. Learn how to get support if you encounter this often.
Error 550
- Service Unavailable
The message was classified as spam and may not be delivered.
Cause: Some providers review all outbound messages through their spam filter before sending to preserve their email-sending reputation. Spam filters work by comparing messages to an extensive list of matching behaviors and giving each a score. If a message is blocked by a provider’s spam filter, Nylas returns that in its 550
response. However, Nylas doesn’t have any visibility into what exactly caused the block.
Solution: Take a look at our Dealing with spam guide.