"No model available for [models]" error for API access
Closed, ResolvedPublic

Description

It appears that there's an error when attempting to obtain oresscores for some revisions.

$ curl -H "Accept: application/json" 'https://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Facebook&rvprop=ids|oresscores&format=json'

{"batchcomplete":"","query":{"pages":{"7529378":{"pageid":7529378,"ns":0,"title":"Facebook","revisions":[{"revid":806369485,"parentid":805909999,"oresscores":{"damaging":{"true":0.039,"false":0.961},"goodfaith":{"true":0.978,"false":0.022}}}]}}}}

$ curl -H "Accept: application/json" 'https://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=General%20Mills&rvprop=ids|oresscores&format=json'

{"error":{"code":"internal_api_error_RuntimeException","info":"[<redacted>] Exception caught: No model available for [models]"},"servedby":"mw1230"}

In T162484: DRAFT: Use rate limiting for ORES Action API score retrieval and T163687: Re-enable ORES data in action API we talked about lazily fetching older revision IDs, which is one theory about the source of the error (see https://gerrit.wikimedia.org/r/#/c/350756/ for configuration support - I don't see that flag set on mediawiki-config, though). Another suggestion on IRC suggested that maybe "https://github.com/wikimedia/mediawiki-extensions-ORES/blob/master/includes/Hooks/ApiHooksHandler.php#L303 should be something like getScores(..)[wfWikiID()]['scores']".

Restricted Application added a project: Scoring-platform-team. · View Herald TranscriptOct 24 2017, 11:00 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
dr0ptp4kt updated the task description. (Show Details)Oct 24 2017, 11:01 PM
Tgr added a subscriber: Tgr.Oct 24 2017, 11:06 PM

Presumably the response format of ORES changed (revision data is now a subfield of the array), and the extension has not been updated. ORES is not invoked for revisions which are still in the RC table so the error doesn't affect those.

logstash sample

Change 386350 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/ORES@master] Update ApiHooks to conform with v3 responses

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

Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptOct 25 2017, 9:54 AM

Change 386350 merged by jenkins-bot:
[mediawiki/extensions/ORES@master] Update ApiHooks to conform with v3 responses

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

Change 386402 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/ORES@wmf/1.31.0-wmf.4] Update ApiHooks to conform with v3 responses

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

Change 386403 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/ORES@wmf/1.31.0-wmf.5] Update ApiHooks to conform with v3 responses

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

Change 386403 merged by jenkins-bot:
[mediawiki/extensions/ORES@wmf/1.31.0-wmf.5] Update ApiHooks to conform with v3 responses

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

Change 386402 merged by jenkins-bot:
[mediawiki/extensions/ORES@wmf/1.31.0-wmf.4] Update ApiHooks to conform with v3 responses

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

Mentioned in SAL (#wikimedia-operations) [2017-10-25T18:19:10Z] <niharika29@tin> Synchronized php-1.31.0-wmf.4/extensions/ORES/: Update ApiHooks to conform with v3 responses T178962 (duration: 00m 51s)

Ladsgroup closed this task as Resolved.
Ladsgroup removed a project: Patch-For-Review.

Mentioned in SAL (#wikimedia-operations) [2017-10-25T18:20:17Z] <niharika29@tin> Synchronized php-1.31.0-wmf.5/extensions/ORES/: Update ApiHooks to conform with v3 responses T178962 (duration: 00m 50s)

Here's what I see now using that previously erroring request.

$ date -u
Wed Oct 25 18:24:53 UTC 2017
$ curl -H "Accept: application/json" 'https://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=General%20Mills&rvprop=ids|oresscores&format=json'
{"batchcomplete":"","query":{"pages":{"164902":{"pageid":164902,"ns":0,"title":"General Mills","revisions":[{"revid":805014164,"parentid":804928788,"oresscores":{"damaging":{"true":0.006611643383993,"false":0.99338835661601},"goodfaith":{"true":0.98892012689115,"false":0.011079873108853}}}]}}}}

Thanks.