Page MenuHomePhabricator

Cognate broken in addWiki.php
Closed, ResolvedPublic

Description

Broke while doing T173643: Create Wiktionary Fiji Hindi

Getting sites.
Got 172 sites.
Inserting sites.
[c97ad8d44ce946d66c760e26] [no req]   MediaWiki\Services\NoSuchServiceException from line 364 of /srv/mediawiki/php-1.31.0-wmf.6/includes/services/ServiceContainer.php: No such service: CognateStore
Backtrace:
#0 /srv/mediawiki/php-1.31.0-wmf.6/includes/services/ServiceContainer.php(344): MediaWiki\Services\ServiceContainer->createService(string)
#1 /srv/mediawiki/php-1.31.0-wmf.6/extensions/Cognate/maintenance/populateCognateSites.php(46): MediaWiki\Services\ServiceContainer->getService(string)
#2 /srv/mediawiki/php-1.31.0-wmf.6/extensions/WikimediaMaintenance/addWiki.php(251): Cognate\PopulateCognateSites->execute()
#3 /srv/mediawiki/php-1.31.0-wmf.6/maintenance/doMaintenance.php(95): AddWiki->execute()
#4 /srv/mediawiki/php-1.31.0-wmf.6/extensions/WikimediaMaintenance/addWiki.php(365): require_once(string)
#5 /srv/mediawiki/multiversion/MWScript.php(99): require_once(string)
#6 {main}

Event Timeline

Reedy created this task.Nov 6 2017, 8:27 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 6 2017, 8:27 PM
Reedy updated the task description. (Show Details)Nov 6 2017, 8:33 PM

So the check is:

$site === 'wiktionary'

then run populateCognateSites.php

But it would seem that Cognate is not actually loaded as an extension for the wiki being created, hence the error.

However in InitialiseSettings.php

'wmgUseCognate' => [
	'default' => false,
	'wiktionary' => 'wiktionary', // T150182
],

I guess something here doesn't work as I expect?

Reedy added a comment.Nov 7 2017, 4:09 PM

Because we run the script as aawiki

Because we run the script as aawiki

Could we run it for wiktionaries as aawiktionary?

An alternative would be load the extension within this script?

Reedy added a comment.Nov 9 2017, 1:57 PM

An alternative would be load the extension within this script?

We can't really. Unless we copy pasta the config from CommonSettings for the extension too (and then risk it getting out of sync), we can't

Then I guess the only solution is to run it as aawiktionary? or any other wiktionary, so that the correct set of code will be loaded?

Reedy added a comment.Nov 9 2017, 2:11 PM

That, or run it as a separate script after

That, or run it as a separate script after

I would be pro keeping it in this script.
We could always add a check to the start

if ( $site === 'wiktionary' && currentWikiNotAWiktionary ){
    die( 'if you are trying to create a wiktionary please use aawiktionary as the wiki?' )
}

Change 391271 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/WikimediaMaintenance@master] Error if wiktionary creation attempted without using aawiktionary

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

Addshore moved this task from Back Burner 🏛️ to Active 🚁 on the User-Addshore board.
Addshore triaged this task as Normal priority.Jan 12 2018, 12:05 PM

Change 391271 merged by jenkins-bot:
[mediawiki/extensions/WikimediaMaintenance@master] Error if wiktionary creation attempted without using aawiktionary

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

Addshore closed this task as Resolved.Jan 24 2018, 11:03 PM