Page MenuHomePhabricator

The content model 'proofread-page' is not registered on this wiki.
Closed, InvalidPublic

Description

When I run refreshLinks.php, I constantly get following error message

[84df081f98fd28079f36f0b3] [no req]   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}

I think I have done everything that installation guide say. The extension is working as expected, and I have created multiple pages in the Page and Index namespace. I have run update.php, but it do not solve the problem.

Event Timeline

When I try to run runJobs.php, I get following error (maybe related to the issue)

refreshLinks File:Foo.pdf pages={"8890":[250,"Foo.pdf/1"]} rootJobSignature=70e50f9e487055cada968854364a8a924dbd69cb rootJobTimestamp=20171024073451 triggeredRecursive=1 requestId=41bb174db0884c348a066011 (id=37819,timestamp=20171024073455) STARTING
[41bb174db0884c348a066011] [no req]   TypeError from line 132 of /var/www/html/includes/jobqueue/jobs/RefreshLinksJob.php: Argument 1 passed to RefreshLinksJob::runForTitle() must be an instance of Title, null given, called in /var/www/html/includes/jobqueue/jobs/RefreshLinksJob.php on line 118
Backtrace:
#0 /var/www/html/includes/jobqueue/jobs/RefreshLinksJob.php(118): RefreshLinksJob->runForTitle(NULL)
#1 /var/www/html/includes/jobqueue/JobRunner.php(289): RefreshLinksJob->run()
#2 /var/www/html/includes/jobqueue/JobRunner.php(189): JobRunner->executeJob(RefreshLinksJob, Wikimedia\Rdbms\LBFactorySimple, BufferingStatsdDataFactory, in
teger)
#3 /var/www/html/maintenance/runJobs.php(86): JobRunner->run(array)
#4 /var/www/html/maintenance/doMaintenance.php(111): RunJobs->execute()
#5 /var/www/html/maintenance/runJobs.php(119): require_once(string)
#6 {main}

I have debug the php scripts, and found out following:

  • RefreshLinksJob.php(118): Title::makeTitleSafe( 252, $dbKey ) returns null
    • Title.php(539): MWNamespace::exists( 252 ) returns false
      • MWNamespace.php(213): ExtensionRegistry::getInstance()->getAttribute( 'ExtensionNamespaces' ) returns a empty array

It seems that the ProofreadPage extension is not properly loaded when you run scripts. Are you sure that the scripts or your maintainance directory are loading the right LocalSettings.php?

I only have one LocalSettings.php. I did now try to run refreshLinks.php with parameter --conf to specify the LocalSettings.php, but it was no difference.

I was somewhat unclear in the description.
refreshLinks.php runs for several minutes and do updates for most pages. But when it comes to a page with proofread-page, an exception is thrown.

For runJobs.php, it runs jobs for each page until it try to do it for a page in namespace 252.

This comment was removed by Magol.

I am not sure of what is the root cause of this error.
To help to investigate, which MediaWiki version are you using? Are you using the latest code of ProofreadPage?
Due to workload constraint (this extension is maintained only on volunteer time) we do not take careful care of compatibility with MediaWiki stable versions.

I have found out that the issue was due to a silly configuration error from my side :-(
I'm sorry for bother you.

Here's what I did wrong (if any one else have the same problem)

In my LocalSettings.php, I have following code to load more configuration files (Eg. settings for ProofreadPage):

foreach (glob(settings.d/*.php") as $filename)
{
    include $filename;
}

This works fine when scripts are run from the web root. But when I run from maintenance directory, the relative path are pointing to the wrong place.
To fix this, I change it to following:

foreach (glob($IP."/settings.d/*.php") as $filename)
{
    include $filename;
}
Magol claimed this task.