Page MenuHomePhabricator

The usual WMF HTTP 500 error page is not displayed in the case of unhandled exceptions
Closed, DeclinedPublic

Description

Certain errors (unhandled exceptions, I guess) don't result in the usual WMF error page. See the description of T110878:

What is interesting is that on WMF sites, this doesn't show the usual "Wikimedia Foundation error" page, but instead shows a quasi-plain text response of a kind that I have never seen before: https://www.mediawiki.org/wiki/Special:WhatLinksHere/Media:Wiki.png The HTML source of the returned page is exactly the following:

MediaWiki internal error.<br />
<br />
Exception caught inside exception handler.<br />
<br />
Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information.<br />

This error is unhelpful to non-developers, because it uses highly technical jargon like "exception caught inside exception handler", and doesn't tell users where to report the error. It doesn't even show the skin interface, which may make some users worry that they have "broken the site"!

Event Timeline

TTO created this task.Sep 17 2015, 1:57 AM
TTO raised the priority of this task from to Medium.
TTO updated the task description. (Show Details)
TTO added subscribers: TTO, Aklapper.
TTO added a subscriber: Reedy.
demon added a subscriber: demon.Oct 27 2015, 4:16 PM

This should be pretty easy to do. We don't actually return a 500 in this scenario afaict...we should.

demon added a comment.Oct 27 2015, 4:17 PM

Er, we should depending on the stack trace :\

Krinkle closed this task as Declined.EditedSep 27 2019, 9:32 PM
Krinkle added a subscriber: Krinkle.

A lot has changed in 2015. For the most part cases like these are covered, and they do always return HTTP 500 now.

However, there remains a small edge case where if there are several layers of errors, it can still show in plain text. This is in cases where there are two or three layers of cascading errors within MediaWiki. The last layer there is a generic MediaWiki HTML output, which still looks like the above. This layer cannot read Wikipedia or WMF branding as the ability to do that is among the things that has failed at that point.

As of PHP7 we have the php-wmerrors extension deployed again which means if this layer isn't reached either, the next level above that (e.g. for Segfaults), there is a pretty error page again. Closing as declined for now as I don't think is feasible to enhance this, rather the class of errors is sufficiently small that I don't think it's worth the cost and overhead of trying to enhance this with an additional subsystem. There is an easy alternative, which is to render a blank response that the traffic-layer (e.g. Varnish or Apache) would backfill with a generic nice error page. But this goes at the cost of being able to determine what went wrong (eg. an error message with details as to what happened and how it might be solved).

Given this class of errors is among the most rare and yet the worst/most difficult to investigate, I think we'd prefer some details about what happened over no details but branding.