WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#13988 closed defect (bug) (maybelater)

No Obvious Way to End Maitenance Mode / Problems Upgrading Large Plugins on 1and1

Reported by: layotte Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Upgrade/Install Keywords: maitenance mode plugins, upgrade
Focuses: Cc:

Description

I'm sure this affects all hosts like 1and1, but there was a plugin I was trying to auto-upgrade (s2member) from 3.0.4 to 3.0.5.

When I was in WP2.9.2 I received an allocation error. Basically 1and1 restricts the memory_limit and there is no way to up it. So I wanted to see what would happen in WP3.0. I auto-upgraded to WP3.0 without a problem. Under the "Dashboard" there was a (1) next to Updates. I clicked "Updates" and put a check mark next to s2Member and clicked the "Update Plugins" button.

From here I got the standard WP3.0 message about going into "Maintenance Mode" and that it may take a while to upgrade the plugin, with a little swirly GIF pretending that progress is happening :).

I assume that it stuck on the same allocation error and never actually did anything. After about 5 minutes, I tried to browse to a different location of wp-admin. I received this message "Briefly unavailable for scheduled maintenance. Check back in a minute."

So, as I see...

1) The admin should not be restricted from browsing the site/wp-admin in "Maintenance Mode"
2) The admin should be able to cancel "Maintenance Mode" (or if there is a way, it should be obvious)
3) The auto-upgrade/maintenance mode needs to die gracefully when an error occurs, such as a memory_limit is reached.

In the mean time, how do I kill maintenance mode so I can get back to working on my site? :)

Thanks.
Lew Ayotte

P.S. I set this to prority to "highest omg bbq" and "severity" to major because this has the potential to severally affect non-technical WP users. (from what I can tell)f

Change History (11)

comment:1 layotte4 years ago

Apparently #3 does occur... it died gracefully after about 10-15 minutes. Probably should be lower. I'm going to time it now.

comment:2 layotte4 years ago

PeteMall on IRC told me the timeout is 10 minutes. FYI.

comment:3 PeteMall4 years ago

  • Milestone changed from 3.0.1 to Unassigned
  • Priority changed from highest omg bbq to normal
  • Severity changed from major to normal

Just delete the .maintenance file in the document root.

comment:4 follow-up: dd324 years ago

1) The admin should not be restricted from browsing the site/wp-admin in "Maintenance Mode"

The admin is just as likely to break during a plugin/core upgrade as any other page

2) The admin should be able to cancel "Maintenance Mode" (or if there is a way, it should be obvious)

3) The auto-upgrade/maintenance mode needs to die gracefully when an error occurs, such as a memory_limit is reached.

Which is impossible to track, At the point that execution stops due to a fatal error, the script has stoped entirely, its not possible to continue from there

One possibility is to treat this similar to the Database Error messages.

The front end recieves the ugly message, Admin recieves a pretty message with some descriptive text as to why its as it is, and if an error has occured, they can click through to disable maintanence mode.. In doing so however, would in 90% of cases require the FTP credentials again to disable the mode (Which, asking for it again, is probably appropriate still)

comment:5 in reply to: ↑ 4 sirzooro4 years ago

Replying to dd32:

3) The auto-upgrade/maintenance mode needs to die gracefully when an error occurs, such as a memory_limit is reached.

Which is impossible to track, At the point that execution stops due to a fatal error, the script has stoped entirely, its not possible to continue from there

When out of memory error occurs, PHP passes control to function installed using set_error_handler() call. I use it on one of my sites to send detailed error reports when some unexpected error happens. In case of out of memory error sometimes PHP has enough memory left, so my script is able to prepare error report and email it. Of course this happens only if there is still enough memory to prepare report and send it - otherwise PHP terminates my function.

I think we can use set_error_handler() to install function which will end maintenance mode when out of memory (or other critical error) occurs. Of course in case of out of memory error it may not be able to finish work, but we should at least try to do it.

We can also install recovery function via set_exception_handler() - it is called in PHP5+, after unhandled exception is thrown.

comment:6 sirzooro4 years ago

  • Cc sirzooro added

comment:7 dd324 years ago

When out of memory error occurs, PHP passes control to function installed using set_error_handler() call.

It didn't occur to me that was possible with OOM errors. It might be possible to unset($GLOBALSmajor class?); to free up some memory to update an option & remove the maintenance file..

comment:8 layotte4 years ago

I've noticed an additional issue. When an update fails gracefully (without removing the .maintenance file manually) the update-nag div is set to "An automated WordPress update has failed to complete - please attempt the update again now."

Since it always fails, the nag never goes away. Even when I manually updated the plugin and there are no plugins to be updated.

Deleting the .maintenance file is required to get rid of the update-nag.

comment:9 nacin3 years ago

The Codex now says to delete the .maintenance file to clear the nag.

Is there a bug here to fix?

comment:10 dd323 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

set_error_handler is not the best route to go here.. If the upgrade failed during the update, chances are, the installation may be damaged, this is the entire reason that .maintainence exists.

comment:11 knutsp3 years ago

  • Cc knut@… added
  • Keywords changed from maitenance mode, plugins, upgrade to maitenance mode plugins, upgrade
Note: See TracTickets for help on using tickets.