Page MenuHomePhabricator

InstantCommons API requests to Commons are erroring out
Closed, ResolvedPublic

Description

In response for the request https://commons.wikimedia.org/w/api.php?titles=File%3ALambsdorf_Vladimir_%281844-1907%29.jpg&iiprop=url%7Cthumbnail%7Ctimestamp&iiurlwidth=300&iiurlheight=-1&iiurlparam=300px&prop=imageinfo&format=json&action=query&redirects=true&uselang=ru issued by MediaWiki 1.26.2 when trying to get thumbnail of an image hosted with WikiMedia Commons, Wikimedia Commons' API says: {"servedby":"mw1190","warnings":{"imageinfo":{"*":"Unrecognized value for parameter 'iiprop': thumbnail"}},"error":{"code":"iiurlparam","info":"Invalid value for iiurlparam (interlace=)","*":"See https://commons.wikimedia.org/w/api.php for API usage"}}.

As a result, there is a thumbnail creation error.

Details

Related Gerrit Patches:
mediawiki/core : wmf/1.27.0-wmf.12BitmapHandler: Implement validateParam()
mediawiki/core : masterBitmapHandler: Implement validateParam()

Event Timeline

alex-mashin raised the priority of this task from to Needs Triage.
alex-mashin updated the task description. (Show Details)
alex-mashin added a subscriber: alex-mashin.
Restricted Application added subscribers: StudiesWorld, Steinsplitter, Aklapper. · View Herald TranscriptFeb 4 2016, 1:24 PM

I note there has never been a thumbnail parameter for iiprop.

The Invalid value for iiurlparam (interlace=) is because JpegHandler::parseParamString() is returning "interlace" as false, but JpegHandler::validateParam() is rejecting it. This appears to have been caused by https://gerrit.wikimedia.org/r/#/c/264048/.

Anomie set Security to None.
Restricted Application added a subscriber: Matanya. · View Herald TranscriptFeb 4 2016, 2:26 PM
matmarex renamed this task from WikiMedia Commons broken (broken backward compability in API?) to InstantCommons API requests to Commons are erroring out.Feb 4 2016, 3:53 PM
matmarex added subscribers: Steinlaus, Nemo_bis.
Aklapper triaged this task as Unbreak Now! priority.Feb 4 2016, 3:55 PM

Change 268404 had a related patch set uploaded (by Bartosz Dziewoński):
BitmapHandler: Implement validateParam()

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

To be honest I don't really understand the code, but fix looks reasonable and fixes the issue locally for me.

matmarex claimed this task.Feb 4 2016, 4:05 PM

Change 268404 merged by Bartosz Dziewoński:
BitmapHandler: Implement validateParam()

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

Change 268407 had a related patch set uploaded (by Bartosz Dziewoński):
BitmapHandler: Implement validateParam()

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

Change 268407 merged by jenkins-bot:
BitmapHandler: Implement validateParam()

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

matmarex closed this task as Resolved.Feb 4 2016, 4:55 PM

This has been fixed now, and the fix is deployed to Commons. InstantCommons on my local wiki works again.

Thanks for debugging, @Anomie and @alex-mashin :)

I note there has never been a thumbnail parameter for iiprop.

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