Page MenuHomePhabricator

Argument 1 passed to WikiPage::factory() must be an instance of Title, null given
Closed, DuplicatePublic

Description

I'm trying to import an XML dump to a wiki already containing most of the content, but I want to import the pages that don't exist yet too. Mid-way importDump.php exists with an 'incorrect argument passed' error.

$ php /srv/mediawiki/w/maintenance/importDump.php --wiki poserdazfreebiestestwiki --no-updates /root/poserdazfreebiesorainorg_w-20150808-history.xml
[nothing strange here so far]
2000 (4.25 pages/sec 32.28 revs/sec)
Page "w:en:Module:Protection banner/config/testcases" was not imported because its name is reserved for external linking (interwiki).
PHP Catchable fatal error:  Argument 1 passed to WikiPage::factory() must be an instance of Title, null given, called in /srv/mediawiki/w/includes/Import.php on line 386 and defined in /srv/mediawiki/w/includes/page/WikiPage.php on line 105

Catchable fatal error: Argument 1 passed to WikiPage::factory() must be an instance of Title, null given, called in /srv/mediawiki/w/includes/Import.php on line 386 and defined in /srv/mediawiki/w/includes/page/WikiPage.php on line 105

When looking in the php error log I get this stacktrace:

2016-01-07 16:08:52 mw1 poserdazfreebiestestwiki: [46c0d3d6] [no req]   ErrorException from line 105 of /srv/mediawiki/w/includes/page/WikiPage.php: PHP Error: Argument 1 passed
 to WikiPage::factory() must be an instance of Title, null given, called in /srv/mediawiki/w/includes/Import.php on line 386 and defined
#0 /srv/mediawiki/w/includes/page/WikiPage.php(105): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/w/includes/Import.php(386): WikiPage::factory(NULL)
#2 [internal function]: WikiImporter->finishImportPage(NULL, NULL, integer, integer, array)
#3 /srv/mediawiki/w/includes/Import.php(461): call_user_func_array(array, array)
#4 /srv/mediawiki/w/includes/Import.php(756): WikiImporter->pageOutCallback(NULL, NULL, integer, integer, array)
#5 /srv/mediawiki/w/includes/Import.php(566): WikiImporter->handlePage()
#6 /srv/mediawiki/w/maintenance/importDump.php(299): WikiImporter->doImport()
#7 /srv/mediawiki/w/maintenance/importDump.php(257): BackupReader->importFromHandle(resource)
#8 /srv/mediawiki/w/maintenance/importDump.php(102): BackupReader->importFromFile(string)
#9 /srv/mediawiki/w/maintenance/doMaintenance.php(103): BackupReader->execute()
#10 /srv/mediawiki/w/maintenance/importDump.php(304): require_once(string)
#11 {main}

DB server (I only have one DB server, so no master-slave setup) is MariaDB 10.0 (Debian 8), MediaWiki server runs Debian 8 and PHP 5.6.14-0+deb8u1. MediaWiki 1.26.2, although I experienced the same error in 1.25 too.

The XML file is available at https://static.miraheze.org/dumps/poserdazfreebiesorainorg_w-20150808-history.xml (please don't open it in your browser, please use curl/wget, your browser will crash) if needed.