0%
SupportNotify API
Why Am I Getting 5xx Errors Repeatedly When Setting Up a Webhook?

Why Am I Getting 5xx Errors Repeatedly When Setting Up a Webhook?

Written by Author headshotKilliane Menand
Published on October 7, 20241 min read

Receiving repeated 5xx errors when setting up a webhook can indicate an issue with how your webhook listener is handling responses. This error is commonly triggered by Alchemy’s automatic retry logic when the webhook request isn’t successfully received or acknowledged.

  1. Non-2xx Response Codes: If your webhook listener doesn’t respond with a 2xx status code (e.g., 200 OK) after successfully processing the event, Alchemy will consider the request failed and trigger a retry. This is a common cause of 5xx errors.

  2. Delayed Responses or Timeout Issues: If your webhook listener takes too long to respond (e.g., running on a server with high latency or cold starts, such as AWS Lambda), it could result in a timeout and lead to repeated retries.

  1. Ensure a 2xx Status Code Response: Make sure your webhook listener sends a 2xx status code when it successfully processes the request. This confirms to Alchemy that the event has been handled, preventing unnecessary retries.

  2. Optimize Your Server Setup: If your server is experiencing delays (e.g., cold starts in cloud functions), optimize the infrastructure to handle requests faster. This can reduce timeouts and prevent Alchemy from retrying requests.

Alchemy’s webhook system uses a retry mechanism for non-200 responses or failures to reach your server. The system retries webhook requests to ensure reliable delivery, but if your listener isn’t responding properly, this can lead to multiple attempts and 5xx errors.

To learn more about retry logic, refer to the Webhook Retry Logic.

By ensuring your server responds with a 2xx status code and optimizing response times, you can avoid repeated 5xx errors when setting up a webhook!

Was this article helpful?
Share:
Banner background image

Not finding what you need?