WordPress.org

Make WordPress Core

Opened 4 weeks ago

Closed 4 weeks ago

#50333 closed defect (bug) (wontfix)

Send complete error Stack Trace

Reported by: sebastienserre Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.4.1
Component: Site Health Keywords: 2nd-opinion needs-patch
Focuses: Cc:

Description

Hello,

Since several version, WordPress is sending email to site admin in case of fatal error on the website.

In the e-mail content we have the stack trace which can be useful to debug. In some case, this trace is unfortunately not complete...

For example I received times ago:

Une erreur de type E_ERROR a été causée dans la ligne 39 du fichier /var/www/stjean/sanct-nd-grace/wp-content/plugins/5p2p-newsletter/inc/acf-options.php. Message d’erreur : Uncaught Error: Class 'MailPoet\Models\Form' not found in /var/www/stjean/sanct-nd-grace/wp-content/plugins/5p2p-newsletter/inc/acf-options.php:39
Stack trace:
#0 /var/www/stjean/sanct-nd-grace/wp-content/themes/congregation/inc/themes-options-fields.php(168): p2p5_nl_load_options()
#1 /var/www/stjean/sanct-nd-grace/wp-content/themes/congregation/functions.php(238): require('/var/www/stjean...')
#2 /var/www/stjean/sanct-nd-grace/wp-settings.php(508): include('/var/www/stjean...')
#3 /var/www/stjean/sanct-nd-grace/wp-config.php(80): require_once('/var/www/stjean...')
#4 /var/www/stjean/sanct-nd-grace/wp-load.php(37): require_once('/var/www/stjean...')
#5 /var/www/stjean/sanct-nd-grace/wp-admin/admin.php(34): require_once('/var/www/stjean...')
#6 /var/www/stjean/sanct-nd-grace/wp-admin/plugins.php(10): require_once('/var/www/stjean...')
#7 {main}
  thrown

in my debug.log, behind the thrown the path to the file error.

Why this message truncated?

Should it be possible to have the entire error message ?

Thank you
}}}

Change History (2)

#1 @Clorith
4 weeks ago

The PHP function in use, error_get_last(), only gives the information that is shown in the email message.

To get a bigger stack trace, one would have to switch to something like debug_backtrace(), which requires processing to build the trace your self (I'm not aware of any other functions that does anything similar, but if you know of some I'd love to hear about them).

It's much simpler to provide an excerpt of the stack trace, and leave the full logging to actual log files.

This helps avoid issues like emails becoming too large to be sent, memory exhaustion (especially if the error was caused by running out of memory in the first place), and last but not least making the emails look less like spam so that they don't get picked up by spamfilters as often.

#2 @TimothyBlynJacobs
4 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

It's much simpler to provide an excerpt of the stack trace, and leave the full logging to actual log files.

This helps avoid issues like emails becoming too large to be sent, memory exhaustion (especially if the error was caused by running out of memory in the first place), and last but not least making the emails look less like spam so that they don't get picked up by spamfilters as often.

Agreed. I don't think we want the recovery mode emails to become a substitute for error logs.

Note: See TracTickets for help on using tickets.