Magento 1.8 Maintenance – Randomly Entering Maintenance Mode

magento-1.8maintenance

I'm on magento 1.8 and have a really strange thing happening at 5am every morning… a maintenance.flag appears in my root folder, putting the site into maintenance mode…

I have tried changing all the passwords etc but it still happens. In the access logs, all I can see is the cron.php (which runs every minute) running at a few seconds after 5am

I've also checked the error logs etc, no idea what is causing this. I've also changed FTP password and root passwords for the server.

Also what happens is I get the attached error when I try to access admin. I restart SQL and it starts working again…

enter image description here

Best Answer

Based on the comments...
The backup scheduled to run every night puts the website on maintenance mode.
You can configure it not to do so from System->Configuration->System->Scheduled Backup Settings->Maintenance Mode. Set that field to No.
But this will solve only half of the problem.

The backup process should remove the maintenance mode once it is finished.
You problem is that the process does not finish.
There is some deadlock database and you end up with the 2 issues:

  • the maintenance flag is not removed
  • your application cannot connect to the db and you have to restart the mysql service.

My advice is to think of a different backup strategy, or try to identify what is causing the deadlock....or you can always throw blindly more hardware at your server.

Sorry but that's all I can come up with right now. My sysadmin skills are barely reaching zero.

Related Topic