Symptoms
- Your browser shows 502 Bad Gateway instead of your site.
- It may happen for a few seconds, or it may stay until you act.
- Other apps on the same server may still work.
Cause
Every server runs a small web proxy in front of your apps. A web proxy is a program that receives each visitor's request and passes it to the right app. Each app runs in its own containers (isolated boxes for one program), and the proxy talks only to the app's web container.
A 502 means the proxy reached your server's address, but the app's web container did not answer. On our platform the usual reasons are:
- the app is stopped, or it is restarting after you or a teammate pressed Restart;
- the app crashed, for example because it ran out of its own memory limit, and is starting again;
- the app is still being installed or updated;
- the app has a fault that makes its web service fail to start.
Each app's containers restart automatically if they stop unexpectedly, so a short 502 often clears by itself.
How to fix
- Wait one minute and reload the page. A restart or an automatic recovery often finishes in that time.
- In the console, open Applications and find the app. Check its Status. Running is good. Stopped, Restarting or Needs attention explain the 502.
- If the status is Stopped, open the app and press Start.
- If the status is Needs attention, open the app's Logs tab and read the latest lines. Use Show lines containing with words like
error,fatalormemoryto find the cause. See Read your app's logs. - Press Restart on the app page and confirm. The app is unavailable for a short time while it restarts.
- If the 502 returns again and again, the app is probably crashing. See App keeps restarting and App runs out of memory.
Viewing logs and restarting need the owner, admin or developer role in your organisation.
When to raise a ticket
Use Raise a ticket on the Support page if the 502 stays after a restart, or if the logs show nothing you can act on. Include:
- the app name and the server name;
- the address that shows the 502 and the time it started (with your time zone);
- what changed just before (a plugin, a theme, an update, more traffic);
- a few log lines that look relevant.
Never include passwords, private keys or API keys.
Was this helpful?
Still need help?
24/7 support from our team. Sign in to the console to raise a ticket about this.