Page MenuHomePhabricator

Invalid namespace given (-1) when undeleting?
Closed, ResolvedPublic

Description

Spotted in production:

Invalid or virtual namespace -1 given.

On urls of the format:

/w/api.php?action=flow&format=json&submodule=view-header&uselang=en&page=Special%3AUndelete&vhformat=html

E.g. https://www.mediawiki.org/w/api.php?action=flow&format=jsonfm&submodule=view-header&uselang=en&page=Special%3AUndelete&vhformat=html

With the following stacktrace:

#0 /srv/mediawiki/php-1.30.0-wmf.17/extensions/Flow/includes/WorkflowLoaderFactory.php(76): WikiPage::factory(Title)
#1 /srv/mediawiki/php-1.30.0-wmf.17/extensions/Flow/includes/Api/ApiFlowBase.php(78): Flow\WorkflowLoaderFactory->createWorkflowLoader(Title)
#2 /srv/mediawiki/php-1.30.0-wmf.17/extensions/Flow/includes/Api/ApiFlowBaseGet.php(12): Flow\Api\ApiFlowBase->getLoader()
#3 /srv/mediawiki/php-1.30.0-wmf.17/extensions/Flow/includes/Api/ApiFlow.php(100): Flow\Api\ApiFlowBaseGet->execute()
#4 /srv/mediawiki/php-1.30.0-wmf.17/includes/api/ApiMain.php(1583): Flow\Api\ApiFlow->execute()
#5 /srv/mediawiki/php-1.30.0-wmf.17/includes/api/ApiMain.php(546): ApiMain->executeAction()
#6 /srv/mediawiki/php-1.30.0-wmf.17/includes/api/ApiMain.php(517): ApiMain->executeActionWithErrorHandling()
#7 /srv/mediawiki/php-1.30.0-wmf.17/api.php(94): ApiMain->execute()
#8 /srv/mediawiki/w/api.php(3): include(string)
#9 {main}

Details

Related Gerrit Patches:

Event Timeline

demon created this task.Sep 5 2017, 10:07 PM
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptSep 5 2017, 10:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Catrope added a subscriber: Catrope.Sep 6 2017, 8:01 PM

/w/api.php?action=flow&format=json&submodule=view-header&uselang=en&page=Special%3AUndelete&vhformat=html is a very weird request. Who or what would ever want to treat Special:Undelete as a Flow page?

That said, we shouldn't die with an exception. But do we have any information about who/what is sending these requests?

Catrope claimed this task.Sep 6 2017, 8:09 PM
demon added a comment.Sep 6 2017, 8:14 PM

Indeed, that was my thought--bizarre requests to make. Without digging into the request logs I couldn't answer who is causing it.

That said, we shouldn't die with an exception. But do we have any information about who/what is sending these requests?

I just realized it could be people browsing deleted Flow boards. This is a valid use case that should (and does/did) work in Flow in general (just as you can browse deleted wikitext pages).

But:
a. I don't know why it needs to do view-header (maybe this is always done, not just post-edit or something, but is this necessary?)
b. Obviously Special:Undelete is not the right page name, but apparently it requires a page (which is problematic), though there is a vhrevId we could maybe use instead.

Change 376447 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/Flow@master] [WIP] WorkflowLoaderFactory: Don't crash for negative namespace titles

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

Change 376447 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] WorkflowLoaderFactory: Don't crash for negative namespace titles

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

Change 376786 had a related patch set uploaded (by Chad; owner: Catrope):
[mediawiki/extensions/Flow@wmf/1.30.0-wmf.17] WorkflowLoaderFactory: Don't crash for negative namespace titles

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

Change 376786 merged by jenkins-bot:
[mediawiki/extensions/Flow@wmf/1.30.0-wmf.17] WorkflowLoaderFactory: Don't crash for negative namespace titles

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

Checked /srv/mw-log/exception.log at @deployment-fluorine02 - the error is not found.

Note: Interesting that any page in Special will fail with that specific failure

Just invalid pages (for Flow) will display:
w/api.php?action=flow&format=json&submodule=view-header&uselang=en&page=~~~~~ and
for w/api.php?action=flow&submodule=view-header&page=Special:~~~~~

"code": "invalid-page",
   "info": "Bad title \"~~~~~\".",

But a page title is valid,

"code": "invalid-page-negative-namespace",
       "info": "Bad title \"Special:Test\".",
"code": "invalid-page-negative-namespace",
        "info": "Bad title \"Special:Watchlist\"."
Etonkovidova closed this task as Resolved.Sep 11 2017, 7:16 PM
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:10 PM