14

I am enabling maintenance mode by adding a file var/.maintenance.flag, but i am getting the error:

Unable to proceed: the maintenance mode is enabled. 
#0 /backup/html/magento2/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Bootstrap->assertMaintenance()
#1 /backup/html/magento2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#2 {main}

I even tried enabling it using the command:

bin/magento maintenance:enable

Also, enabled the production mode, cleared caches still I am not getting 503 page. Please help!

6 Answers 6

16

Maintenance mode means that the website is offline.
So it works as expected.
If you want to remove the maintenance mode run bin/magento maintenance:disable

3
  • 6
    Shouldn't it be showing: "The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later." i.e. 503.phtml?
    – Twinkal
    Commented Jul 18, 2016 at 12:35
  • You are probably right. But not sure
    – Marius
    Commented Jul 18, 2016 at 12:36
  • 7
    This does not answer the question of the exception. Commented Apr 13, 2017 at 11:03
16

My MAGE_MODE was set to developer and I had deployed in production using:

php bin/magento deploy:mode:set production

assuming that it is a dynamic way of changing the developer mode to production.

I had to change the MAGE_MODE to production or default to get the 503 page.

I would love to know the difference between MAGE_MODE and deploy mode.

3
  • 1
    I think the values you set on the server config (like MAGE_MODE) override the values from config.php and env.php. That's why your developer mode was on even if you set it differently via cli.
    – Marius
    Commented Jul 18, 2016 at 13:05
  • You are right!!..I din't find anything in config.php but in env.php it does changes the MAGE_MODE value based on the cli command. Thanks :)
    – Twinkal
    Commented Jul 18, 2016 at 13:18
  • Where to change it?
    – Black
    Commented Nov 15, 2022 at 11:13
1

When you are in Magento developer mode -> then activate maintenance mode -> you will get the error message you have described

When you are in any other mode -> then activate maintenance mode-> you will get the 503 page

1
  • 1
    Seem, it doesn't matter which mode you use, it shows an exception always.
    – Kirby
    Commented Dec 12, 2016 at 18:41
1

You can try this. Run the following command.(As I have not tested this, Please create a backup of your Magento)

  1. /bin/magento maintenance:disable

If Not resolved using the first command and you see an error like "The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later".In that case, check here.

  1. Now run the command: /bin/magento maintenance:status
  2. /bin/magento maintenance:enable
0

If you want to design your maintenance page you need to edit file pub/errors/default/503.phtml and for css pub/errors/default/css/styles.css design accordingly.

And in .htaccess page need to comment ## SetEnv MAGE_MODE developer or production for execute this maintenance page.

and if you are in production mode then this page will excute other then below code error will show.

Unable to proceed: the maintenance mode is enabled. 
#0 /backup/html/magento2/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Bootstrap->assertMaintenance()
#1 /backup/html/magento2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#2 {main}

if you want to come back in your website you need to delete var/.maintenance file or run below command in terminal

//For run your website back online.
php bin/magento maintenance:disable  
//For on maintenance mode.
php bin/magento maintenance:enable 

Also set in .htaccess

SetEnv MAGE_MODE developer
0

Open pub/.htaccess (or .htaccess if you configured your webserver the wrong way) and add this:

SetEnv MAGE_MODE production

Afterwards remove it again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.