Troubleshooting guide
Error 503 Backend fetch failed (Varnish): how to fix it
Varnish (also behind Fastly and many hosts) could not get a response from the backend server. The "Guru Meditation" page includes an XID you can find in the logs.
3 min read10 sectionsUpdated
On this page
What it means
Varnish fetches from a backend (your application server) when it has no cached copy. If the backend is down, marked unhealthy by health probes, too slow for first_byte_timeout, or returns something Varnish cannot handle, it answers "Error 503 Backend fetch failed" with a Guru Meditation XID.
Fixes if it is your site
Look up the XID in varnishlog to see the backend error, check backend health with varnishadm backend.list, and test the backend directly. Raise timeouts only after fixing slow endpoints.
varnishadm backend.list
varnishlog -q "VXID == 12345" -g request
curl -sI http://127.0.0.1:8080/ -H "Host: example.com" # the backend directlyWho produced the error: the CDN or your origin?
CDN error pages are generated at the edge, but most of them describe a problem behind it. Request the origin directly (with the right Host header) to see whether it answers on its own; compare response headers with and without the CDN; and check the CDN’s status page to rule out a provider incident. Keep an uptime check on the public URL (through the CDN) and, if you can, another on the origin, so an alert tells you straight away which side failed. During an incident, post a short update on a status page that does not depend on the same CDN.
How site owners catch this before visitors do
Most visitors who hit Error 503 Backend fetch failed (Varnish) leave without telling you. An uptime check every minute, with a keyword assertion on the page and an SSL check on every run, turns this from a support ticket into an alert. Keep the history: errors that come and go (one region, one server behind a load balancer, one in twenty requests) only make sense on a timeline. Put the result on a status page so people stop guessing. You can test any address now with the free website down checker.
Related reading
- ERR_CONTENT_DECODING_FAILED: how to fix it: Fix ERR_CONTENT_DECODING_FAILED: wrong Content-Encoding headers, double gzip compression, broken Brotli, PHP output buffering and proxies, with tests.
- React hydration error: causes and how to fix it: Fix React "Hydration failed" and text mismatch errors in Next.js: dates, random values, browser-only APIs, invalid HTML nesting and extension interference.
- Cloudflare error 1016 "Origin DNS error": how to fix it: Fix Cloudflare error 1016 Origin DNS error: CNAME records pointing to names that do not resolve, deleted origins and load balancer pools, with checks.
- net::ERR_FAILED: how to fix it: Fix net::ERR_FAILED in Chrome and the console: CORS preflight failures, service workers, blocked requests, cache problems and extensions, step by step.
- 400 Bad Request: what it means and how to fix it: Fix a 400 Bad Request error: oversized cookies, malformed URLs, invalid JSON bodies and proxy rules, with commands to find which layer rejected it.
- 422 Unprocessable Entity: how to fix it: Fix 422 Unprocessable Entity (Unprocessable Content): validation errors in APIs and forms, CSRF tokens in Rails and Laravel, and how to read the error body.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.