How to Resolve Magento Error 503: Service Unavailable

Updated on May 17, 2023

Error 503 Service Temporarily Unavailable means that there is an issue with the server currently hosting the Magento website you are trying to access. In other words, it indicates that the server is not accessible to process the request because it may not be responding, is overloaded, or is not configured correctly.

However, the error is only sometimes caused by the server itself. Sometimes the Magento website itself may be the cause of this issue, and we will explore that side of things in this article.

This post includes:

Reasons for Error 503 to Occur

When updating Magento, it creates a maintenance.flag file to show a system message until it finishes the update operation.

In the event of any faults or issues, it helps to hide the screen from the website during the process. Technically, after the procedure is over, Magento deletes the file, and, therefore, the system warning will disappear.

At times, the maintenance.flag file will not be removed automatically after the operation completes. As a result, the Magento website will show the Service Temporarily Unavailable error.

Note

The maintenance mode file in Magento 2 differs from Magento  1 in a leading dot:

  • Magento 1: maintenance.flag
  • Magento 2: .maintenance. flag

This error will stop you from being able to access the admin page or see any issues there as a result. Additionally, the problem will occur while accessing any of the Magento website's pages. In short, the store won't be available at all when there is an error 503, which can caused by an erroneous maintenance file that was not deleted correctly.

How to Resolve Error 503

Most often, locating and deleting the maintenance.flag file will resolve the issue. The file is in the var folder of your Magento installation. Typically, the server deletes this file automatically after the update procedure. However, the deletion of this file might not always happen owing to an error. To fix the 503 error, disable the maintenance mode. To do this, follow the steps below:

  • Go to the Magento root folder;
  • Find the maintenance.flag file and delete it. The location of the file depends on the version of Magento;
  • Refresh Magento cache:
    • Either via command line with this command: php bin/magento cache:flush 
    • Or via the Admin Panel;

Note

The maintenance mode file location differs for Magento 1 and Magento 2:

  • Magento 1.x: Delete maintenance.flag file from → Magento root folder
  • Magento 2.x: Delete .maintenance.flag file from → Magento root folder/var

After you have deleted the file and refreshed Magento's cache the error should be gone. However, you might see a different message saying: "Exception printing is disabled by default for security reasons."

Unfortunately, this means there is some other issue with your website, and you will have to check the error log to find out more.

Something else that can happen is the Please Upgrade your Database error. To resolve this, go back to the command line and run these commands in the root directory of your Magento website:

  • php bin/magento setup:upgrade
  • bin/magento cache:clean

These fixes should resolve the 503 error and your store should start working again.

Conclusion

Magento's 503 Service Momentarily Unavailable error typically shows an issue with the web server. However, as we showed you above, there are a few things you can try to resolve on your own before asking the server owner for assistance. If you can't solve this issue yourself, feel free to create a new support request, and a member of our Technical Support staff will assist you as soon as possible.

We hope you find this article useful. Discover more about FastCloud - the top-rated Hosting Solutions for personal and small business websites in four consecutive years by the HostAdvice Community!

Magento Hosting

  • Free Installation
  • 24/7 Magento Support
  • Hack-free Protection
  • Fast SSD Storage
  • Free Domain Transfer
  • Free Magento Transfer
  • Immediate Activation
  • Free Cloudflare CDN
View More