Service temporarily unavailable: How to solve it in Magento 2?
The HTTP 503 code response is one of the commonest errors you may come across while setting your Magento store or server.
Magento 2 service temporarily unavailable - maintenance mode is enabled
Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
The message may be displayed to users in several cases:
- maintenance mode is enabled;
- server capacity problems;
- server misconfiguration.
In this case, your store is not available at the moment.
The file .maintenance. flag is created in Magento 2 root folder during the installation process. The file is automatically removed after the processing done. However, something can go wrong and the file won’t be deleted or will be created again. Then Magento will define the file and display the message mentioned above to your customers.
Disable the maintenance mode
- Go to Magento root folder and delete the file var/.maintenance.flag;
- Fresh Magento 2 cache: php bin/magento cache:flush or via the Admin Panel;
- If you see a message saying Exception printing is disabled by default for security reasons, check the error log;
- If the error log says Please upgrade your database, run php bin/magento setup:upgrade from the root directory.
¡The maintenance mode file in Magento 2 differs from Magento 1 in a leading dot, compare: .maintenance. flag and maintenance. flag!