Plugin updates get stuck in Maintenance Mode

Hello,

I’m attempting to update plugins on many child sites using the Dashboard.

This used to work fine, but now the process fails and all child sites become stuck in Maintenance Mode.

Is this a known issue with the latest versions of the Dashboard and MainWP Child plugins? It seemed to start happening after the move to PHP v8.0

After the plugin updates fail, the child sites return 503 (Service Unavailable) to the Dashboard, when previously they were running fine.

There’s nothing reported in the server logs on either the Dashboard or the child sites. Also, no new plugins have been installed on the Dashboard (e.g. security plugins).

Thanks

Hi Ricky,

Does this happen on all your sites or just ones that are on PHP 8 servers?
Can you please enable Debug logging on one site and try to duplicate the issue and see if any error will be recorded.

Hi Bogdan,

Good question… All sites are on PHP 8 and they’re all failing with plugin updates. Dashboard sync works fine.

Nothing is showing in the debug logs either.

I just tried rolling back one of the child sites to PHP 7.4 and it started working again, so it’s definitely an issue with the PHP version.

Our sites are all running PHP 8.0.16 and the latest version of MainWP plugins.

Thanks

Hi Ricky,

Can you please try this version and try to update one site:

Thanks Bogdan - unfortunately, the issue is still the same with that version of the Dashboard.

Thanks for checking.
Can you try with this MainWP Child plugin version on the child site side?

Hi Bogdan - no luck with that either, unfortunately.

I have the Dashboard and one Child site using the plugins posted above.

I just noticed that when the plugin update fails from the Dashboard, I see a console log message “NOMAINWP”.

Hi Ricky,

It looks like there is something killing the process. Can you confirm what is the PHP Max Execution time and PHP & WP Memory Limit on the child site?

max_execution_time = 3600
memory_limit = 512M
WP memory limit = 40MB

It’s worth noting that the plugin update fails within about 3-4 seconds.

Hi Ricky,

it could be a problem with Memory. Can you try to increase the WP Memory Limit to at least 256M and see if that helps?

Seems like more of a PHP version issue to me… I’ll keep looking for answers.

Hi Ricky,

could it be that some other plugin/theme is not PHP 8 ready on your child sites. What happens if you deactivate all plugins except for the MainWP Child on one site and try to run updates?

Here are the test results:

  • all plugins disabled except for MainWP Child… fails and locks the child site in maintenance mode

  • all plugins disabled except for MainWP Child and switched to default theme… also fails

  • tried updating the child site’s WP core from the dashboard (5.8.3 to 5.9.2) … also fails and puts child site into the core update lock state

  • rolled back to PHP 7.4 … everything works fine

Is there any way to capture the error that the Dashboard is receiving, or why the Dashboard stops the update process?

Hi Ricky,
thanks for verifying that.
I have tried multiple times to duplicate this problem on our PHP 8 setups but I couldn’t.

Would you mind opening a private Help Desk ticket so we can collect some additional information & investigate further?

Hi Bogdan,

I spend several hours debugging this and it appears to be related to WPEngine.

The way that WordPress downloads and unzips plugins has changed slightly with PHP 8. Now, it seems to be incompatible with WPEngine’s platform settings and causes the update process to crash.

Hi Ricky,

thanks for letting us know.
If you get more details about this problem or find a way to fix it, please let us know.

Hi Bogdan,

We may have found the issue…

It seems that when MainWP Dashboard initiates a plugin update, it sends the request to the MainWP Child plugin on each site.

The MainWP Child plugin starts by setting the Cron flag to ‘true’ at this line of code:

/mainwp-child/class/class-mainwp-child-updates.php:123

Eventually, the plugin update process gets handed over to WordPress Core and triggers these lines of code:

This means the disk_free_space() command is triggered, which behaves differently in PHP8 on some hosts. See these comments from WordPress developers: Upgrade/Install: Check if the `disk_free_space()` function exists bef… · WordPress/WordPress@ab263f9 · GitHub

It seems the workaround would be for the MainWP Child plugin to avoid using Cron for these update tasks.

Hi Ricky,

thanks for sharing your finding.

I will make sure our dev team gets this and checks it as soon as possible.

Hi Ricky,

we made some tweaks in the MainWP 4.2 Beta version to address this issue.

If you want you can test it with one or two sites to see if the problem gets solved.

Hi Ricky,

we made some tweaks in the MainWP 4.2 Beta version to address this issue.

If you want you can test it with one or two sites to see if the problem gets solved.