Page MenuHomePhabricator causes 503 Service Unavailable
Closed, ResolvedPublic


Visiting logged-out, non-HTTPS shows 503 Service Unavailable (green wm error page)

The history page or other files work fine:

The thumbnail (which is how I discovered it, when using VisualEditor) is also broken:

It responds with HTTP 200 OK (never 304) and serves a blank page containing only the plain text Headers already sent, terminating.

Remote Address:
Request URL:
Request Method: GET

Response Headers

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx867380d3127d49e99df8c-005501d670
X-Varnish: 4211970751, 2510845933 2509662250, 2617017197 2617013849
Via: 1.1 varnish, 1.1 varnish, 1.1 varnish
Content-Length: 52
Accept-Ranges: bytes
Date: Thu, 12 Mar 2015 18:19:42 GMT
Age: 590
Connection: keep-alive
X-Cache: cp1049 miss (0), cp3008 hit (4), cp3018 frontend hit (1)
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Age, Date, Content-Length, Content-Range, X-Content-Duration, X-Cache, X-Varnish
Timing-Allow-Origin: *

Request Headers

GET /wikipedia/commons/thumb/b/be/Trie_example.svg/213px-Trie_example.svg.png HTTP/1.1
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2329.0 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en,nl;q=0.8
Cookie: GeoIP=*


2 Headers already sent, terminating.

Event Timeline

Krinkle created this task.Mar 12 2015, 6:22 PM
Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle added a subscriber: Krinkle.
Restricted Application added a project: Multimedia. · View Herald TranscriptMar 12 2015, 6:22 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tgr added a subscriber: Tgr.Mar 12 2015, 6:27 PM

Caused by the outage mentioned in T92531. Varnish apparently cached the error for file URLs (the file page works now).

Tgr added a comment.Mar 12 2015, 6:42 PM

The deeper problem is that thumb.php returns an error message with a HTTP 200 status if there is output before the headers are set. If it would return a proper 503, varnish would not cache.

The error message comes from StreamFile::prepareForStream(), and that function properly returns an error status in this case; it must be lost somewhere on the way up.

Tgr triaged this task as High priority.Mar 12 2015, 6:50 PM
Steinsplitter set Security to None.
Steinsplitter moved this task from Incoming to Uploading on the Commons board.
Tgr closed this task as Resolved.Mar 12 2015, 7:09 PM
Tgr claimed this task.
Tgr added a subscriber: BBlack.

@BBlack fixed this by banning all files with content-lengh==52. Following up on the return status issue in T92545.

Tgr added a comment.Mar 12 2015, 7:12 PM

(I wonder how that content length is calculated? \nHeaders already sent, terminating.\n is only 36 bytes.)