WordPress.org

Make WordPress Core

Opened 8 months ago

Last modified 5 days ago

#51823 assigned defect (bug)

Native auto updater caused plugin update to fail and disappears plugin from directory

Reported by: richards1052 Owned by: francina
Milestone: Awaiting Review Priority: normal
Severity: major Version:
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Have a strange experience with the new native auto updater feature. I've enabled it for most of my plugins including Mailpoet and Yoast. Both plugins shipped an update on the same day. But when auto updater tried to update them not only was there a fatal error, but both plugins disappeared from my directory.

I manually reinstalled them both. But I've never seen plugins entirely disappear like this. So I'd like to address this to whatever team is responsible for the auto updater.

Here is a message from my web host which offers some documentation of some of the errors:

about the error lines, there are thousands of these lines at 16:05

[17-Nov-2020 16:05:10 UTC] PHP Warning: chmod(): No such file or directory in XX/public_html/wp-admin/includes/class-wp-filesystem-direct.php on line 173

I think "chmod()" is called on the update process, but the files vanished between the time they were listed and the time some actions were made on them

right after there's also:

[17-Nov-2020 16:05:20 UTC] PHP Fatal error: Uncaught Error: Class 'MailPoetVendor\Doctrine\DBAL\Types\BooleanType' not found in XX/public_html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Types/Type.php:2

So some files were really missing during the upgrade

The bug is probably related to the WP updater rather than those plugins: i looked at the SQL backup from the 17 morning, and i saw the auto_updater call was scheduled for 16:04:52

First time we've seen this issue so far.. And i'm not seeing any bug report on the WP trac about it.

I'd report it to them but we have too little information to share

I have a question: are auto updates still enabled in jetpack settings (i think it's from wp.com which i cannot see)?
Because i see a query from jetpack server during the auto-upgrade from WP. So there are chances they both tried to upgrade:

[17/Nov/2020:16:04:57 +0000] "POST /wp-cron.php?doing_wp_cron=1605629097.3026950359344482421875

WP cron starts the auto update

[17/Nov/2020:16:05:07 +0000] "GET /2013/10/15/iran-hacks-azerbaijans-israeli-made-drone-fleet/?relatedposts=1&highlight=drones HTTP/1.1" 503

Google visits a page but gets a 503 code because the upgrade is still running

[17/Nov/2020:16:05:00 +0000] "POST /xmlrpc.php?for=jetpack&[...]

Jetpack makes a very long call, which finishes after the google visit (logged after but started 16:05:00), and took 11s to process, there are chances it also tried to upgrade. But that's just a possibility.

I have really no idea how both of them work together and if they share the same update data. It's possible that jetpack takes over and that it's an issue with it.

Attachments (1)

screenshot-www.richardsilverstein.com-2020.11.17-11_58_13.jpg (25.5 KB) - added by richards1052 8 months ago.
shows file error for two plugins which failed to update and then disappeared

Download all attachments as: .zip

Change History (22)

@richards1052
8 months ago

shows file error for two plugins which failed to update and then disappeared

#1 @SergeyBiryukov
8 months ago

  • Component changed from General to Upgrade/Install
  • Description modified (diff)
  • Focuses coding-standards removed

This ticket was mentioned in Slack in #core-auto-updates by hellofromtonya. View the logs.


8 months ago

#3 @SergeyBiryukov
8 months ago

Hi there, welcome back to WordPress Trac! Thanks for the report.

Just linking to some tickets here that might be related: #11138, #27994, #31138, #37301, #49963, #50937.

Last edited 8 months ago by SergeyBiryukov (previous) (diff)

#4 @apedog
8 months ago

Also maybe related: #50349

#5 @pbiron
8 months ago

Also possibly related: #51816

#6 @richards1052
8 months ago

OP: I wanted to add two comments that may be relevant to figuring out what this issue/bug is. They were each posted to different WP forum threads.

This is from a Yoast Support person in the WP forum:

"we have also seen similar reports before and can confirm the issue mostly occurs when there’s a network connection hiccup between the update host (WordPress plugins repository) and the webserver as the auto-update feature is handled by the WordPress itself rather than a plugin."

This is from a Jetpack Contributor in the Jetpack WP forum:

"The significant part is here:

So some files were really missing during the upgrade

This indicates that some files were missing from the plugin update (which can happen with larger plugins containing a lot of files) so the update failed and the plugin was deactivated. Then if you tried to reinstall the plugins you would also get an error because the plugin folder already exists (just without all the files).

Regarding the Jetpack query your host mentioned, that looks like Jetpack was trying to fetch related posts from WordPress.com (which it does every 12 hours when the related posts cache expires). It’s not related to the plugin update though, just coincidental timing.

So in summary, it seems the plugins failed to update because the updater encountered an error when copying files, and some of the files were not copied. This is more likely to happen with large plugins like Mailpoet and Yoast SEO, which have a lot of files to copy."

#7 follow-up: @hellofromTonya
8 months ago

  • Version 5.6 deleted

Removing 5.6 as the version as this issue has previously existed before 5.6.

Per Sergey:

This doesn't seem new, I think it was discussed recently that core updater has a bit more defensive checks and a rollback in place if the update did not complete successfully, but the plugin/theme updater does not.

#8 in reply to: ↑ 7 @richards1052
8 months ago

OP: This bug does not cause a rollback. It actually removes the entire plugin and it's files from the plugin directory.

Replying to hellofromTonya:

Removing 5.6 as the version as this issue has previously existed before 5.6.

Per Sergey:

This doesn't seem new, I think it was discussed recently that core updater has a bit more defensive checks and a rollback in place if the update did not complete successfully, but the plugin/theme updater does not.

#9 follow-up: @SergeyBiryukov
8 months ago

Related: #51857

#10 in reply to: ↑ 9 @richards1052
8 months ago

Replying to SergeyBiryukov:

Related: #51857

While the bugs may be related, I want to emphasize that in my case there wasn't merely a rollback. If that was all that happened it would be inconvenient. But when the entire plugin disappears, that's major.

#11 @pbiron
8 months ago

@richards1052 From the information you've provided is it not possible to tell why the update of the plugin on your site failed. The purpose of #51857 will be to reinstall (rollback) the old version of the plugin when something like what happened to you happens to anyone.

This ticket was mentioned in Slack in #core-auto-updates by pbiron. View the logs.


7 months ago

This ticket was mentioned in Slack in #core-auto-updates by francina. View the logs.


2 months ago

#14 @francina
8 weeks ago

  • Owner set to francina
  • Status changed from new to assigned

This ticket was mentioned in Slack in #core-auto-updates by francina. View the logs.


8 weeks ago

#16 follow-up: @francina
8 weeks ago

Hi @richards1052 , from the conversation it seems that the issue can not be reproduced. Do you have any other information that can be relevant to this case? Thanks

#17 @richards1052
8 weeks ago

Since I first posted, a Mailpoet upgrade again caused a failure of the auto updater and disappeared the plugin from my directory. I had to reinstall.

I think that the auto update feature should communicate more information to the user when it fails like this. A message to me saying this, would cause me to review the failure; and I would catch the plugin disappearing much quicker.

I also don't understand why when there is a failure the auto updater doesn't simply roll back to the previous version instead of disappearing the plugin.

#18 @richards1052
8 weeks ago

In the meantime, I have removed Mailpoet & Yoast from the auto updater queue so I will update them manually. Not my preference. But at least I won't see my plug-ins disappear.

#19 in reply to: ↑ 16 @SergeyBiryukov
8 weeks ago

Replying to francina:

from the conversation it seems that the issue can not be reproduced.

It looks like something went wrong during the update process, which resulted in the plugin directory being deleted.

I think implementing a rollback in #51857 and making the updater more reliable in general, including providing more feedback when something goes wrong, should resolve this.

#20 @justinahinon
6 weeks ago

It is a bit hard to reproduce the issue. So we can just rely on info/data provided by others that encountered it (randomly?). Also, I think it will likely be solved by the rollback mechanism as Sergey mentioned in its last comment.

So, I’d say, we just leave it open until #51857 is fixed.

#21 @bpayton
5 days ago

This issue looks like it might be caused by #53705 where multiple, simultaneous plugin upgrade attempts conflict. If two upgrades are in progress at the same time, the later upgrade can delete the earlier upgrade's plugin files before it is able to finish copying them.

Note: See TracTickets for help on using tickets.