Cookies setting

Cookies help us enhance your experience on our site by storing information about your preferences and interactions. You can customize your cookie settings by choosing which cookies to allow. Please note that disabling certain cookies might impact the functionality and features of our services, such as personalized content and suggestions. Cookie Policy

Cookie Policy
Essential cookies

These cookies are strictly necessary for the site to work and may not be disabled.

Information
Always enabled
Advertising cookies

Advertising cookies deliver ads relevant to your interests, limit ad frequency, and measure ad effectiveness.

Information
Analytics cookies

Analytics cookies collect information and report website usage statistics without personally identifying individual visitors to Google.

Information
mageplaza.com

Service Temporarily Unavailable Magento 2

Vinh Jacker | 06-01-2016

Service Temporarily Unavailable

Service Temporarily Unavailable Magento 2 or Unable to proceed: the maintenance mode is enabled with the message The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. is a common error in Magento 1 and Magento 2 during the Magento store or Magento extension installation process. In this post, I will show you why this error happens and how to resolve this issue.

Hire Magento Developers

What you need to do is only describing desired features of the Magento website, we will help you to build the store that ticks all the boxes!

Get Started
hire magento developers

Why does this error occur?

Service Temporarily Unavailable the server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

The Service Temporarily Unavailable error in Magento 2 indicates that the server is currently unable to handle the request, often due to maintenance or server overload. Common causes include:

  • Server overload or high traffic.
  • Server misconfiguration.
  • Magento’s maintenance mode is enabled.

During the installation process, Magento creates the file maintenance.flag, if Magento checks that the file exists, it will show users the error message as I showed above. Generally, it will automatically remove maintenance.flag file after the processing has been done, but there is something wrong and you cannot delete it.

How to Fix Magento Service Temporarily Unavailable

Service Temporarily Unavailable Magento 2

To resolve this issue, consider the following steps:

1. Delete the maintenance flag file

Magento creates a maintenance.flag file in the var directory during maintenance mode. If this file isn’t removed after maintenance, the site remains inaccessible. To fix this:

  • Navigate to the Magento root directory.
  • Delete the maintenance.flag file located in the var folder.
  • Remove Magento cache if there is any, using this command: php bin/magento cache:flush
  • If there is an error, you will see the message “Exception printing is disabled by default for security reasons,” What you need to do is check the error log.
  • If the error log indicates “Please upgrade your database,” execute php bin/magento setup:upgrade from the root directory.

Magento 2 Service Temporarily Unavailable

2. Enable developer mode

Once you’ve removed the maintenance.flag file, refresh your website. If you encounter the message:

Exception printing is disabled by default for security reasons.

This indicates that Magento is restricting error details for security purposes. To resolve this, enable Developer Mode, which will display error messages for easier debugging:

php bin/magento deploy:mode:set developer

If issues persist, check Magento error logs to identify any underlying exceptions.

3. Upgrade database

After removing the maintenance.flag file, you may receive the following prompt: Please upgrade your database.

This occurs when the database schema needs to be updated. To fix this, run the following command from the Magento root directory:

php bin/magento setup:upgrade

This ensures that all database changes and module updates are properly applied.

FAQs: Magento 2 Troubleshooting

1. How do I put Magento 2 in maintenance mode?

To enable maintenance mode, run the following command:

bin/magento maintenance:enable

You can also allow specific IP addresses to access the store while in maintenance mode:

bin/magento maintenance:enable --ip=183.0.2.20 --ip=183.0.2.21

This creates a maintenance.flag file in the var/ directory, indicating that maintenance mode is active.

2. How do I disable maintenance mode in Magento 2?

To turn off maintenance mode, use: bin/magento maintenance:disable

3. How do I fix the 503 Service Unavailable error?

The 503 Service Unavailable error usually occurs when Magento is stuck in maintenance mode. To resolve this:

  • Refresh the page to check if it was a temporary issue.
  • Delete the maintenance.flag file from the var/ directory:

rm var/.maintenance.flag

  • Disable maintenance mode: bin/magento maintenance:disable
  • Flush the cache to clear outdated configurations:

php bin/magento cache:flush

  • Check server logs for further issues:
    tail -f var/log/system.log
    tail -f var/log/exception.log
    

Final words

The Magento 2 “Service Temporarily Unavailable” error is often caused by maintenance mode, incomplete updates, or server misconfigurations. By following these step-by-step solutions, you can quickly resolve the issue and restore your store’s functionality.

x
    Jacker

    Jacker is the Chief Technology Officer (CTO) at Mageplaza, bringing over 10 years of experience in Magento, Shopify, and other eCommerce platforms. With deep technical expertise, he has led numerous successful projects, optimizing and scaling online stores for global brands. Beyond his work in eCommerce development, he is passionate about running and swimming.



    Related Post

    Website Support
    & Maintenance Services

    Make sure your store is not only in good shape but also thriving with a professional team yet at an affordable price.

    Get Started
    mageplaza services