Find out what error 504 gateway timeout means and learn how to fix it – WAU
The 504 gateway timeout error occurs when a server is unable to load a page requesting resources from another server. Find out what it is, how it happens and see what it takes to solve it.
You know the 504 gateway timeout error? Basically, it happens when a server tries to load a web page, but there is no response from another server that needs access to complete the page loading. There are several possibilities for the error, such as slow communication, unavailability of the proxy or CDN and much more.
Although the message displayed classifies the error as a server error, it is necessary to check a number of factors, both on the side of the devices that access the website and in the environment settings that can cause this failure to happen, as it can be only momentary and possible to resolve easily.
In this post, we will show:
Want to know what to do to solve this problem? Check out the next topics.
What is error 504 gateway timeout and why does it happen?
When any browser tries to access a page on the internet, a series of errors can happen. In order to be able to more easily identify what the problem is, there are HTTP status codes, that is, instead of loading the requested website, the browser displays a page with the corresponding error type.
HTTP status codes that start with the number 5 indicate server errors. Thus, code 500 corresponds to the internal server error, 503 indicates that the service is unavailable, and so on. The 504, therefore, is classified as a server error, and its definition is that it corresponds to a gateway timeout problem.
But what does this error mean? Basically, for the page accessed to be loaded in a complete way, you need to connect to a second server to which you made a specific request. Therefore, the unavailability occurs during this communication, as there is no desired response and, therefore, there is a return with error page 504.
The problem then happens because delay in response time of the accessed server and this is one of the messages displayed in the browser:
The error can happen on any device that accesses the internet, that is, computer, notebook, tablet or smartphone. The text corresponding to the error may vary according to the customization made in each browser or website. Therefore, some of the common messages about this type of failure are:
- 504 Gateway Timeout;
- HTTP 504;
- 504 Error;
- Gateway Timeout (504);
- HTTP Error 504 – Gateway Timeout.
Possible causes for the problem
Several factors can cause the website to return error 504, such as slowness on the server, which makes responses to requests take a long time to process. Another reason for the problem is the insufficient number of PHP workers, which determines the site’s ability to receive simultaneous requests.
There is also the possibility that there is some improper configuration on the firewall that improperly blocks some connections and causes unavailability. In addition, there may still be failures regarding network connectivity, which can cause delays in responding to the page request.
How to know if it is the error 504?
Error 504 indicates that the problem is with the server. However, some settings on your computer or local device can interfere with navigation and hinder access to the internet environment and, with that, return the gateway timeout message.
As a result, it is necessary to make sure that the problem is external and it is recommended, therefore, to perform some local tasks to verify that no internal factor is the reason for the error. Check out what you need to do.
Reload the page
The first step to check if the error really exists is to reload the page. Therefore, press the on the keyboard or click on the “Reload page” icon in your browser’s address bar. This attempt is important because it can be a momentary communication failure. Thus, when reloading the page, it is possible that the problem will not happen again.
One way to ensure that error 504 is not local is to restart the devices. This is because communication failures with equipment such as a router, switches or modem can occur, or any other difficulty in communicating with the network. Therefore, by restarting these devices, the problem can be resolved.
However, it is important follow the right order when reconnecting equipment so that the settings are properly assigned. Thus, the first to connect is the modem. After an interval of 60 seconds, turn on the router and, after 2 minutes, the computer, tablet or smartphone.
Test another browser
Another recommendation is to try to access the page through another browser. This attempt is valid because there may be a problem with the site code that does not work well in a particular browser.
Review proxy settings
It is also necessary to review the proxy configuration for those who do not use this feature automatically. Basically, the proxy is a server that acts as an intermediate area between the local computer and the internet. In this way, any Proxy unavailability can cause the problem to load a website.
To check or change the settings, you need to access the “Internet Properties” in Windows. To do this, access the menu “Start”> “Settings”> “Network and Internet”.
Select the “Status” panel and the alternative “Network and Sharing Center”.
Then click on the “Internet Options” link.
Choose the “Connections” tab and click “LAN Settings”.
Check if the proxy settings are correct or deselect the option “Use a proxy server for the local network”, if you want to disable the feature.
What are the ways to resolve the error 504 gateway timeout?
When performing tasks such as creating a website or blog, for example, it is common for error 504 to happen. It can happen in new CMS installations, such as WordPress, or when the traffic on the website is very heavy, for example. Therefore, some actions need to be taken to identify where the problem is.
Repair the database
One reason for the error may be the corrupted database. There are some plugins that can be used to solve this problem, such as WP-DBManager, which can be downloaded for free at WordPress.org.
To repair the database, install the plugin on WordPress. Then, access the Dashboard and click on the alternative “Database”> “RepairDB”.
Then click on the “Repair” button to repair the entire database, or select only the desired tables.
The next step is to optimize the database. To do this, select the alternative “Database”> “Optimize DB” and then click on the “Optimize” button.
Check the DNS configuration
Another reason for error 504 is DNS resolution. It is very common that, when changing the provider’s website, it takes some time for the new address to propagate over the internet. This delay can take up to 24 hours in some cases.
This means that, during this period, it may happen that a user tries to access the site and fails. Therefore, it is necessary to wait until the new address propagates for the problem to be solved.
Meantime, it is possible to check if the DNS is already propagated. There are free tools on the internet that facilitate this verification, such as DNSmap. To verify, just type the website address in the tool and click on “Check DNS propagation”.
Check the CDN settings
Error 504 can also occur due to failures in the CDN – Content Delivery Network. Basically, CDN functions as distribution points for websites. In other words, they are servers spread over several locations around the world and that store copies of the sites.
Its purpose is to make a user access a page faster according to your location. Thus, when entering the website address, the connection is made at the CDN closest to the user. However, if it is unavailable, the page will not load.
The service can be easily activated and deactivated in WordPress through plugins like CDN Enabler. When using an external CDN, it is best to temporarily disable it to see if the problem will be resolved.
However, if the site is unavailable and you cannot access it through the Dashboard, you will need to access the environment through an FTP connection – File Transfer Protocol – or through the provider’s control panel to rename the folder corresponding to the plugin and then , reload the site.
There are several factors that can cause this problem to appear on a website. And there are a number of checks that need to be done on both the client side and the server side to try to resolve the failure.
If even with all these attempts to identify and resolve the 504 gateway timeout error it is not possible to eliminate the problem, contact your hosting provider so that they can check internally if there is any unavailability on the server that only they can fix.
Now that you know how to evaluate error 504 on the website, check out our complete checklist on website launching so that you can achieve the best results with it.