Page MenuHomePhabricator

API should not return an error on batched deletions
Closed, ResolvedPublic

Description

Pages with a large number of revisions are now deleted in batches of them since T198176: Mediawiki page deletions should happen in batches of revisions. However API returns an error when the deletion is scheduled successfully.

on pywikibot delete.py
pywikibot.data.api.APIError: delete-scheduled: The page "Викивести:Време/Европа/Босна и Херцеговина/Бања Лука/ветар правац" is scheduled for deletion. Please be patient. [help:See https://sr.wikinews.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.]
<class 'pywikibot.data.api.APIError'>
CRITICAL: Closing network session.
on APISandbox
{
    "error": {
        "code": "delete-scheduled",
        "info": "The page \"\u0412\u0438\u043a\u0438\u0432\u0435\u0441\u0442\u0438:\u0412\u0440\u0435\u043c\u0435/\u0415\u0432\u0440\u043e\u043f\u0430/\u0421\u0440\u0431\u0438\u0458\u0430/\u0412\u0435\u043b\u0438\u043a\u043e \u0413\u0440\u0430\u0434\u0438\u0448\u0442\u0435/\u0443\u0441\u043b\u043e\u0432\u0438\" is scheduled for deletion. Please be patient.",
        "*": "See https://sr.wikinews.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": "mw1341"
}

Pywikibot scripts terminates abruptly because of the API error message which causes handling requests like T212346 to be slower than they should be. Thank you.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 19 2018, 10:41 PM
Restricted Application added a subscriber: pywikibot-bugs-list. · View Herald TranscriptDec 20 2018, 8:12 AM
Anomie claimed this task.Dec 20 2018, 2:06 PM
Anomie moved this task from Unsorted to In Dev on the MediaWiki-API board.
Anomie added a subscriber: Anomie.

I think there's no bug in pywikibot here. The addition of scheduled deletions to MediaWiki seems to have not been integrated well with the API.

Marking as a regression and blocking the 1.32 release.

Change 480964 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] ApiDelete: Handle batched deletions properly

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

Anomie moved this task from In Dev to Needs Review on the MediaWiki-API board.Dec 20 2018, 3:04 PM

Change 480964 merged by jenkins-bot:
[mediawiki/core@master] ApiDelete: Handle batched deletions properly

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

Change 480991 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@REL1_32] ApiDelete: Handle batched deletions properly

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

Reedy closed this task as Resolved.Dec 20 2018, 6:37 PM
Reedy removed a project: Patch-For-Review.

Change 480991 merged by jenkins-bot:
[mediawiki/core@REL1_32] ApiDelete: Handle batched deletions properly

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

Note the fix should be deployed to Wikimedia wikis with 1.33.0-wmf.12, see https://www.mediawiki.org/wiki/MediaWiki_1.33/Roadmap for a schedule.