cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2: Automatically maintenance mode

Magento 2: Automatically maintenance mode

We have several stores running on EKS (Kubernetes) and for some reason one of the stores enter on maintenance mode for no reason:

Unable to proceed: the maintenance mode is enabled.

We are using Magento Enterprise 2.3.1.
There is no one going into the containers to enable maintenance mode, even when there is no code deploy or users using the stores (this is a stage environment) the maintenance mode appears.
When we have the OPs team take a look at the var/.maintenance.flag, the file was created by root and sometimes it takes time to be deleted.


Looking at the logs I can see that sometimes the store will throw errors for an hour or just a few minutes.

Has anyone been affected by this? It looks like schedule backups and setup:upgrade commands can create the flag, but these are not running when the flag is created.

Thanks.

6 REPLIES 6

Re: Magento 2: Automatically maintenance mode

Hi @Eric Cavalcanti,

What error magento throw in the error log? If should fixed that errors. 

Please also enable developer mode on staging server, so you will get the errors at real time in the browser. It will help to identify the errors and fix it. 

 

to check current mode: 
php bin/magento deploy:mode:show

To set developer mode :
bin/magento deploy:mode:set developer

I hope it will help you!

Re: Magento 2: Automatically maintenance mode

There is no error. The maintenance flag (var/.maintenance.flag) is created automatically and then Magento doesn't take it out.

And we run stage as production mode. Stage environment should be close to production as possible.

Re: Magento 2: Automatically maintenance mode

Strange....

Could you please once log setting that it is enabled?

To turn on the logging, you can follow these steps:
  1. Log into your Magento Admin Backend.
  2. Go to Store ->> Configuration.
  3. Click on "Developer" in the left side menu section.
  4. Open the "Log Settings" section.
  5. Change the "Enabled" to "Yes"
  6. Click "Save Config"

OR 

 

php bin/magento setup:config:set --enable-debug-logging=true && php bin/magento cache:flush

Are you also on developer mode?

Re: Magento 2: Automatically maintenance mode

@Vimal Kumar the store runs as production mode, there is no developer option when Magento is running on production mode.

And Magento is already logging, that's how I found out about the maintenance.

I am not sure what log you want me to enable or look at.

Re: Magento 2: Automatically maintenance mode

@Eric Cavalcanti 
If log in enabled as per above settings, there should be some log files in "var/log" folder. 
May be you got some clue from these log files. If you don;t get anything in these log files then you can also ask to server support to check server log as well. 

Re: Magento 2: Automatically maintenance mode

@Vimal Kumar the logs are enabled, that's how we got the error I mentioned.

What else do you need? Cron logs? That's the only thing that we get as well.

Not sure what else you are trying to get from the logs. We ship all logs to Elasticsearch and we can see the logs on Kibana.

It's production mode, there is no developer settings on the admin.

We are going back and forth on logs when I already explained we have the logs, I posted the log several times. That's all, logs are enabled, there is no other log.