Page MenuHomePhabricator

Unable to view some images in the Wikipedia Android App (Internal error)
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
An error is displayed:

image.png (945×2,048 px, 155 KB)

What should have happened instead?:

The image should've displayed properly

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

https://de.wikipedia.org/api/rest_v1/page/media-list/Chrysler_Building/268673738 also returns HTTP 500 ({"status":500,"type":"Internal error"}) when visiting it through the browser.

Event Timeline

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

Currently I observe that every image in https://de.wikipedia.org/wiki/Chrysler_Building has the problem (error message after tapping the image) in the app. There are more articles with the problem when using the app, eg https://de.wikipedia.org/wiki/40_Wall_Street .

There is also an error message without a revision ID at all for https://de.wikipedia.org/api/rest_v1/page/media-list/Chrysler_Building :
"{"status":500,"type":"Internal error"}"

I think that all articles with "mapframe" have the problem (9000+ articles in de.WP alone, 1000+ articles in en.WP, 2000+ in fr.WP).

Example: https://de.wikipedia.org/api/rest_v1/page/media-list/Bremen shows status 500 , the article contains

<mapframe latitude="53.363665" longitude="8.547363" zoom="8" width="400" height="302" align="right">
{
  "type": "FeatureCollection",
  "features": []
}
</mapframe>

Example in en.WP: https://en.wikipedia.org/api/rest_v1/page/media-list/Durban
Exmaple in fr.WP: https://fr.wikipedia.org/api/rest_v1/page/media-list/Grenoble

So two problems:

  1. img of kartographer are not being filtered out, because they noviewer class is not on the <figure> but on the <a> wrapping the img. the medialist endpoint of Page Content Service only scans from the <figure> up.
  2. there is no resource attribute AND not title on the img element. which causes an error on return _.uniq(results, el => (el.title || el.original.source)); which is the cause of the 500 for the endpoint.

Change #1335956 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/Kartographer@master] PCS: noviewer class belongs on the figure element

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

Given how many articles are affected right now, is it possible to prioritize a fix for the immediate problem (in contrast to waiting for https://phabricator.wikimedia.org/T318433) ?

@TheDJ @Arlolra Can you comment if this (in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Kartographer/+/1335956 ) belongs to the "fix for the immediate problem"?

Frameless should still wrap the anchor in a span if you're matching the media spec, and the class can go on that span to be consistent

I think the question is, do we change the html of the frameless mode of Kartographer to emulate the frameless mode of mw:File media ?

It's probably not needed for an immediate fix.

Change #1335956 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] PCS: noviewer class belongs on the figure element

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

I think the question is, do we change the html of the frameless mode of Kartographer to emulate the frameless mode of mw:File media ?

I think that would be preferably, especially if longer term we're going to use T318433#10397735

It's probably not needed for an immediate fix.

No, I merged the patch and can try to backport it tomorrow

I noticed that there is no "status 500" anymore for https://de.wikipedia.org/api/rest_v1/page/media-list/Bremen . There is also no problem in the Android app anymore for this case. I also checked the other exemples in this thread: the problem appears to be fixed.

I am not sure about the interpretation: has the "merge to master" alone fixed the problem (without backport?) or is there another explanation?

I noticed that there is no "status 500" anymore for https://de.wikipedia.org/api/rest_v1/page/media-list/Bremen . There is also no problem in the Android app anymore for this case. I also checked the other exemples in this thread: the problem appears to be fixed.

I am not sure about the interpretation: has the "merge to master" alone fixed the problem (without backport?) or is there another explanation?

Definitely not from the merge, I assume it was fixed by T434524 / https://github.com/wikimedia/mediawiki-services-mobileapps/commit/3fff6e6b4e1de64101eedb36d7fe5fd97fd41998

This change (https://phabricator.wikimedia.org/T434524 ) was deployed yesterday. I also conclude that it was the "fix for the immediate problem" I asked for.