Page MenuHomePhabricator

Cannot read property 'imageinfo' of undefined in media
Open, LowPublic

Description

A request to

curl http://mobileapps.discovery.wmnet:8888/de.wikipedia.org/v1/page/media/Wikipedia%3AHauptseite%2FSchon_gewusst%2FZeittafel

results in

{"status":500,"type":"internal_error","title":"TypeError","detail":"Cannot read property 'imageinfo' of undefined","method":"GET","uri":"/de.wikipedia.org/v1/page/media/Wikipedia%3AHauptseite%2FSchon_gewusst%2FZeittafel"}

with a log entry

[2019-08-14T17:43:15.836Z] ERROR: mobileapps/255 on scb1002: 500: internal_error (message="500: internal_error", status=500, type=internal_error, detail="Cannot read property 'imageinfo' of undefined", request_id=fd135d50-beba-11e9-a86c-df05a30f8cc7, levelPath=error/500)
    stack: TypeError: Cannot read property 'imageinfo' of undefined
        at meta.filter.item (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/src/lib/imageinfo.js:226:36)
        at Array.filter (native)
        at makeResults (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/src/lib/imageinfo.js:226:17)
        at P.join (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/src/lib/imageinfo.js:415:36)
        at tryCatcher (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/util.js:16:23)
        at Holder$3._callFunction (eval at generateHolderClass (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/join.js:1:0), <anonymous>:14:44)
        at Holder$3.checkFulfillment (eval at generateHolderClass (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/join.js:1:0), <anonymous>:29:30)
        at Promise.eval (eval at thenCallback (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/join.js:1:0), <anonymous>:6:20)
        at Promise._settlePromise (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:571:21)
        at Promise._settlePromise0 (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:619:10)
        at Promise._settlePromises (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:699:18)
        at Promise._fulfill (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:643:18)
        at Promise._resolveCallback (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:437:57)
        at Promise._settlePromiseFromHandler (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:529:17)
        at Promise._settlePromise (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:574:18)
        at Promise._settlePromise0 (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:619:10)
        at Promise._settlePromises (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:699:18)
        at Promise._fulfill (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:643:18)
        at PromiseArray._resolve (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise_array.js:126:19)
        at PromiseArray._promiseFulfilled (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise_array.js:144:14)
        at Promise._settlePromise (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:579:26)
        at Promise._settlePromise0 (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:619:10)
        at Promise._settlePromises (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/promise.js:699:18)
        at _drainQueueStep (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/async.js:138:12)
        at _drainQueue (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/async.js:131:9)
        at Async._drainQueues (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/async.js:147:5)
        at Immediate.Async.drainQueues (/srv/deployment/mobileapps/deploy-cache/revs/615004fb84e0f2507c714aaec7891c8f628cdc60/node_modules/bluebird/js/release/async.js:17:14)
    --
    request: {
      "url": "/de.wikipedia.org/v1/page/media/Wikipedia%3AHauptseite%2FSchon_gewusst%2FZeittafel",
      "headers": {
        "user-agent": "curl/7.38.0",
        "x-request-id": "fd135d50-beba-11e9-a86c-df05a30f8cc7"
      },
      "method": "GET",
      "params": {
        "0": "/de.wikipedia.org/v1/page/media/Wikipedia:Hauptseite/Schon_gewusst/Zeittafel"
      },
      "query": {},
      "remoteAddress": "127.0.0.1",
      "remotePort": 43198
    }

Event Timeline

Pchelolo created this task.Aug 14 2019, 5:43 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 14 2019, 5:43 PM

One of the batched MW API requests is hitting this error:

{
  error: {
    code: 'urlparamnormal',
    info: 'Could not normalize image parameters for Tessie_Reynolds_02.tif.',
    docref: 'See https://de.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for notice of API deprecations and breaking changes.' },
    servedby: 'mw1342'
  }
}

We should investigate that specific issues as well as add better error handling.

This is the faulty request: https://de.wikipedia.org/w/api.php?action=query&titles=File:Tessie_Reynolds_02.tif&prop=imageinfo&iiurlwidth=320

I guess the problem is that the original image size is 0x0 pixels, thus the requested thumbnail width of 320 is incorrect. MW could've been a bit more explicit in it's error message, but I don't think it's strictly nesessary..

bearND added a subscriber: bearND.Aug 14 2019, 6:47 PM

Doesn't happen with the media-list endpoint.

curl "https://de.wikipedia.org/api/rest_v1/page/media-list/Wikipedia%3AHauptseite%2FSchon_gewusst%2FZeittafel"
Jhernandez triaged this task as Low priority.Aug 21 2019, 3:37 PM
Jhernandez added a subscriber: Jhernandez.

@Pchelolo Do you know the frequency of the errors? To help us prioritize how urgent it is to fix.

Making it low for now. Once we set the appropriate priority we can move to backlog.

Not very often. Actually, it seems to have completely disappeared about a week ago.