How to load a Magento 2 website if maintenance mode is left enabled (Service Temporarily Unavailable error)

- E-Commerce, Magento 2

Magento 2 export CLI

If your Magento 2 website fails to load due to maintenance mode, you’ve come to the right place. Below, we describe a fix for a situation when your storefront doesn’t load since maintenance mode is left enabled. Besides, it may not be disabled automatically (but it should!). We describe this problem and provide a corresponding solution below. You can find more fixes for Magento 2 in our Cookbook.

'

Issue

When your e-commerce website fails to load due to enabled maintenance mode, you may also get the Service Temporarily Unavailable error, which contains the following text:

Usually, this issue affects 2.2.x and above Magento versions.

Being a part of the deployment process, maintenance mode can be enabled manually or automatically. However, if you forget to disable the mode or the system fails to do that automatically, you may face a failed deployment since having maintenance mode enabled provides a direct impact on your Magento 2 website. It prevents storefront loading. 

Solution

Luckily, you can quickly load a Magento 2 website if maintenance mode is left enabled, fixing the Service Temporarily Unavailable error. Fist of all, you need to get the current maintenance mode status. You can check it via the following command:

If maintenance mode is enabled, you should disable it. Run the following CLI command to do that:

You can find more information about the issue in this article: Magento 2 store fails to load due to maintenance mode left enabled.

'