[wp-trac] [WordPress Trac] #53705: Plugin upgrade deletes files from other in-progress upgrades

WordPress Trac noreply at wordpress.org
Wed Jul 21 00:27:19 UTC 2021


#53705: Plugin upgrade deletes files from other in-progress upgrades
-----------------------------+---------------------
 Reporter:  bpayton          |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  5.9
Component:  Upgrade/Install  |     Version:  5.8
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+---------------------

Comment (by bpayton):

 I went back and instrumented WordPress upgrade logic with error logging
 that is more readable than what I did privately for myself. The logs now
 attached [https://core.trac.wordpress.org/attachment/ticket/53705/php-
 errors-plugin-corruption-20210720.txt here] show the following:
 1. An update failure leading to a disappearing plugin (coblocks)
 2. An update failure caused by a target directory being deleted while a
 zip was being unpacked to that directory (wordpress-seo)

 Each line of the log has a REQUEST ID at the beginning. Use that to track
 which request is doing what.

 If you search for "coblocks" in the logs, you can see that there are two
 different requests that do things to coblocks. One is downloading and
 unpacking (REQUEST 0059), and the other is deleting the unpacked files
 (REQUEST 0062). The coblocks upgrade errors before it can copy any new
 files but after it calls clear_destination() to delete its old files.
 After this, the coblocks plugin was no longer present on my site.

 If you search for "wordpress-seo" in the logs, you can again see two
 different requests working with a plugin. One is downloading and unpacking
 wordpress-seo (REQUEST 0061), and the other is deleting the unpacked files
 (REQUEST 0063). In this case, REQUEST 0061 is still unpacking wordpress-
 seo files when REQUEST 0063 comes along to delete the unpack destination,
 and REQUEST 0061 errors because it can no longer put unpacked files into
 the deleted destination directory.

 What these logs do not show is a broken plugin with only some of its
 files, but I think that is just a matter of timing. If a plugin gets to
 start copying its new files and another deletes those new files in the
 middle of copying, that could result in a plugin upgrade failure with a
 plugin directory containing only some of its files.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53705#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list