[wp-trac] [WordPress Trac] #62176: No stable error detection after Automatic Updates with more than one update

WordPress Trac noreply at wordpress.org
Tue Oct 8 07:37:09 UTC 2024


#62176: No stable error detection after Automatic Updates with more than one update
-----------------------------------+------------------------------
 Reporter:  georgwordpress         |       Owner:  (none)
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Upgrade/Install        |     Version:  6.6
 Severity:  normal                 |  Resolution:
 Keywords:  2nd-opinion has-patch  |     Focuses:
-----------------------------------+------------------------------

Comment (by georgwordpress):

 I have just realized that there may be a misunderstanding.
 I have not been able to **reliably** repeat the error either.
 If my description above is correct, that will also be impossible because
 it really is pure coincidence by luck.

 When I came across hints in the logs while testing that using $upgrading
 can lead to problems, I developed this PR.

 My approach:
 if no problems occur with this PR despite removing sleep(2), then this is
 an indication that my description above is correct.

 But I just thought of another approach to show reproducibly that the error
 detection of the function {{{has_fatal_error}}} is not always correct
 (without the PR).

 If I edit the {{{function maintenance_mode}}}
 (in /wp-admin/includes/class-wp-upgrader.php)
 and comment out the line with the update of the variable:

 {{{
 $maintenance_string = '<?php //$upgrading = ' . time() . '; ?>';
 }}}

 then all plugin updates are carried out without any problems.
 But in a negative test with a buggy plugin this is not deteced.
 Here for example with plugin A beeing buggy.

 {{{
 [08-Oct-2024 05:27:40 UTC] Automatic updates starting...
 [08-Oct-2024 05:27:40 UTC] Automatic plugin updates starting...
 [08-Oct-2024 05:27:40 UTC] Upgrading plugin 'gri_plugin_update_A'...
 [08-Oct-2024 05:27:41 UTC] Plugin 'gri_plugin_update_A' has been upgraded.
 [08-Oct-2024 05:27:41 UTC] PHP Fatal error: Uncaught Error:
 Call to undefined function noSuchFunctionThrewError()
 in .../wp-content/plugins/gri_plugin_update_A/gri_plugin_update_A.php:221
 Stack trace:
 ...
   thrown in ../wp-
 content/plugins/gri_plugin_update_A/gri_plugin_update_A.php on line 221
 [08-Oct-2024 05:27:44 UTC] The update for 'gri_plugin_update_A' has no
 fatal errors.
 [08-Oct-2024 05:27:44 UTC] Upgrading plugin 'gri_plugin_update_B'...
 [08-Oct-2024 05:27:44 UTC] Plugin 'gri_plugin_update_B' has been upgraded.
 [08-Oct-2024 05:27:47 UTC] The update for 'gri_plugin_update_B' has no
 fatal errors.
 [08-Oct-2024 05:27:47 UTC] Automatic plugin updates complete.
 [08-Oct-2024 05:27:47 UTC] Automatic updates complete.
 }}}

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


More information about the wp-trac mailing list