Error 503

When a request to a web browser fails, the web server often displays an “HTTP 503 error” to locate the user. This message assumes that there is an HTTP 503 status code that indicates that the web server is temporarily unavailable. This server downtime can be caused by several things such as ongoing maintenance or others that require further analysis of the site involved.

“503 Services unavalable” or “HTTP 503 error”. If you run a website or spend enough time surfing the Internet, you will surely have already encountered this type of message. It is indeed a navigation error like many others.

However, the particularity of an HTTP 503 error is that it does not give any information about the cause of the malfunction. It is therefore very intimidating to encounter this type of error on a website.

What is a 503 error?

What causes a 503 error and how does it manifest itself?

How do I fix a 503 error?

The answers to these different questions are surely your biggest concern right now. In this article, I will provide you with detailed answers that will help you manage a 503 error on your site without panicking.

Chapter 1: What does the HTTP 503 error mean?

The presence of HTTP 5xx status codes usually means that there is a problem with the server itself. Find out in this chapter what a 503 error really means and the different causes that can be the reason for it.

But first, let’s take a look at the different HyperText Transfer Protocol (HTTP) status codes.

1.1. Overview of HTTP status codes

In order to respond to the various requests from web browsers, the servers that host web pages use many codes to express themselves and serve responses. In web servers, each code contains a specific response and this response belongs to a given code class. We generally distinguish the following classes of code:

  • Code 1xx: This code informs the user that the server is working and that the request is being processed.
  • Code 2xx: The status code 2xx indicates the success of the request by the web browser.
  • Code 3xx: This code indicates that the requested page is moved and redirected to a new location.
  • Code 4xx: The web server displays code 4xx when there is a loading error.

The error can be located at the level of the request of the browser or the device used by the Internet user.

  • Code 5xx: The web server displays the status code 5xx when there is an error on the server that hosts the site resources.

Specifically, the last two digits of the HTTP status codes indicate the specific class of each code and the response expressed by the web server. For example, the HTTP status code 301 indicates that a resource page has been moved permanently.

On the other hand, the HTTP 302 status code means that the requested page has been moved temporarily.

But here we will just focus on the HTTP 503 status code.

1.what does the HTTP 503 or HTTP 503 Error status code mean?

Sometimes the inaccessibility of a website can result in a 503 error code giving an indication of the problem detected. The 503 error code usually results from a malfunction on the web server side.

Erreur-503-2

It indicates that the web server is momentarily unable to process the user’s request. Very often, server congestion or ongoing maintenance are the most common reasons for the HTTP 503 error code to appear.

But if the 503 error occurs at the web server level, is there any way to fix the error on the user side? The answer is no.

However, there may be something you can change on your side as a user. I will come back to this aspect a little later.

Service Unavailable

Source : Greytrix

Basically, a web server that displays a 503 error code would mean that there is an obstacle that prevents it from accessing and processing the request. The peculiarity of the 503 error code compared to other HTTP codes is that it doesn’t give any information about the cause of the problem and remains subtle.

The only recommendation that is often given in a 503 error and that is useless is the famous “Try again later”.

1.3) How does a 503 error manifest itself?

A 503 error can manifest itself in different ways. But, whatever the variations, it always displays the 503 code. This code makes it easy to identify.

Depending on your server and web browser, here are some of the different variations of a 503 error:

  • HTTP 503 error;
  • 503 Services unavailable;
  • HTTP 503 server error ;
  • 503 Services temporarily unavailable;
  • 503 error not available;
  • The server is temporarily unable to respond to your request. Please try again later.
 Service Unavailable

Source: Googleusercontent

If you encounter any of these messages, it implies that you should check the status of your server and quickly get to work before the problem negatively affects your users.

1.4. What causes the 503 error?

The 503 error is often associated with the famous “Service temporarily unavailable” message. This message can appear in several situations or be caused by several circumstances. The most obvious ones are:

1.4.1. Non-functioning of the server due to ongoing maintenance

You may encounter an HTTP 503 error message when the server is shut down or is inactive. Indeed, a server is a computer component that can be physical or virtual. The main role of the server is to store computer data.

As a hardware component and because of its importance for the security of the multiple data stored, the server needs to be maintained periodically. During this maintenance period, the server is usually inactive and therefore unavailable to process any request.

1.4.2. The server is overwhelmed

On WordPress for example, it is important to understand that there is a limited amount of resources allocated to each hosting account. Server overload refers to a flow of large requests that deplete the server’s resources.

Thus, when the server is extremely stressed, it will not be able to respond to all the requests simultaneously. It may malfunction and stop working. In a situation where the HTTP 503 error is caused by a server jam, it may resume processing the request after a few minutes

1.4.3. A script running in the background

The server is unable to answer a request when a script is running in the background. In this case, the server will resume work only when you change or delete the code or topic that caused the problem.

1.4.4. A change in the Domain Name System (DNS)

The reconfiguration of the DNS can cause a setting not conforming to the initial system

Service Unavailable DNS failure

Source : Lws

So, when you make a small mistake when changing the DNS, the server will realize it and will be inaccessible for the users.

Chapter 2: How to fix a 503 error?

The appearance of a 503 error following a resource request launched by a web browser can be very frustrating for the user. Also, if the error persists, it can negatively affect the user experience.

At this point, the site owner is on the verge of losing traffic, which would cause great damage to his online business. You are probably wondering how to fix an HTTP 503 status code error.

Hold your horses, in this chapter I’ll show you ways to effectively fix 503 error not only at the user level, but especially at the server level. Ready to go? Let’s get started!

2.1. How to fix HTTP 503 error at user level?

When you receive a 503 error message, the first thing you should do is refresh the requested resource to make sure that the problem is not related to your browser or Internet connection.

You can take other parallel steps to make sure that it is not an Internet connection problem. You can restart your computer or your Wifi router for example. Indeed, an error message such as “Service unavailable or DNS failure” can be linked to a configuration error of your computer.

This problem is usually solved with a hardware reboot. On the other hand, the problem related to the 503 error may be at the server level.

This is the most common case. If you find yourself in such a situation as a user, there is unfortunately nothing you can do to correct the error. It is precisely at this level that the site administrator must intervene to solve the problem at the level of the server that hosts his site.

2.2) How to correct a 503 error on the server level?

Unlike other types of errors, the 503 error is very specific and does not clearly reveal what caused it. When the 503 error occurs on a website, the site administrator must therefore do a methodical and very deep troubleshooting in order to correct the problem.

In this subchapter you will find 06 steps, each of which covers a potential correction that can solve the different causes of a 503 error.

2.2.1. Disable WordPress extensions first

Extension incompatibility is one of the most common causes of 503 errors on WordPress sites. In order to identify the cause of the inconvenience on the server hosting your site, you must first disable all the extensions on your site.

Usually, the HTTP 503 status code blocks access to the site’s administration area. This could prevent even the site owner from accessing it. To counteract this problem, you need to use an FTP (File Transfer Protocol) client.

The FTP client will allow you to run your site by connecting your local files on a computer to the online server. I recommend using FileZilla. The procedure is simple, once the FTP client is installed, you will connect to the WordPress folder, usually called public_html, or the “name of your site”.

Public Directory

Source : kinsta

Next, look for the plugins folder which has subdirectories for each of the extensions you have installed in the wp-content directory. All that’s left to do is to rename the plugins folder so that WordPress won’t recognize it anymore.

You can put for example “Plugins.deactivated” in order to recognize it later. When you rename the folder containing the extensions, WordPress won’t be able to recognize them anymore and so, they will be automatically deactivated.

plugins old Directory

Source : Kinsta

After deactivating the extensions, if the problem is solved and the 503 error disappears, it means that one of the extensions is the cause. Now you just have to identify which one.

The procedure is basically the same, but at this point you need to disable each of the extensions until you find the culprit.

  • Start by renaming the first extension directory ;
  • Go back to the site to check if the 503 error is still there (if so, you must put its name back and continue with the rest);
  • Repeat the same steps until you find the extension that caused the 503 error.

If you have a lot of extensions on your site, it is obvious that this process will take you quite a long time. Nevertheless, it is very vital to check each extension to identify the problem and fix it.

When you find the extension causing the 503 error, you can choose to uninstall it or replace it with another one.

On the other hand, you may be able to check all the extensions without the error disappearing. In this case you should test the following steps.

2.2.2. Disable or replace your WordPress theme

Since you have already eliminated the hypothesis that extensions are the cause of the 503 error on your website, it is time to do the same with your WordPress theme. This is because a theme compatibility issue can also be a cause of the HTTP 503 status code.

The process will not work the same way as the previous step. In fact, you will get an “Error” if you simply rename the theme folder and hope that WordPress will revert to the same default folder.

However, you can access your WordPress database via phpMyAdmin to disable the theme. For those who are subscribed to Kinsta, you can do it in the “Info” section in the MyKinsta dashboard.

Tableau de bord MyKinsta

Source : Kinsta

To disable the theme, look in the “wp-Options” table for the “Search” tab. Then, click on the tab and search for the theme template under the “Option-Name” option. After disabling the theme, you can go back to the site to check if the 503 error is fixed.

If the error is fixed, then it is a problem with your theme and you may need to reinstall the theme.

2.2.3. Temporarily disable the CDN (Content Delivery Network) of your site

The 503 error can also be related to the Content Delivery Network (CDN) you are using on your site. So to quickly find out what’s wrong, you can temporarily disable your CDN and check if the problem is solved.

Normally, every CDN should have a function to disable or pause it. Kinsta users, for example, can pause the Kinsta CDN services by searching for CDN in the MyKinsta dashboard.

Note that the process may not be the same depending on each CDN. In case you don’t have any CDN on your site or disabling your CDN doesn’t resolve the 503 error, then don’t worry at all. There are other parameters to fix. But before you go to the next step, don’t forget to re-enable the CDN.

2.2.4. Disable WordPress Heartbeat

WordPress has integrated an API called Heartbeat that allows the platform to manage certain tasks such as:

  • Make automatic content check-ins;
  • Indicate notifications from extensions;
  • And so on.

This API works at a very high frequency in the background. It therefore consumes a lot of server resources. This does not usually cause any problems, but it can happen that the server is unable to handle the API load, in which case a 503 error will appear.

Of course, it is not always obvious that the API is causing problems for the servers, but the safest way to check if it is at fault is to temporarily disable it. To do this, you need to connect to your site again via an FTP client and access your theme directory.

functions php

Source : Kinsta

Make sure that the directory contains the “functions.php” file and select the View/Edit option. Then open the option with your local text editor and enter the following code:

Code a inserer

The above three lines of code will guide WordPress to disable the Heartbeat API. Now just save the changes to the function.php files and return to the site to check the status of the problem.

If after disabling, the error disappears, you can conclude that the API is the source of the problem. But since it is an API built into WordPress, disabling it may cause other problems. However, instead of removing Heartbeat completely, I suggest you slow down its operation instead.

Heartbeat Behavior

Source : Kinsta

For example, you can install the Heartbeat Control extension and lower the frequency of its operation to the lowest level in the “Edit Heartbeat” option. Before the new changes to the functions.php file will work, you must first remove the three lines of code added to tell WordPress to remove Heartbeat.

Now, let’s go to step 5 in case the API is not the source of the HTTP 503 status code.

2.2.5. Increase the resources of your server

It may happen that the 503 error still occurs despite all attempts to correct it so far. However, you should contact the hosting service that hosts your site and explain your conundrum and all your attempts to solve it.

The service should normally help you detect the failure and find a solution to resolve it. The other alternative is to increase the resources of your web server.

This is especially relevant for sites that use a WordPress hosting service. This is because WordPress hosting services tend to reduce the resources of web servers.

So you should also check if the problem is not related to the lack of server resources. In other words, it’s a matter of making an update to your hosting plan to try to fix the error.

2.2.6. Analyze your logs and activate WP_DEBUG

A final alternative is to read through your error logs. Actually, the error log summarizes the history of every error that occurred on your site in chronological order.

What seems more logical is that the log provides information about the file or more generally the cause of each error. Consulting the log can therefore help you solve the problem more quickly, especially when it is an extension installed on your site.

You can generally find the logs on the sites in the wp-content directory by opening the debug.log file. It should be noted that the log does not give direct information on the 503 error.

However, it remains an alternative and can show you the files that often cause problems.

Chapter 3: What can be done to avoid the 503 error?

To avoid the negative impacts that a 503 error leaves on your website, especially the loss of traffic, it is necessary to take precautions to avoid such a malfunction in the future.

The error can also happen in an obvious way, especially when it is a voluntary closure due to ongoing maintenance on the site. This is a very logical fact because it is necessary to maintain the site.

However, you must find a way to inform your users and, if possible, mention the timeframe for everything to return to normal. In this chapter, I present you with some tips and tricks to prevent and manage a 503 error without incurring too many negative impacts.

3.1. keep a close eye on the necessary hosting resources

Traffic loss is certainly the biggest loss for site owners when users start encountering HTTP 503 errors on their way through. We admit that one of the issues of a web strategy or project is the increase of traffic to the website.

However, the increased growth of visitors to the website can be the cause of a 503 error. So it is important to monitor the traffic of your site and increase the resources at the server level if necessary.

Indeed, a web server has a load capacity to support and the exaction of traffic can cause a malfunction at the server level. This results in a 503 error. If you keep an eye on your server and the related resources, you can prevent the error and increase the resources to ensure a good long-term operation.

3.2. update your software regularly

If a hostile software is the cause of 503 error on your site, it is important to contact the provider to find a solution to eradicate the problem. In addition, you should advocate the installation of recent software and install updates regularly.

3.3. Detect and solve programming errors

A programming error in the website or in some software such as content management software can cause a 503 error on the website. For example, WordPress hosting servers are very sensitive to websites that take long enough to load their content.

This problem can be caused by a programming error in the plugins or an overload of the database. Similarly, too many extensions can also cause a 503 error.

It is therefore advisable to sift through the plugins and deactivate the problems if necessary.

Summary

It is no longer necessary to panic when your browser displays “503 Services available” instead of a search page. This is an error that is usually related to a malfunction of the server that hosts the site resources.

The HTTP 503 status code can have several negative impacts on your site including loss of traffic. However, the different correction methods and prevention tips that I have detailed in this article will surely help you to quickly take control of this inconvenience.

I hope you have enjoyed this article. If you do, please leave me a comment.

Leave a comment