Question

Mern stack getting 504 when trying to connect to Stripe webhooks

Hi all, my 504 bad gateway time-out log says Request failed with status code 504\n at https://my_website/static/js/main. My app is build via a droplet. Of course it works locally… Any suggestions or help would be greatly appreciated, thanks!

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
June 11, 2024

Hey!

What I could suggest here is to check your server logs to identify any internal server errors or bottlenecks that might be causing the delay.

Also, the 504 error is quite generic, but to find a more meaningful message, you could check your fogs from your web server (like Nginx or Apache) and application logs from Node.js will be particularly useful.

Also, what might help is to check the Stripe dashboard to see if the webhooks are failing from Stripe’s end and review any provided error messages or logs.

Besides that, what I could suggest here is to use a tool like curl or possibly Postman to simulate webhook calls to your server to ensure it can handle them appropriately. That way you could run the request from your laptop and see if the issue is on the server side or on the Sripte side.

Feel free to share more details once you have the extra debugging info here!

- Bobby

KFSys
Site Moderator
Site Moderator badge
June 11, 2024

Heya @swimminglapiswalrus,

I’ll recommend you to check the Application logs rather than your Nginx’s logs. In the application logs you should be able to see the specific error behind this behavior.

Once you have the error you can further troubleshoot the issue.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel