Page MenuHomePhabricator

http://commons.wikimedia.org/wiki/File:Trie_example.svg causes 503 Service Unavailable
Closed, ResolvedPublic

Description

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

http://commons.wikimedia.org/wiki/File:Trie_example.svg

The history page or other files work fine:

The thumbnail (which is how I discovered it, when using VisualEditor) is also broken:
http://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Trie_example.svg/213px-Trie_example.svg.png

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

Remote Address: 91.198.174.208:80
Request URL: http://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Trie_example.svg/213px-Trie_example.svg.png
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
Host: upload.wikimedia.org
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=*

Body

1 
2 Headers already sent, terminating.
3

Event Timeline

Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle subscribed.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

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

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 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.

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