Last modified: 2010-07-30 05:42:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T26564, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24564 - Fatal errors when using xxlimit=max
Fatal errors when using xxlimit=max
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.17.x
All All
: Normal critical (vote)
: ---
Assigned To: Roan Kattouw
http://en.wikipedia.org/w/api.php?act...
:
: 24571 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-28 03:28 UTC by Brad Jorsch
Modified: 2010-07-30 05:42 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brad Jorsch 2010-07-28 03:28:23 UTC
The API on enwiki is now giving fatal errors when the special value "max" is set for the limit parameter of various modules (I've tried prop=categories, revisions, and templates quickly, and all three had the problem). The error message is "Exception Caught: Internal error in ApiResult::setElement: Attempting to add element categories=500, existing value is 500".

In my local installation of Mediawiki, this error occurs with r69776 and does not occur with r69775. I haven't yet attempted to see what exactly in that 1334-line diff might have broken things.
Comment 1 OverlordQ 2010-07-28 03:44:06 UTC
Backtrace if it helps: http://pastebin.ca/WtfmbvfF

password is pants
Comment 2 Tim Starling 2010-07-28 04:27:21 UTC
Fixed.
Comment 3 OverlordQ 2010-07-28 07:53:26 UTC
Re-opening as problem still occurs[1] if using generators as pointed out[2] in the mailing list.

1 - http://en.wikipedia.org/w/api.php?gbltitle=American&prop=info&action=query&generator=backlinks&gbllimit=max
2 - http://lists.wikimedia.org/pipermail/mediawiki-api/2010-July/001896.html
Comment 4 Tim Starling 2010-07-28 07:57:50 UTC
Too late, it's released now.
Comment 5 Bryan Tong Minh 2010-07-28 11:17:45 UTC
The problem is:
1) ApiMain::execute calls extractRequestParams with $parseLimit = true
2) The limit=max gets parsed and added to the result
3) ApiQueryBacklinks::run calls extractRequestParams with $parseLimit = false
4) ApiQueryBacklinks::run calculates its own limit and adds that to the result

I will make a fix where for limits calls overwriting is allowed.
Comment 6 Bryan Tong Minh 2010-07-28 11:33:00 UTC
Fixed in r70078, needs deployment.
Comment 7 Brad Jorsch 2010-07-28 11:44:24 UTC
I was going to suggest changing it to $generator->extractRequestParams( false ) and $module->extractRequestParams( false ) in ApiQuery.php, but I guess that works. Your version also causes bug 21310 to be broken in a different, less annoying way.
Comment 8 Raimond Spekking 2010-07-28 15:28:02 UTC
*** Bug 24571 has been marked as a duplicate of this bug. ***
Comment 9 Tim Starling 2010-07-30 05:42:59 UTC
It's deployed now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links