Page MenuHomePhabricator

FunctionView: Batch wikilambdaload_zobjects calls to handle when we load more than 50 items at once
Closed, ResolvedPublicBUG REPORT

Description

Description

Requesting too many values on fetchZid returns the error "too many values"

E.g. See https://wikifunctions.beta.wmflabs.org/wiki/Z844, which accumulates residual implementations due to e2e tests

Screenshot from 2024-03-04 11-06-10.png (465×848 px, 61 KB)

The implementation details are not shown because the computed wikilambdaload_zobjects call returns "too many values" error

Call:
https://wikifunctions.beta.wmflabs.org/w/api.php?action=query&format=json&list=wikilambdaload_zobjects&wikilambdaload_zids=Z11242|Z11243|Z11247|Z11248|Z11252|Z11253|Z11254|Z11255|Z11258|Z11259|Z11262|Z11265|Z11266|Z11269|Z11270|Z11274|Z11275|Z11278|Z11279|Z11280|Z11281|Z11284|Z11285|Z11289|Z11290|Z11291|Z11292|Z11295|Z11296|Z11300|Z11301|Z11305|Z11306|Z11310|Z11311|Z11315|Z11316|Z11322|Z11323|Z11324|Z11327|Z11328|Z11329|Z11332|Z11333|Z11334|Z11337|Z11338|Z11339|Z11342|Z11343|Z11344|Z11350|Z11351|Z11352|Z11366|Z11367|Z11372|Z11373|Z11378|Z11379|Z11386|Z11387|Z11392|Z11393|Z11441|Z11442|Z11443|Z11444|Z11449|Z11450|Z11451|Z11452|Z11456|Z11457|Z11458|Z11462|Z11463|Z11464|Z11465|Z11469|Z11470|Z11471|Z11472|Z11476|Z11477|Z11478|Z11479|Z11497|Z11498|Z11499|Z11500|Z11504|Z11505|Z11506|Z11507|Z11512|Z11513|Z11517|Z944&wikilambdaload_language=en&wikilambdaload_get_dependencies=true

Return:
'Too many values supplied for parameter "wikilambdaload_zids". The limit is 50.'

{
    "error": {
        "code": "toomanyvalues",
        "info": "Too many values supplied for parameter \"wikilambdaload_zids\". The limit is 50.",
        "parameter": "wikilambdaload_zids",
        "limit": 50,
        "lowlimit": 50,
        "highlimit": 500,
        "*": "See https://wikifunctions.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
    },
    "servedby": "deployment-mediawiki11"
}

Steps to reproduce:

  1. Go to https://wikifunctions.beta.wmflabs.org/wiki/Z844
  2. Observe the disconnected implementations

Completion checklist

Event Timeline

gengh renamed this task from FunctionView: Run fetchZids for disconnected implementations to FunctionView: Avoid and/or handle "too many values" error message.Mar 4 2024, 10:38 AM
gengh updated the task description. (Show Details)
gengh updated the task description. (Show Details)

This is a bug in the FE code. The limit of 50 is imposed on us by MW and not something we can (or should) avoid. They should be batched there instead.

Jdforrester-WMF renamed this task from FunctionView: Avoid and/or handle "too many values" error message to FunctionView: Batch wikilambdaload_zobjects calls to handle when we load more than 50 items at once.Mar 7 2024, 5:44 PM
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF moved this task from To Triage to Backlog on the Abstract Wikipedia team board.
Jdforrester-WMF changed the subtype of this task from "Bug Report" to "Task".Apr 1 2024, 7:33 PM

Change #1020188 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] [WIP] Fixit: Request Zids in batches of max 50 items

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

Change #1020188 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Fixit: Request Zids in batches of max 50 items

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

Change #1024901 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Request Zids in batches of max 50 items

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

Change #1024901 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Request Zids in batches of max 50 items

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

Jdforrester-WMF changed the subtype of this task from "Task" to "Bug Report".Apr 29 2024, 6:32 PM

The call from the task description works on wikifunctions beta - no errors/warnings were retruned.

@gengh On production (wikifunctios wmf.3 - the patch with fix - https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikiLambda/+/1024901 was deployed) the same call as in the bug description- https://www.wikifunctions.org/w/api.php?action=query&format=json&list=wikilambdaload_zobjects&wikilambdaload_get_dependencies=true&wikilambdaload_language=en&wikilambdaload_zids=Z11242|Z11243|Z11247|Z11248|Z11252|Z11253|Z11254|Z11255|Z11258|Z11259|Z11262|Z11265|Z11266|Z11269|Z11270|Z11274|Z11275|Z11278|Z11279|Z11280|Z11281|Z11284|Z11285|Z11289|Z11290|Z11291|Z11292|Z11295|Z11296|Z11300|Z11301|Z11305|Z11306|Z11310|Z11311|Z11315|Z11316|Z11322|Z11323|Z11324|Z11327|Z11328|Z11329|Z11332|Z11333|Z11334|Z11337|Z11338|Z11339|Z11342|Z11343|Z11344|Z11350|Z11351|Z11352|Z11366|Z11367|Z11372|Z11373|Z11378|Z11379|Z11386|Z11387|Z11392|Z11393|Z11441|Z11442|Z11443|Z11444|Z11449|Z11450|Z11451|Z11452|Z11456|Z11457|Z11458|Z11462|Z11463|Z11464|Z11465|Z11469|Z11470|Z11471|Z11472|Z11476|Z11477|Z11478|Z11479|Z11497|Z11498|Z11499|Z11500|Z11504|Z11505|Z11506|Z11507|Z11512|Z11513|Z11517|Z944 - returns:

{
    "error": {
        "code": "toomanyvalues",
        "info": "Too many values supplied for parameter \"wikilambdaload_zids\". The limit is 50.",
        "parameter": "wikilambdaload_zids",
        "limit": 50,
        "lowlimit": 50,
        "highlimit": 500,
        "*":"See https://www.wikifunctions.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
    },
   "servedby":"mw-wikifunctions.codfw.main-86d94966c9-txjwl"
}

Also, https://wikifunctions.beta.wmflabs.org/wiki/Z844 displays the following error in the console:

Uncaught (in promise) TypeError: error is undefined
    testResultsPromise zTesterResults.js:303

Screen Shot 2024-05-03 at 10.29.11 AM.png (1×3 px, 291 KB)

I think this is logged-in (with a privileged user) vs. logged-out (with just the 50 limit).

I think this is logged-in (with a privileged user) vs. logged-out (with just the 50 limit).

Re-checked, yes, even the labels on wikifunctions Special:ApiSandbox, e.g. wikilambdaload_zids, state that "Maximum number of values is 50 (500 for clients that are allowed" higher limits).