Page MenuHomePhabricator

Do something better than an "Unauthorized" error page at https://upload.wikimedia.org/
Closed, ResolvedPublic

Description

If you open https://upload.wikimedia.org/, you see a error "Unauthorized"

A redirect to commons or a placeholder page schould be created.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

MediaWiki-Uploading nothing to do with MediaWiki's internal uploading system.

I don't think upload.wikimedia.org has anything to do with apache.

I tried curl -H "Host: upload.wikimedia.org" http://ms-fe.svc.eqiad.wmnet/ on bast1001 and got a "Wikimedia Upload" "There is no public index." "For a searchable repository of freely usable media files, please go to <a href="//commons.wikimedia.org/">Wikimedia Commons</a>." etc. response, so I doubt the problem is on Swift's end either. Something in Varnish/nginx?

No idea where that response file actually comes from either :/

Redirecting "/" on upload.wikimedia.org on both HTTP and HTTPS to https://commons.wikimedia.org seems reasonable and clean to me.

@Krenair where does that come from (run curl with -v, and then Server: header)?

There is no Server header in that response @Southparkfan

MZMcBride renamed this task from Create page for https://upload.wikimedia.org/ to Do something better than an "Unauthorized" error page at https://upload.wikimedia.org/.Mar 19 2016, 9:47 PM

I don't think upload.wikimedia.org has anything to do with apache.

I tried curl -H "Host: upload.wikimedia.org" http://ms-fe.svc.eqiad.wmnet/ on bast1001 and got a "Wikimedia Upload" "There is no public index." "For a searchable repository of freely usable media files, please go to <a href="//commons.wikimedia.org/">Wikimedia Commons</a>." etc. response, so I doubt the problem is on Swift's end either. Something in Varnish/nginx?

Well the response on https://upload.wikimedia.org has the following header:

Www-Authenticate: Swift realm="AUTH_mw"

So seems likely that the 401 error is generated by swift. I imagine rewrite.py is trying to rewrite the url to swift and failing.

Change 278924 had a related patch set uploaded (by Filippo Giunchedi):
varnish: redirect upload.wikimedia.org to commons

https://gerrit.wikimedia.org/r/278924

yeah what @Bawolff said! please see related patch to serve 301s out of varnish and redirect to commons instead

@fgiunchedi: Can you please point to where the message I saw comes from?

Okay, but where is the HTML itself (within the puppet repo somewhere, I would hope)? It should get removed when varnish starts overriding requests for it with a commons redirect

Also that code references robots.txt which is also broken in the same way
And requests for favicon.ico just result in a 504 Gateway Time-out from nginx

@Krenair in swift eqiad ATM

root@ms-fe1001:~# swift list root
crossdomain.xml
favicon.ico
index.html
robots.txt
root@ms-fe1001:~# swift download root crossdomain.xml
crossdomain.xml [auth 0.022s, headers 0.050s, total 0.051s, 0.007 MB/s]
root@ms-fe1001:~# swift download root robots.txt
robots.txt [auth 0.028s, headers 0.155s, total 0.155s, 0.000 MB/s]
root@ms-fe1001:~# swift download root index.html
index.html [auth 0.024s, headers 0.033s, total 0.034s, 0.481 MB/s]
root@ms-fe1001:~# cat crossdomain.xml 
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" />
</cross-domain-policy>
root@ms-fe1001:~# cat robots.txt 
User-agent: *
Disallow: /wikipedia/commons/archive/

root@ms-fe1001:~# head index.html 
<html>
       <head>
               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
               <title>Wikimedia Upload</title>
               <link rel="shortcut icon" href="/favicon.ico">
               <style type="text/css">
                       * {
                               font-family: 'Gill Sans', 'Gill Sans MT', sans-serif;
                       }
                       a:link, a:visited {

given robots and crossdomain.xml are also there, I've restored the container in codfw too since it was a regression.
I still think we should redirect upload homepage to commons though, and/or have the files somewhere other than swift containers

Krenair assigned this task to fgiunchedi.