EXPLAINER

Your app shows a number instead of a page: what it's telling you

Three of the most common hosting errors mean three very different things — a broken answer, a refusal, and silence — and each one has a different first move.

9 min read
ON THIS PAGE
SHORT ANSWER

What is the difference between a bad gateway, service unavailable and gateway timeout error?

They describe three different failures. A bad gateway (502) means your app replied with something unusable. Service unavailable (503) means your app is there but refusing work — busy, asleep or restarting. A gateway timeout (504) means your app was asked a question and never replied, so the waiting stopped. Broken answer, refusal, silence.

Your app was fine this morning. Now there's a white page with a number on it, someone has messaged you, and you're trying to work out whether you broke it or whether somebody else did.

Every modern app has a middleman. When somebody types your web address, they don't reach your code directly — they reach a layer in front of it that handles the address, the security certificate and the routing. Your AI tool set this up without mentioning it. Netlify, Vercel, Cloudflare, Supabase, Render and Railway all work this way.

All three of these errors are that middleman reporting on your app. That's the useful thing to hold onto. It's rarely the hosting being down — it's the hosting saying honestly that your side didn't hold up its end. Which feels worse, but is better news, because you can usually do something about it.

What does a 502 Bad Gateway error mean?

It means the middleman reached your app and got back an answer it couldn't make sense of. Your app replied with something, but not something usable — half a sentence, in effect.

Azion's reference page on this error describes it as an invalid response from the thing sitting behind the middleman — an application crash, a malformed reply, or a connection that closed unexpectedly. It lists memory running out and killing the process as a common cause of that last one.1

  • Your backend code crashed partway through answering. It started to reply, then fell over.
  • A piece of backend code never started at all. Supabase's troubleshooting index lists a boot failure among its documented problems — code that couldn't start, so there was nothing there to answer with.6
  • Something ran out of memory. Often a loop that fetches a list, and the list got big.
  • A recent publish went out broken. If the last thing you did was ask your AI tool to change something and then ship it, look there first.

This is the one most likely to have been caused by your most recent change. Check what you shipped last, before you change anything else.

What does a 503 Service Unavailable error mean?

It means your app is reachable but declining to serve anyone right now. Azion attributes it to overload, planned maintenance, or running out of resources.1

For anyone who built with Supabase, Lovable, Bolt or Base44, one cause dwarfs the rest: the database went to sleep. Free Supabase projects pause when nothing touches them. The widely used supabase-pause-prevention project on GitHub exists for exactly this reason and states that on the free tier, projects inactive for more than seven days are paused.7

If you built something, showed it to people, then didn't open it yourself for a week and a half, your database may simply have switched itself off. The app loads, logins fail, and anything that needs data comes back empty. The fix is embarrassingly simple: log into your Supabase dashboard and restore the project. It takes a minute or two, and your data is still there.

  • Too many people at once. You built it for you clicking around; then it got posted somewhere and two hundred people arrived.
  • You hit a plan limit. Free tiers stop serving when you go over, and they stop with exactly this message.
  • The service is mid-restart. If you just published, wait sixty seconds and try again.

What does a 504 Gateway Timeout error mean?

It means something in your app took too long and the middleman stopped waiting. Your code was almost certainly waiting on something else that was slow.

Vercel documents this precisely. Its reference page for a piece of your backend code running past the time it's allowed maps that condition straight to this timeout, and calls it an application error rather than a platform one. Its first instruction is to make sure any database or outside service your code calls answers inside the time limit your plan allows.2

An engineering write-up from axonbuild notes that the same timeout can come from five different things: a slow database query, a slow outside service, a reply that never gets sent, an endless loop, or a mismatch in how the code is run. Five problems, one identical symptom — worth knowing before you spend an hour chasing the wrong one.5

7 days7
of inactivity pauses a free Supabase project, taking your app's data offline
55
distinct causes that all produce the same timeout symptom

In AI-built apps there are two common versions. One is a call to a language model inside your app — those can take twenty or thirty seconds, and your hosting is often only willing to wait ten. The other is a database query that got slow as data grew: instant with fifty rows, painful with fifty thousand.

A long-running Vercel community discussion on this exact timeout captures the flavour of the panic: every page failing, the problem showing up only on the live site, and nothing reproducing on the builder's own machine. That pattern is characteristic, because your laptop has nobody standing over it with a stopwatch.4

How do I tell which one I've actually got?

Open your own app in a private browsing window. Not a normal tab — a normal tab may show you a saved copy and convince you everything is fine.

  1. Find the number
    If the page shows one, you have your answer. If it's a blank white screen with nothing on it, open your hosting dashboard and read the most recent entries in the log — it will be there.
  2. If your app is refusing work, check whether the database is asleep
    This is the highest-value check in the list and takes about thirty seconds. Open your Supabase dashboard and look for a paused project.
  3. If your app gave a broken answer, look at what you published last
    Roll it back if you can. Most building tools have a one-click way to return to the previous version. Then change one thing at a time.
  4. If your app went silent, find the slowest thing it waits for
    Usually a call to a language model, or a query over a table that has grown. Ask your AI tool to send a reply straight away and finish the slow work afterwards.
  5. Describe it properly when you go back to your AI tool
    Don't paste "it's broken." Paste the number, the page it happened on, and what you changed last. The quality of the fix depends almost entirely on the quality of that sentence.
PASTE THIS INTO YOUR AI TOOL
My live app is returning [the error you saw] on the [page name] page. It works fine in preview. The last change I made was [what you changed]. Walk me through the most likely cause, starting with anything that waits on a database or an outside service. If something is slow, change it so the page replies immediately and finishes the slow work in the background.

How do I find out before a user tells me?

Set up something that opens your app on a schedule and tells you when it stops answering. Each of these failures is fixable in minutes; what isn't fixable is the ninety minutes it was broken before anybody mentioned it, or the people who saw a white page and never came back.

ToolWhat it's like to useBest for
UptimeRobotFree tier, lots of places around the world it can check from. Set-up asks for technical choices you may not have opinions about.Someone comfortable with the settings
Better StackPolished and powerful, built for engineering teams, with a lot of alerting machinery you won't use.A team with engineers in it
PingdomLong-established, with detailed performance reporting and deep history. Priced for businesses.Companies with a budget for it
Uptime KumaFree and excellent, but you run it yourself — which means a second app that can break.People who like running their own things
FomioPaste a link and it works out what to watch. Reports one of three things: Working, Having trouble, or Down.Someone who built an app with an AI tool and isn't an engineer
Tools that watch an app and tell you when it stops answering

Be clear about where the others win. UptimeRobot checks from more locations around the world than Fomio does. Pingdom and Better Stack keep far deeper history and far richer performance data. If you want graphs and fine-grained control over every setting, they're better at that, and it isn't close.

What Fomio does differently is the part that matters at eleven at night when the app is down and you don't know why. When it finds a problem it says in plain language what likely went wrong, and on the paid plans it writes the prompt for you to paste straight into Lovable, Replit, Bolt or Cursor — no translation step between "something is wrong" and "here's what to say to fix it."

The free plan watches one app, checks it every five minutes, emails you when it breaks, and keeps a week of history. It needs no card. Builder watches three apps, checks every minute, includes the fix prompts and keeps a month. Pro watches fifteen and gives your users a status page they can check themselves. Current prices are at fomio.ai/pricing.

What should I do today?

Work out which of the three you're looking at: a broken answer, a refusal, or silence. Each one has a different first move, and the list above gets you to it in under a minute.

Then put something in place that notices next time before your users do. If it explains the problem in words you already use rather than words you'd have to look up, so much the better.

Questions people also ask

WHERE THIS COMES FROM

  1. 502 Bad Gateway Error | Causes and Solutions — Azion
  2. FUNCTION_INVOCATION_TIMEOUT — Vercel Docs
  3. Error Codes — Vercel Docs
  4. Error 504 · Discussion #4788 — vercel/community on GitHub, 9 November 2023
  5. Vercel Function Timeout: Limits, Causes, and Fixes — axonbuild
  6. Troubleshooting — Supabase Docs
  7. supabase-pause-prevention — travisvn on GitHub
KEEP READING
Read this as markdown