WebDeveloper
WebDeveloper

Reputation: 201

Error 503 Backend fetch failed

I have this error in my site

Error 503 Backend fetch failed

Backend fetch failed

Guru Meditation:

XID: 526707

Varnish cache server

Anyone know what may be the cause or how to find out what happens?

Upvotes: 20

Views: 63815

Answers (4)

syzygy333
syzygy333

Reputation: 123

We see this on our Drupal site sometimes. Forgive me if you don't follow the Drupal-isms here, but, basically, there are Drupal entities that can reference other content entities (nodes), and in some situations you can have an entity hold many of these references. Let's say you add 4 references to one of these entities but you only specify the content (add IDs) for 3 of them, leaving the fourth one blank, it will result in this error.

Upvotes: 0

harri
harri

Reputation: 564

This can be due to the length of cache tags used by Magento exceeding Varnish’s default of 8192 bytes.

This can be solved by modifying the varnish configs:

  • CentOS 6: /etc/sysconfig/varnish
  • CentOS 7: /etc/varnish/varnish.params
  • Ubuntu: /etc/default/varnish

Find http_resp_hdr_len. If the parameter doesn’t exist, add it after thread_pool_max.

Magento suggests setting http_resp_hdr_len to a value equal to the product count of your largest category multiplied by 21.

For example, setting the value to 65536 bytes should work if your largest category has 3,000 products:

-p http_resp_hdr_len=65536 \

See here: http://devdocs.magento.com/guides/v2.0/config-guide/varnish/tshoot-varnish-503.html

Upvotes: 1

moebin
moebin

Reputation: 59

There's a common reason that varnish returns 503 that is not explained on the varnish error list. I have learnt this from experience.

If your web server is returning 500 error or similar then varnish simply says Error 503 Backend fetch failed.

what you need to do is to always try to fetch without varnish to see if the error is in varnish or the web server. For example if you have a different hostname for the webserver, load that and find the error, if you fix that, then restart varnish and that solves it most of the time.

Upvotes: 5

crico_aven
crico_aven

Reputation: 401

That means that Varnish has been properly configured to accept incoming connections, but is not yet available to serve your backend. This error is common when varnish receives a request but your backend is still restarting/releasing.

Upvotes: 3

Related Questions