Page MenuHomePhabricator

Stylesheet served as Flask static file returns 502 Bad Gateway on mobile
Open, Needs TriagePublicBUG REPORT

Description

The URL https://tools.wmflabs.org/speedpatrolling/static/diff.css yields a 502 Bad Gateway whenever I access it on my phone on Firefox. On desktop, or on mobile Chrome, it works, and there’s no error in the tool’s log:

[pid: 10|app: 0|req: 971/4074] 192.168.207.0 () {38 vars in 4607 bytes} [Sat Nov  2 14:42:51 2019] GET /speedpatrolling/static/diff.css => generated 146 bytes in 27 msecs via sendfile() (HTTP/1.1 200) 10 headers in 4245 bytes (0 switches on core 0)

(146 bytes is the correct size of ~tools.speedpatrolling/www/python/src/static/diff.css.) The tool’s source code is available at R2469 tool-speedpatrolling or on GitHub, but there’s nothing special about this file – it’s served via Flask’s standard static endpoint.

Any idea what’s going on? (I already cleared the cache in Firefox.)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSat, Nov 2, 2:48 PM
LucasWerkmeister added a comment.EditedSat, Nov 2, 3:19 PM

It doesn’t seem to be a cache problem – I still get the 502 Bad Gateway even when adding ?foo=bar to the URL.

Edit: also for accesskey.css and, after running ln -s diff.css T237158.css in the static/ directory, for T237158.css.

That is strange. A simple short CSS file should not return 502 Bad Gateway result in a different browser. I tried to reproduce with both Chrome and Firefox on my mobile, and both of them seems to be working fine. @LucasWerkmeister Are you using any VPN service? Or data saver settings in your browser?

Masumrezarock100 changed the subtype of this task from "Task" to "Bug Report".Sat, Nov 2, 3:33 PM

No VPN, no data saver settings as far as I’m aware.

bd808 added a subscriber: bd808.

Nothing obviously strange in a cURL response:

$ curl -v -A "Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0" https://tools.wmflabs.org/speedpatrolling/static/diff.css
*   Trying 185.15.56.11:443...
* TCP_NODELAY set
* Connected to tools.wmflabs.org (185.15.56.11) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /usr/local/etc/openssl@1.1/cert.pem
  CApath: /usr/local/etc/openssl@1.1/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=toolforge.org
*  start date: Oct 21 22:15:27 2019 GMT
*  expire date: Jan 19 22:15:27 2020 GMT
*  subjectAltName: host "tools.wmflabs.org" matched cert's "tools.wmflabs.org"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fa43104ae00)
> GET /speedpatrolling/static/diff.css HTTP/2
> Host: tools.wmflabs.org
> User-Agent: Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 200
< server: nginx/1.14.2
< date: Mon, 04 Nov 2019 04:20:31 GMT
< content-type: text/css; charset=utf-8
< content-length: 146
< last-modified: Sat, 02 Nov 2019 15:20:26 GMT
< cache-control: public, max-age=43200
< expires: Mon, 04 Nov 2019 16:20:31 GMT
< etag: "1572708026.8408873-146-3307214654"
< accept-ranges: bytes
< x-frame-options: deny
< strict-transport-security: max-age=86400
< x-clacks-overhead: GNU Terry Pratchett
< content-security-policy-report-only: default-src 'self' 'unsafe-eval' 'unsafe-inline' blob: data: filesystem: mediastream: wikibooks.org *.wikibooks.org wikidata.org *.wikidata.org wikimedia.org *.wikimedia.org wikinews.org *.wikinews.org wikipedia.org *.wikipedia.org wikiquote.org *.wikiquote.org wikisource.org *.wikisource.org wikiversity.org *.wikiversity.org wikivoyage.org *.wikivoyage.org wiktionary.org *.wiktionary.org *.wmflabs.org wikimediafoundation.org mediawiki.org *.mediawiki.org wss://tools.wmflabs.org; report-uri https://tools.wmflabs.org/csp-report/collect;
<
iframe {
    width: 100%;
    height: 80vh;
}

form {
    position: fixed;
    position: -webkit-sticky;
    position: sticky;
    bottom: 0px;
}
* Connection #0 to host tools.wmflabs.org left intact