Page MenuHomePhabricator

Test Commons doesn't show any images
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:

image.png (344×656 px, 43 KB)

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:

The URL is giving https://upload.wikimedia.org/wikipedia/test-commons/6/66/Screenshot_2021-11-30_024926.png this:

Unauthorized

This server could not verify that you are authorized to access the document you requested.

I think it's a swift

Event Timeline

I see that's recently uploaded; did you do something unusual in uploading?

I can confirm it's swift saying 401:

mvernon@ms-fe1011:~$ curl -o /tmp/foo -v -H "Host: upload.wikimedia.org" http://localhost/wikipedia/test-commons/6/66/Screenshot_2021-11-30_024926.png
#[...]
< HTTP/1.1 401 Unauthorized
< Www-Authenticate: Swift realm="AUTH_mw"
#[...]
mvernon@ms-fe1011:~$ grep 'Screenshot_2021-11-30_024926.png' /var/log/swift/proxy-access.log
Apr 14 08:27:07 ms-fe1011 proxy-server: 127.0.0.1 127.0.0.1 14/Apr/2022/08/27/07 GET /v1/AUTH_mw/wikipedia-test-commons-local-public/6/66/Screenshot_2021-11-30_024926.png HTTP/1.0 401 - curl/7.52.1 - - 131 - txcd7dcb8728414177936a9-006257dadb - 0.0284 - - 1649924827.329000950 1649924827.357408047 0

No idea why, though, maybe @fgiunchedi has seem similar before?

Apr 14 09:09:02 ms-fe1011 proxy-server: 127.0.0.1 127.0.0.1 14/Apr/2022/09/09/02
 GET /v1/AUTH_mw/wikipedia-commons-local-public.88/8/88/Kirchspiel%252C_R%25C3%2
5B6dder%252C_M%25C3%25A4usescheune_--_2014_--_2915-19.jpg HTTP/1.0 200 - curl/7.
52.1 - - 7902116 - tx24102e144fb946ba9b2ba-006257e4ae - 0.1008 - - 1649927342.11
1402988 1649927342.212161064 0

That image seems to be hitting commons swift URL. Compare:
https://upload.wikimedia.org/wikipedia/commons/8/88/Kirchspiel%2C_R%C3%B6dder%2C_M%C3%A4usescheune_--_2014_--_2915-19.jpg

And

https://upload.wikimedia.org/wikipedia/test-commons/6/66/Screenshot_2021-11-30_024926.png

I think we probably have an allow list to avoid exposing images in private wikis and this wiki is not considered public there. I guess.

I'm not quite sure how all the plumbing works, but the container seems to be meant to be readable:

root@ms-fe1009:/etc/swift# swift stat wikipedia-testcommons-local-public | grep 'Read ACL'
        Read ACL: mw:thumbor,mw:media,.r:*

(the name isn't quite consistent with the URL, but it does have the right thing in, I think:)

Container: wikipedia-testcommons-local-public
   Object: 6/66/Screenshot_2021-11-30_024926.png

Which is the same ACL as for the container my example was in:

root@ms-fe1009:/etc/swift# swift stat wikipedia-commons-local-public.88 | grep 'Read ACL'
        Read ACL: mw:thumbor,mw:media,.r:*

Maybe the mismatch container name is the problem?

If you're asking me, I have no idea how swift ACL or swift-mediawiki relation works. Sorry.

It looks like there's a mismatch in the urls mediawiki is sending out (project test-commons) vs the containers for "test commons" that have been created (i.e. testcommons, no dash)

I don't recall running into this before ATM but I'm imagining we'd need to add a rule to normalize container names when the project name contains dashes (or add test-commons to such a list of projects with dashes if such list exists)

My hypothesis: The normalization script works for every domain except *.wikimedia.org for lots of reasons and that's why it bit us. we do have a lot of wikis with - in their langcode (zh-classical for example) but nothing in *.wikimedia.org to my knowledge.

Change 784311 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] filebackend: Fix link to thumb url in testcommonswiki

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

Change 784311 merged by jenkins-bot:

[operations/mediawiki-config@master] filebackend: Fix link to thumb url in testcommonswiki

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

Mentioned in SAL (#wikimedia-operations) [2022-04-20T13:48:32Z] <ladsgroup@deploy1002> Synchronized wmf-config/InitialiseSettings.php: Config: [[gerrit:784311|filebackend: Fix link to thumb url in testcommonswiki (T306139)]] (duration: 00m 53s)

Ladsgroup claimed this task.