Page MenuHomePhabricator

[Bug] Fatal error: Uncaught exception 'MWContentSerializationException' when running core phpunit tests, with wikibase repo installed
Closed, ResolvedPublic1 Estimated Story Points

Description

I have item content in the main namespace, which seems to be the problem here.

tests should be more robust and be able to handle or work around this.

Fatal error: Uncaught exception 'MWContentSerializationException' with message 'Failed to decode as ' in /var/www/wiki/core/extensions/Wikidata/extensions/Wikibase/lib/includes/store/EntityContentDataCodec.php:201
Stack trace:
#0 /var/www/wiki/core/extensions/Wikidata/extensions/Wikibase/lib/includes/store/EntityContentDataCodec.php(250): Wikibase\Lib\Store\EntityContentDataCodec->decodeEntityContentData()
#1 /var/www/wiki/core/extensions/Wikidata/extensions/Wikibase/repo/includes/content/EntityHandler.php(394): Wikibase\Lib\Store\EntityContentDataCodec->decodeRedirect()
#2 /var/www/wiki/core/includes/content/ContentHandler.php(156): Wikibase\Repo\Content\EntityHandler->unserializeContent()
#3 /var/www/wiki/core/tests/phpunit/MediaWikiTestCase.php(440): ContentHandler::makeContent()
#4 /var/www/wiki/core/tests/phpunit/includes/PrefixSearchTest.php(9): MediaWikiTestCase->insertPage()
#5 /var/www/wiki/core/tests/phpunit/MediaWikiTestCase.php(127): PrefixSearchTest->addDBData()
#6 /var/www/wiki/core/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): MediaWikiTestCase->run()
#7 /var/www/wiki/core/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): PHPUnit_Framework_TestSuite->run()
#8 /var/www/wiki/core/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): PHPUnit_Framework_TestSuite->run()
#9 /var/www/wiki/core/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(406): PHPUnit_Framework_TestSuite->run()
#10 /var/www/wiki/core/vendor/phpunit/phpunit/src/TextUI/Command.php(153): PHPUnit_TextUI_TestRunner->doRun()
#11 /var/www/wiki/core/vendor/phpunit/phpunit/src/TextUI/Command.php(105): PHPUnit_TextUI_Command->run()
#12 /var/www/wiki/core/tests/phpunit/phpunit.php(241): PHPUnit_TextUI_Command::main()
#13 {main}
[50c1446e] [no req] MWContentSerializationException from line 201 of /var/www/wiki/core/extensions/Wikidata/extensions/Wikibase/lib/includes/store/EntityContentDataCodec.php: Failed to decode as
Backtrace:
#0 /var/www/wiki/core/extensions/Wikidata/extensions/Wikibase/lib/includes/store/EntityContentDataCodec.php(250): Wikibase\Lib\Store\EntityContentDataCodec->decodeEntityContentData(string, NULL)
#1 /var/www/wiki/core/extensions/Wikidata/extensions/Wikibase/repo/includes/content/EntityHandler.php(394): Wikibase\Lib\Store\EntityContentDataCodec->decodeRedirect(string, NULL)
#2 /var/www/wiki/core/includes/content/ContentHandler.php(156): Wikibase\Repo\Content\EntityHandler->unserializeContent(string, NULL)
#3 /var/www/wiki/core/tests/phpunit/MediaWikiTestCase.php(440): ContentHandler::makeContent(string, Title)
#4 /var/www/wiki/core/tests/phpunit/includes/PrefixSearchTest.php(9): MediaWikiTestCase->insertPage(string)
#5 /var/www/wiki/core/tests/phpunit/MediaWikiTestCase.php(127): PrefixSearchTest->addDBData()
#6 /var/www/wiki/core/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): MediaWikiTestCase->run(PHPUnit_Framework_TestResult)
#7 /var/www/wiki/core/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): PHPUnit_Framework_TestSuite->run(PHPUnit_Framework_TestResult)
#8 /var/www/wiki/core/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): PHPUnit_Framework_TestSuite->run(PHPUnit_Framework_TestResult)
#9 /var/www/wiki/core/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(406): PHPUnit_Framework_TestSuite->run(PHPUnit_Framework_TestResult)
#10 /var/www/wiki/core/vendor/phpunit/phpunit/src/TextUI/Command.php(153): PHPUnit_TextUI_TestRunner->doRun(PHPUnit_Framework_TestSuite, array)
#11 /var/www/wiki/core/vendor/phpunit/phpunit/src/TextUI/Command.php(105): PHPUnit_TextUI_Command->run(array, boolean)
#12 /var/www/wiki/core/tests/phpunit/phpunit.php(241): PHPUnit_TextUI_Command::main()

Event Timeline

aude created this task.Apr 28 2015, 2:01 PM
aude raised the priority of this task from to Needs Triage.
aude updated the task description. (Show Details)
aude added a project: MediaWiki-Core-Testing.
aude added a subscriber: aude.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 28 2015, 2:01 PM

It seems to try to create a normal page in the main namespace which is configured to be items only. How should the test pick the namespace to create the test page in?

JanZerebecki triaged this task as Medium priority.May 15 2015, 6:43 PM
JanZerebecki moved this task from incoming to needs discussion or investigation on the Wikidata board.
aude added a comment.Aug 14 2015, 9:16 AM

still happens

aude added a comment.Aug 14 2015, 9:17 AM

@JanZerebecki MediaWikiTestCase has getDefaultWikitextNS that can be used and in some places something like NS_HELP is used. (assumed to always be wikitext)

aude renamed this task from Fatal error: Uncaught exception 'MWContentSerializationException' when running core phpunit tests, with wikibase repo installed to [Bug] Fatal error: Uncaught exception 'MWContentSerializationException' when running core phpunit tests, with wikibase repo installed.Aug 14 2015, 9:18 AM

Change 231501 had a related patch set uploaded (by Aude):
Skip adding wikitext test pages in PrefixSearchTest if NS_MAIN is not wikitext

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

aude claimed this task.Aug 14 2015, 9:36 AM
aude moved this task from Backlog to Review on the Wikidata-Sprint-2015-08-11 board.

Change 231501 merged by jenkins-bot:
Skip adding wikitext test pages in PrefixSearchTest if NS_MAIN is not wikitext

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

Addshore closed this task as Resolved.Aug 20 2015, 5:51 PM
Addshore moved this task from Review to Done on the Wikidata-Sprint-2015-08-18 board.