Last modified: 2011-08-26 16:27:03 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 T31246, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29246 - API errors occasionally with unknown error 231
API errors occasionally with unknown error 231
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Sam Reed (reedy)
:
Depends on:
Blocks: 29068
  Show dependency treegraph
 
Reported: 2011-06-02 14:43 UTC by Carl Fürstenberg
Modified: 2011-08-26 16:27 UTC (History)
11 users (show)

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


Attachments

Description Carl Fürstenberg 2011-06-02 14:43:51 UTC
When doing multiple automatic edits I occasionally get unknown error 231 in between the database lock errors.
Comment 1 Roan Kattouw 2011-06-02 14:48:29 UTC
This is caused by the following sequence of events:

* Article::doEdit() fails, and returns a Status object with failure info
* EditPage::internalAttemptSave() checks for $status->isOK(), and returns AS_END if $status signifies an error. The Status object is discarded
* API doesn't handle AS_END, falls through to returning an unknown error. There's a comment here about needing to propagate the Status object

I guess the best way to fix this would be to refactor internalAttemptSave() to return a Status object instead of one of 30+ error codes.
Comment 2 Chad H. 2011-06-10 04:34:29 UTC
(In reply to comment #1)
> I guess the best way to fix this would be to refactor internalAttemptSave() to
> return a Status object instead of one of 30+ error codes.
>

Please! For back-compat, you can set the error code in $status->value on failure.
Comment 3 Roan Kattouw 2011-08-26 16:27:03 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > I guess the best way to fix this would be to refactor internalAttemptSave() to
> > return a Status object instead of one of 30+ error codes.
> >
> 
> Please! For back-compat, you can set the error code in $status->value on
> failure.
Thanks for that tip. I took it a little bit further and just made all flow decisions based on $status->value, because EditPage is such a mess.

Fixed in r95562.

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


Navigation
Links