[wp-trac] [WordPress Trac] #64155: Add stack trace to failed plugin update error notifications

WordPress Trac noreply at wordpress.org
Wed Oct 29 11:28:10 UTC 2025


#64155: Add stack trace to failed plugin update error notifications
-------------------------------------+-------------------------------------
 Reporter:  tlloancy                 |       Owner:  (none)
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Upgrade/Install          |     Version:  6.8.3
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing needs-     |     Focuses:  administration, php-
  patch                              |  compatibility
-------------------------------------+-------------------------------------

Comment (by tlloancy):

 just now
 @afragen Here is **hard proof** from another **real production site** —
 **two consecutive auto-update failures of the same plugin,** both with:
 phpdefine( 'WP_DEBUG', true );
 define( 'WP_DEBUG_LOG', true );
 Result:

 wp-content/debug.log → completely empty
 No PHP error, no timeout, no memory issue
 Manual update works instantly


 **Plugin in question: Newsletter
 → Version 9.0.5 → 9.0.6**

 **Failure #1 – 2025-10-21 15:08:13**
 textSubject: [GATASYA YOGA] Certaines mises à jour d’extensions ont échoué
 Recipient: contact at gatasya-yoga.com

 Email body (via WP Mail Logging iframe preview):
 "Les extensions suivantes n’ont pas pu être mises à jour : Newsletter"
 No error code. No reason. No stack trace.


 **Failure #2 – 2025-10-22 03:19:37**
 textSubject: [GATASYA YOGA] Certaines mises à jour d’extensions ont échoué
 Recipient: contact at gatasya-yoga.com

 Same email. Same plugin: Newsletter
 Same silence in logs
 Retry later → succeeded
 Manual update from admin → instant success

 **Source: WP Mail Logging Plugin**


 {{{
 <!-- Email #1 -->
 <div class="wp-mail-logging-modal-row-value">2025-10-21 15:08:13</div>
 <div class="wp-mail-logging-modal-row-value">[GATASYA YOGA] Certaines
 mises à jour d’extensions ont échoué</div>

 <!-- Email #2 -->
 <div class="wp-mail-logging-modal-row-value">2025-10-22 3:19:37</div>
 <div class="wp-mail-logging-modal-row-value">[GATASYA YOGA] Certaines
 mises à jour d’extensions ont échoué</div>
 }}}
 **
 No WP_Error code. No message. No file/line. No stack trace.



 This is not a fatal PHP error
 → Fatals are logged with WP_DEBUG_LOG
 → These are not
 This is not a download/network failure
 → download_failed → logged
 → Here: total silence
 **

 And then the **manual update works, Which of course does'nt help at all
 the comprehension**


 {{{
 Newsletter
 Désactiver | Traduire
 L’extension Newsletter permet de créer votre propre liste d’abonnés,
 d’envoyer des newsletters en masse, et de construire votre réseau
 professionnel. Avant de mettre à jour, visitez cette page, pour connaître
 les derniers changements.

 Version 9.0.6 | Par Stefano Lissa & The Newsletter Team | Afficher les
 détails
 Désactiver les mises à jour auto
 Mis à jour !
 }}}



 **Proposed Fix (debug-only, zero production impact)** **Something along
 this line:
 **

 {{{
 // File: wp-admin/includes/class-wp-automatic-updater.php
 // After: $result = $upgrader->upgrade( $plugin );

 if ( is_wp_error( $result ) ) {
     $plugin     = $this->skin->plugin;
     $error_msg  = $result->get_error_message();
     $error_code = $result->get_error_code();

     // 1. Log to debug.log (only if enabled)
     if ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
         $trace = ( defined( 'WP_DEBUG' ) && WP_DEBUG )
             ? "\nStack trace:\n" . ( new Exception() )->getTraceAsString()
             : '';

         error_log( sprintf(
             "[Auto-Update Failure] Plugin: %s | Code: %s | Message: %s%s",
             $plugin,
             $error_code,
             $error_msg,
             $trace
         ) );
     }

     // 2. Enhanced email (admin-only)
     $debug_info = ( defined( 'WP_DEBUG' ) && WP_DEBUG )
         ? "\n\nDebug: {$error_msg} (Code: {$error_code})"
         : '';

     $this->send_email( 'failure', $plugin, $debug_info );
 }
 }}}

 **
 Conclusion:**
 Rollback + retry = **does not fix it**
 **Manual update = required to resolve
 Debugging = impossible**

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


More information about the wp-trac mailing list