I've been using UpdraftPlus for backups to my Dropbox account for several months now without any issues.

I just updated (by clicking on the link on my Plugins page), and Wordpress went into maintenance mode.  Now I cannot get back into it past the login screen.

Does anyone have any tips on restoring to a sane state?

Thanks.

 

Saify

 

Forum: 
Jeremy Davis's picture

We provide our own built-in backup service, known as TKLBAM (TurnKey Linux Backup And Migration) and we recommend that you use that. Once set up and enabled, your data is automatically (daily by default) collected, encrypted and uploaded to remote (AWS S3) storage.

As such, I have no experience with other 3rd party backup tools, so I can't really help much there.

Having said that, assuming that your backup regime is working, why not just roll back to your most recent backup? You created a backup before doing this update right? Assuming that you did and it's a reasonable backup tool, it should be able to restore your WordPress back to it's previous state shouldn't it?! TBH, WordPress backup is pretty simple, you just need to collect the files (in /var/www/wordpress) and the database (it's called 'wordpress') - so it should be possible I would have thought?!

Another thing that you could try is manually disabling "maintenance mode". TurnKey's WordPress appliance comes with the 'wp' CLI tool pre-installed and a wrppaer script (turnkey-wp) to run 'wp' as the webserver user (to avoid permissions issues later). So you could try this:

turnkey-wp maintenance-mode deactivate

And to be sure, try restarting Apache too:

systemctl restart apache2

If that still doesn't help, a quick bit of searching online showed me a bit of a hack. Apparently this can often be caused by a failed update. What usually happens is that some part of the updated failed uncleanly, so your site has been stopped in maintenance mode. To fix that, a file called ".maintenance" needs to be deleted. So please try this:

find /var/www/wordpress -type f -name '.maintenance' -exec rm {} \;

Assuming that what I read wasn't out of date, that should manually clear that file and you should now be able to log in.

Also, during my reading, I discovered that whilst WP updates usually work fine, then are odd occasions where things go wrong. Apparently the issue you hit was most likely caused either by an update being incompatible with your version of WordPress (or PHP), or occasionally if there are numerous updates to do, then if they were installed in the wrong order, things can go wrong. So even once you get maintenance mode disabled, then double check for updates. If there are some listed, try updating plugins first, one-by-one. If you find yourself back in this situation, then you've discovered the problematic plugin! You'll need to resolve the "stuck in maintenance mode" issue again, and then disable that plugin before completing the upgrades. Once all of your plugins are updated, double check that all of your plugins are compatible with the newest version of WordPress.

Then update WordPress itself. Hopefully that all works. If not, roll back again and try updating WordPress first, then update plugins one-by-one until you work out which one is causing the issues.

Hopefully that helps. If not, please share what happens when you try that stuff and we can go from there.

Jeremy Davis's picture

Saify replied via email - normally that should auto post the contents of the email here as a comment. However, for some reason that didn't work. Regardless, here is the contents of Saify's response:


Thanks Jeremy!

I was sadly unaware of the TK backup :) - will take a look at that.

UpdraftPlus backs up zip files of various WP artifacts, but it's not obvious how I can use that when WP is not up and running properly.

Your suggestion to use the CLI to turn off maintenance mode sounds great.

FYI, in the time my WP was in maintenance mode to now, something changed, and I'm not sure what changed. But I am now able to get back into WP Dashboard. What I do see is that my earlier attempt to update the UpdraftPlus plugin seemed to have not worked. But at least things are back to the state they were before.

I have a couple of things to explore:

  1. Talk to the UpdraftPlus folks and see if they have any suggestions
  2. Switch to the TK backup solution

I'll also look at finding the ".maintenance" file.

I try to research an announced update to make sure it is compatible with the current WP version, so am assuming that the plugin is fine to update (in any case, I usually go by notifications on my Dashboard's plugins page).

I'll let you know how things pan out.

Regards,

Saify

Jeremy Davis's picture

Let me know how you go with the commandline tool. Our wrapper scripts (e.g. 'turnkey-wp' and others we've created for other appliances) are fairly new. We've tested them quite a bit, but it's also quite possible that there will be edge case issues. So if you do think that you may have hit weird edge case issue, please post ASAP and I'll do my best to help out.

I'm not sure what changed? Perhaps the update script hadn't completely running by the time you checked (hence why it was still in maintenance mode?) and disabled maintenance mode itself once it had finished?

You suggestion of contacting the UpdraftPlus backup devs sounds like a great idea. There may be some compatibility issue with the latest version with WordPress?

Re using TKLBAM, you could almost certainly use both (i.e. TKLBAM and UpdraftPlus) at the same time if you wanted to compare them? Perhaps it might even make sense to use them both if you particular like UpdraftPlus?

Re finding the '.maintenance" file, no need to worry about that now as your site isn't stuck in maintenance mode now!

I look forward to hearing how it all goes.

Cheers,
Jeremy

Add new comment