Page MenuHomePhabricator

scap update-interwiki-cache throws MWException: Setting $wgInterwikiCache to a CDB path is no longer supported
Closed, ResolvedPublic

Description

I wanted to update interwiki cache via scap update-interwiki-cache earlier today, and the following happened:

[urbanecm@deploy1002 /srv/mediawiki-staging (master u=)]$ scap update-interwiki-cache
[3e3d14c95a4919d9674b2d7a] [no req]   MWException: Setting $wgInterwikiCache to a CDB path is no longer supported
Backtrace:
from /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/interwiki/ClassicInterwikiLookup.php(130)
#0 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/ServiceWiring.php(724): MediaWiki\Interwiki\ClassicInterwikiLookup->__construct(Language, WANObjectCache, MediaWiki\HookContainer\HookContainer, Wikimedia\Rdbms\LoadBalancer, integer, integer, integer, string)
#1 /srv/mediawiki-staging/php-1.39.0-wmf.3/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer::{closure}(MediaWiki\MediaWikiServices)
#2 /srv/mediawiki-staging/php-1.39.0-wmf.3/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService(string)
#3 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/MediaWikiServices.php(294): Wikimedia\Services\ServiceContainer->getService(string)                                   #4 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/MediaWikiServices.php(1048): MediaWiki\MediaWikiServices->getService(string)
#5 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/ServiceWiring.php(2046): MediaWiki\MediaWikiServices->getInterwikiLookup()
#6 /srv/mediawiki-staging/php-1.39.0-wmf.3/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer::{closure}(MediaWiki\MediaWikiServices)
#7 /srv/mediawiki-staging/php-1.39.0-wmf.3/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService(string)
#8 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/MediaWikiServices.php(294): Wikimedia\Services\ServiceContainer->getService(string)
#9 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/ServiceWiring.php(1772): MediaWiki\MediaWikiServices->getService(string)
#10 /srv/mediawiki-staging/php-1.39.0-wmf.3/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer::{closure}(MediaWiki\MediaWikiServices)
#11 /srv/mediawiki-staging/php-1.39.0-wmf.3/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService(string)
#12 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/MediaWikiServices.php(294): Wikimedia\Services\ServiceContainer->getService(string)
#13 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/MediaWikiServices.php(1719): MediaWiki\MediaWikiServices->getService(string)
#14 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/ServiceWiring.php(1868): MediaWiki\MediaWikiServices->getTitleParser()
#15 /srv/mediawiki-staging/php-1.39.0-wmf.3/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer::{closure}(MediaWiki\MediaWikiServices)
#16 /srv/mediawiki-staging/php-1.39.0-wmf.3/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService(string)
#17 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/MediaWikiServices.php(294): Wikimedia\Services\ServiceContainer->getService(string)
#18 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/MediaWikiServices.php(1815): MediaWiki\MediaWikiServices->getService(string)
#19 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/session/SessionManager.php(233): MediaWiki\MediaWikiServices->getUserNameUtils()
#20 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/session/SessionManager.php(138): MediaWiki\Session\SessionManager->__construct()
#21 /srv/mediawiki-staging/php-1.39.0-wmf.3/includes/Setup.php(918): MediaWiki\Session\SessionManager::singleton()
#22 /srv/mediawiki-staging/php-1.39.0-wmf.3/maintenance/doMaintenance.php(96): require_once(string)
#23 /srv/mediawiki-staging/php-1.39.0-wmf.3/extensions/WikimediaMaintenance/dumpInterwiki.php(543): require_once(string)
#24 /srv/mediawiki-staging/multiversion/MWScript.php(116): require_once(string)
#25 {main}
15:28:05 Unhandled error:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/scap/cli.py", line 392, in run
    exit_status = app.main(app.extra_arguments)
  File "/usr/lib/python3/dist-packages/scap/plugins/updateinterwikicache.py", line 32, in main
    stdout=outfile,
  File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/bin/mwscript', 'extensions/WikimediaMaintenance/dumpInterwiki.php']' returned non-zero exit status 255.
15:28:05 update-interwiki-cache failed: <CalledProcessError> Command '['/usr/local/bin/mwscript', 'extensions/WikimediaMaintenance/dumpInterwiki.php']' returned non-zero exit status 255.
[urbanecm@deploy1002 /srv/mediawiki-staging (master * u=)]$

Surprisingly, running dumpInterwiki.php manually works fine:

[urbanecm@deploy1002 /srv/mediawiki-staging (master u=)]$ /usr/local/bin/mwscript extensions/WikimediaMaintenance/dumpInterwiki.php > /dev/null
[urbanecm@deploy1002 /srv/mediawiki-staging (master u=)]$

Looks like a scap issue to me now.

Related Objects

Event Timeline

The exception is from the constructor of ClassicInterwikiLookup (includes/interwiki/ClassicInterwikiLookup.php). It occurs if $interwikiData (the 6th argument to the constructor) is not an array.

if ( is_array( $interwikiData ) ) {
    $this->data = $interwikiData;
} elseif ( $interwikiData ) {
    throw new MWException(
        'Setting $wgInterwikiCache to a CDB path is no longer supported' );
}

Debugging in train-dev shows that $interwikiData has the value of 1.

'InterwikiLookup' => static function ( MediaWikiServices $services ): InterwikiLookup {
    $config = $services->getMainConfig();
    return new ClassicInterwikiLookup(
        $services->getContentLanguage(),
        $services->getMainWANObjectCache(),
        $services->getHookContainer(),
        $services->getDBLoadBalancer(),
        $config->get( 'InterwikiExpiry' ),
        $config->get( 'InterwikiCache' ),    <<<<<<<<<<<
        $config->get( 'InterwikiScopes' ),
        $config->get( 'InterwikiFallbackSite' )
    );
},

Noting for the record that scap update-interwiki-cache simply calls /usr/local/bin/mwscript extensions/WikimediaMaintenance/dumpInterwiki.php.

Noting for the record that scap update-interwiki-cache simply calls /usr/local/bin/mwscript extensions/WikimediaMaintenance/dumpInterwiki.php.

The weird thing (and reason why I feel this is an issue within scap) is that /usr/local/bin/mwscript extensions/WikimediaMaintenance/dumpInterwiki.php works just fine, but the scap command (which should be a wrapper about the MW script, as you say) doesn't.

Suggestion: In order to make things work for the new wikis, run /usr/local/bin/mwscript extensions/WikimediaMaintenance/dumpInterwiki.php and commit the output to the php file manually for now and fix this before the next wiki creations.

Suggestion: In order to make things work for the new wikis, run /usr/local/bin/mwscript extensions/WikimediaMaintenance/dumpInterwiki.php and commit the output to the php file manually for now and fix this before the next wiki creations.

Good idea. Did that.

Change 778318 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[mediawiki/tools/scap@master] scap update-interwiki-cache: Don't overwrite interwiki.php in place

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

Change 778318 merged by jenkins-bot:

[mediawiki/tools/scap@master] scap update-interwiki-cache: Don't overwrite interwiki.php in place

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

dancy claimed this task.

This is resolved as of scap 4.7.1.