A clear path forward
How do I debug a 502 Bad Gateway error on my published app?
A 502 Bad Gateway error usually means your app crashed or returned output the server could not use.
VerifiedRH-0016v2
- Check the deployment logs for errors just before the 502 appeared.
- Find the underlying error. In a Node.js app, unhandled promise rejections or uncaught exceptions may cause the crash.
- Paste the error into a new Agent chat for help fixing it. Remove any secret values before sharing logs.
This example logs uncaught exceptions in a Node.js app without changing the default crash behavior, so the process still exits:
process.on("uncaughtExceptionMonitor", (err, origin) => {
console.error("Uncaught exception:", origin, err);
});
Logging an error is not the same as fixing its cause.
Did this get you unstuck?
Still stuck?
See what to include and open a support ticket.
Still stuck?
See what to include and open a support ticket.If this page did not solve it, contact Support and describe what you were trying to do and what happened, in your own words. You do not need to gather anything in advance.
Include in your ticket, if you know it
- What you were trying to do
- What happened, in your own words
- What you have already tried, if anything
Copying is optional. No ticket is submitted and no files are attached automatically; send your request in the support form.
Do not include passwords, API keys, or payment-card details.