Page MenuHomePhabricator

Do not send suppressed errors to [error-json]
Closed, DeclinedPublic

Description

When visiting special:log and there are many old log rows (without serializied log_params) the debug toolbar shows many of the following:

[error-json] {"id":"4b34db2e","type":"ErrorException","file":"\\includes\\logging\\LogEntry.php","line":138,"message":"PHP Notice: unserialize(): Error at offset 0 of 24 bytes","suppressed":true,"url":"/index.php/Spezial:Logbuch","backtrace":[{"function":"handleError","class":"MWExceptionHandler","type":"::","args":["integer","string","string","integer","array"]},{"file":"\\includes\\logging\\LogEntry.php","line":138,"function":"unserialize","args":["string"]},{"file":"\\includes\\logging\\LogEntry.php","line":250,"function":"extractParams","class":"LogEntryBase","type":"::","args":["string"]},{"file":"\\includes\\logging\\LogEntry.php","line":231,"function":"getParameters","class":"DatabaseLogEntry","type":"->","args":[]},{"file":"\\includes\\logging\\LogFormatter.php","line":463,"function":"isLegacy","class":"DatabaseLogEntry","type":"->","args":[]},{"file":"\\includes\\logging\\BlockLogFormatter.php","line":70,"function":"extractParameters","class":"LogFormatter","type":"->","args":[]},{"file":"\\includes\\logging\\LogFormatter.php","line":512,"function":"extractParameters","class":"BlockLogFormatter","type":"->","args":[]},{"file":"\\includes\\logging\\BlockLogFormatter.php","line":32,"function":"getMessageParameters","class":"LogFormatter","type":"->","args":[]},{"file":"\\includes\\logging\\LogFormatter.php","line":426,"function":"getMessageParameters","class":"BlockLogFormatter","type":"->","args":[]},{"file":"\\includes\\logging\\LogFormatter.php","line":401,"function":"getActionMessage","class":"LogFormatter","type":"->","args":[]},{"file":"\\includes\\logging\\LogEventsList.php","line":311,"function":"getActionText","class":"LogFormatter","type":"->","args":[]},{"file":"\\includes\\logging\\LogPager.php","line":346,"function":"logLine","class":"LogEventsList","type":"->","args":["stdClass"]},{"file":"\\includes\\pager\\IndexPager.php","line":442,"function":"formatRow","class":"LogPager","type":"->","args":["stdClass"]},{"file":"\\includes\\specials\\SpecialLog.php","line":202,"function":"getBody","class":"IndexPager","type":"->","args":[]},{"file":"\\includes\\specials\\SpecialLog.php","line":109,"function":"show","class":"SpecialLog","type":"->","args":["FormOptions","array"]},{"file":"\\includes\\specialpage\\SpecialPage.php","line":384,"function":"execute","class":"SpecialLog","type":"->","args":["NULL"]},{"file":"\\includes\\specialpage\\SpecialPageFactory.php","line":582,"function":"run","class":"SpecialPage","type":"->","args":["NULL"]},{"file":"\\includes\\MediaWiki.php","line":267,"function":"executePath","class":"SpecialPageFactory","type":"::","args":["Title","RequestContext"]},{"file":"\\includes\\MediaWiki.php","line":565,"function":"performRequest","class":"MediaWiki","type":"->","args":[]},{"file":"\\includes\\MediaWiki.php","line":414,"function":"main","class":"MediaWiki","type":"->","args":[]},{"file":"\\index.php","line":46,"function":"run","class":"MediaWiki","type":"->","args":[]}]}

Why suppressed errors ("suppressed":true) are sent to error-json?

Event Timeline

Umherirrender raised the priority of this task from to Needs Triage.
Umherirrender updated the task description. (Show Details)
Umherirrender added a subscriber: Umherirrender.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 30 2015, 8:11 PM

https://phabricator.wikimedia.org/rMWb5efa72afdfec05f391040604b683324939f2f35 explicitly left the unfiltered error and exception event streams being logged to the *-json channels. This seems to have been quite intentional by @Krinkle. I'd like to hear his reasoning before making any changes.

Krinkle added a comment.EditedJul 6 2015, 11:14 PM

@bd808 I don't mind if we filter them out. I just left it unfiltered because it's trivial to filter out by default in the consumer layer (e.g. logstash/kibana) and gives us an opportunity to also look into suppressed errors from time to time to see if there's anything valuable in there.

Krinkle closed this task as Declined.Oct 20 2015, 2:12 AM
Krinkle claimed this task.

Recommending these stay in the error-json channel. It happened more than once recently that we were suppressing errors for a user function call that in turn made other calls that created errors that weren't supposed to be suppressed.

Being able to search through the suppressed ones was quite valuable.