Page MenuHomePhabricator

refreshLinks.php batch job fails when encountering an unregistered content model
Open, Needs TriagePublic

Description

refreshLinks.php seems to fail out with an exception when encountering a page with an unregistered content model. (Found while running maint scripts on my local Vagrant install after having used an old version of the the tabular JSON data stuff in the past and later removing it.)

A batch job like this should probably catch/log the exception and skip on to the next page.

[dcd9bbf15bff646b39985ce4] [no req]   MWUnknownContentModelException from line 356 of /vagrant/mediawiki/includes/content/ContentHandler.php: The content model 'Tabular.JsonConfig' is not registered on this wiki.
See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions handle this content model.
Backtrace:
#0 /vagrant/mediawiki/includes/content/ContentHandler.php(293): ContentHandler::getForModelID(string)
#1 /vagrant/mediawiki/includes/Title.php(4656): ContentHandler::getForTitle(Title)
#2 /vagrant/mediawiki/includes/parser/Parser.php(852): Title->getPageLanguage()
#3 /vagrant/mediawiki/includes/parser/Parser.php(2091): Parser->getTargetLanguage()
#4 /vagrant/mediawiki/includes/parser/Parser.php(2056): Parser->replaceInternalLinks2(string)
#5 /vagrant/mediawiki/includes/parser/Parser.php(1275): Parser->replaceInternalLinks(string)
#6 /vagrant/mediawiki/includes/parser/Parser.php(440): Parser->internalParse(string)
#7 /vagrant/mediawiki/includes/content/WikitextContent.php(330): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#8 /vagrant/mediawiki/includes/content/AbstractContent.php(497): WikitextContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)
#9 /vagrant/mediawiki/includes/content/AbstractContent.php(230): AbstractContent->getParserOutput(Title, NULL, NULL, boolean)
#10 /vagrant/mediawiki/maintenance/refreshLinks.php(264): AbstractContent->getSecondaryDataUpdates(Title)
#11 /vagrant/mediawiki/maintenance/refreshLinks.php(186): RefreshLinks::fixLinksFromArticle(integer, boolean)
#12 /vagrant/mediawiki/maintenance/refreshLinks.php(68): RefreshLinks->doRefreshLinks(NULL, boolean, NULL, boolean, boolean)
#13 /vagrant/mediawiki/maintenance/doMaintenance.php(110): RefreshLinks->execute()
#14 /vagrant/mediawiki/maintenance/refreshLinks.php(397): require_once(string)
#15 /var/www/w/MWScript.php(95): require_once(string)
#16 {main}

Event Timeline

Have you found any solution to the problem?
I have a similar problem:

MWUnknownContentModelException from line 306 of /var/www/html/includes/content/ContentHandler.php: The content model 'proofread-page' is not registered on this wiki.
See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions handle this content model.
Backtrace:
#0 /var/www/html/includes/content/ContentHandler.php(243): ContentHandler::getForModelID(string)
#1 /var/www/html/includes/Title.php(4746): ContentHandler::getForTitle(Title)
#2 /var/www/html/includes/parser/Parser.php(895): Title->getPageLanguage()
#3 /var/www/html/includes/parser/Parser.php(2129): Parser->getTargetLanguage()
#4 /var/www/html/includes/parser/Parser.php(2094): Parser->replaceInternalLinks2(string)
#5 /var/www/html/includes/parser/Parser.php(1322): Parser->replaceInternalLinks(string)
#6 /var/www/html/includes/parser/Parser.php(451): Parser->internalParse(string)
#7 /var/www/html/includes/content/WikitextContent.php(330): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#8 /var/www/html/includes/content/AbstractContent.php(497): WikitextContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)
#9 /var/www/html/includes/content/AbstractContent.php(230): AbstractContent->getParserOutput(Title, NULL, ParserOptions, boolean)
#10 /var/www/html/maintenance/refreshLinks.php(278): AbstractContent->getSecondaryDataUpdates(Title, NULL, boolean)
#11 /var/www/html/maintenance/refreshLinks.php(199): RefreshLinks::fixLinksFromArticle(integer, boolean)
#12 /var/www/html/maintenance/refreshLinks.php(82): RefreshLinks->doRefreshLinks(integer, boolean, string, boolean, boolean)
#13 /var/www/html/maintenance/doMaintenance.php(111): RefreshLinks->execute()
#14 /var/www/html/maintenance/refreshLinks.php(495): require_once(string)
#15 {main}