Error 503 Backend fetch failed How to fix it ( Easy Essential Guide )

Error 503 backend fetch failed How to actually fix it? In this article, we will discuss the possible solutions for this error.

Error 503 Backend fetch failed

When the HTTP cache fails to fetch the requested data from the web server, “Error 503 backends fetch failed” is displayed on the screen. 

Many factors can result in HTTP failing to fetch the request, which can happen quite often. So, you must know how to fix backend fetch failed error 303. We have mentioned some helpful tips that you can use. 

What Causes Error 503 Backend Fetch Failed?

Here are some common reasons why you constantly see the message, error 503 backend fetch failed. 

#1 Poor Internet Speed

One of the major reasons the HTTP cache fails to fetch the requested data from the web server is poor internet speed. If there is an issue with network connectivity, the website will take too long to respond. 

Sometimes, the loading can also fail, causing requests to accumulate. If this happens, the website data gets piled up in the cache server memory, which causes a backend to fetch failed error. 

#2 Website Server Undergoing Maintenance 

If a website’s server you are trying to reach is undergoing routine or temporary maintenance, it can cause a backend to fetch failed error. It happens because your request gets queued up. 

#3 Website was Suspicious and Got Blocked 

If you have activated an ad-blocker on your browser, it prevents ad content from being displayed on the screen. If you try to do so, an error 503 backend fetch failed message will be displayed on your screen. 

The ad-blocker is trying to protect your website from loading ad content. Besides this, other security tools also protect your browser from such websites. 

How to Fix Backend Fetch Failed Error 503 as Website Owner?

  • If the message “Error 503 backend fetch failed” is displayed after you have installed a new WordPress plugin, try disabling or uninstalling them. Sometimes, old plugins can get malfunctioned and cause this error. 
  • But in such cases, they quickly get patched. That means you don’t have to worry about certain plugins. Suppose the problem is resolved after deactivating the plugin; great. Otherwise, you check the solution mentioned below. 
  • It’s commonly advised to purge all the content from the cache to solve error 503 issues. But you must avoid doing it unless you become sure of the cause. 
  • When you purge the cache, it will temporarily increase requests to the original server. However, it can increase the problem if you cause the issue due to server overload. 
  • That means you can purge the cache only when you know the problem was not caused due to traffic spike. If you purge the cache even after knowing the issue was caused by spiked traffic, your server will take more than the required time to resolve the requests. 

Here’s how you can fix error 503 backends fetch failed as a website owner: 

#1 Check Varnish Plugin

If your website uses Varnish cache, you need to figure out if the issue is with the web server or Varnish. For this, you can try to fetch a website by turning off Varnish. Below are the ways to do it: 

  1. Start by logging in to your site’s cPanel
  2. Scroll to the Web Accelerator section. Select Manage Varnish and then Disable Varnish
  3. Press Confirm to Disable the Varnish. 
  4. After that, check how your website loads.

If these steps fix the issue, that means Varnish was causing the error. To double-check, you can re-enable Varnish and notice whether the issue stays fixed or not. 

You can check the log files to understand the main cause if the issue emerges again. Here’s how you can create the log files: 

  • You can use the command: $ varnishlog -q ‘RespStatus == 503’ -g request, to log entries where backend or Varnish response status is 503. 
  • You can use the command: varnishlog -a -w /var/log/varnish/varnish50x.log -q “RespStatus >= 500 or BerespStatus >= 500”, to log all entries >=500. 

#2 Modify Cache Tag Length 

The usual length of cache tags in the Varnish is around 8192 bytes. If this length is exceeded, HTTP can fail to fetch the requested data from the web server. 

You can easily fix this issue by increasing the value of http_resp_hdr_len in the Varnish configuration. 

#3 Modify Varnish and NGINX Configuration Files 

By modifying Varnish and NGINX configuration files, you can solve the “Error 503 backends fetch failed” issue. Here’s how you can do it. 

  1. From /etc/varnish/default.vcl, locate and open the file 
  2. Try to find the line .url = “/pub/health_check.php”; to remove /pub. After this, the line will become .url = “/health_check.php”;
  3. If there is no /pub in the line, try adding it
  4. Open ginx.conf.sample file from the Magento 2 root folder
  5. Add health_check in the line:

location ~ (index|get|static|report|404|503)\.php$ { 

to make it:

location ~ (index|get|static|report|404|503|health_check)\.php$ {

  1. Restart Varnish after saving the changes

#4 User-Reported Fixes 

Although a user-reported fixes solution is only helpful under certain scenarios, you can still use it. User-reported fixes come in handy when you are hosted on a shared server. 

If a plugin of the hoster causes the issue, disable the faulty plugin to resolve the backend fetch failed error. Lastly, if Magento’s maintenance. flag file is causing the problem, you can fix it by logging into your cPanel. Then delete or rename the maintenance. file from the Magento root directory. 

#5 Contact Hosting Provider for Support 

If the backend fetches failed error seems to go nowhere, you can ask for help from the hosting provider. The support team can quickly find the root of the issue through the error log files you created using the above steps. 

What Can You Do as a User or Visitor?

Unfortunately, you cannot do many things as a user. It is because the problem appears from the server-side issues. Below are a few things that can help you:

  1. Refresh the page multiple times by pressing the refresh button or F5
  2. If too much packet loss with a ping test happens, move for a stronger connection
  3. Reboot router and device 
  4. If a browser has multiple sites, you can try closing some of them
  5. Try using a different browser. You can also reset the configuration of your current browser 
  6. Reset the network settings

Error 503 Backend fetch failed (Conclusion) 

Even after taking all the necessary steps, you need to wait if the issue is not resolved. As server overload causes this error, you must wait till the traffic settles down. The best thing to do is visit the website outside the rush hour.

We hope the above-provided steps to fix error 503 backend fetch failed was helpful.

Related articles :

Virus scan failed error in Chrome: How to fix it ( 7 ways to Solve the Problem )

Error 0x800701b1: How to Fix it ( Easy Guide )

How to fix Because of Protocol Error Code 0x112d ( Easy Guide)