Page MenuHomePhabricator

Premature access to service container during installation
Closed, ResolvedPublic

Description

When visiting a wiki before LocalSettings.php is created, the initial page has a bunch of errors on it about "Premature access to service container".

Deprecated: Premature access to service container [Called from ObjectCache::getLocalServerInstance in C:\www\mediawiki\includes\objectcache\ObjectCache.php at line 255] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'HookContainer' [Called from MediaWiki\MediaWikiServices::getInstance in C:\www\mediawiki\includes\MediaWikiServices.php at line 250] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'ObjectFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in C:\www\mediawiki\includes\ServiceWiring.php at line 533] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'LocalServerObjectCache' [Called from ObjectCache::getLocalServerInstance in C:\www\mediawiki\includes\objectcache\ObjectCache.php at line 255] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'StatsdDataFactory' [Called from ObjectCache::newFromParams in C:\www\mediawiki\includes\objectcache\ObjectCache.php at line 149] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'MainConfig' [Called from Wikimedia\Services\ServiceContainer::{closure} in C:\www\mediawiki\includes\ServiceWiring.php at line 1398] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'ConfigFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in C:\www\mediawiki\includes\ServiceWiring.php at line 732] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'BootstrapConfig' [Called from Wikimedia\Services\ServiceContainer::{closure} in C:\www\mediawiki\includes\ServiceWiring.php at line 275] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'DBLoadBalancer' [Called from ObjectCache::{closure} in C:\www\mediawiki\includes\objectcache\ObjectCache.php at line 181] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'DBLoadBalancerFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in C:\www\mediawiki\includes\ServiceWiring.php at line 381] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'MainWANObjectCache' [Called from Wikimedia\Services\ServiceContainer::{closure} in C:\www\mediawiki\includes\ServiceWiring.php at line 404] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376
Deprecated: Premature access to service 'ConfiguredReadOnlyMode' [Called from Wikimedia\Services\ServiceContainer::{closure} in C:\www\mediawiki\includes\ServiceWiring.php at line 418] in C:\www\mediawiki\includes\debug\MWDebug.php on line 376

Event Timeline

Change 673810 had a related patch set uploaded (by BrandonXLF; owner: BrandonXLF):
[mediawiki/core@master] Allow global instance when there's no local settings

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

Ammarpad renamed this task from Premature access to service container on wiki without LocalSettings.php to Premature access to service container during installation.Jun 11 2021, 8:14 AM
Ammarpad added a subscriber: Ammarpad.

This basically happens during fresh installation and is really not looking good.

I also faced this issue recently and found that ignoring the issue is the solution for now! (https://www.mediawiki.org/wiki/Topic:Wajxsp05c7gsnf6r)

Change 736536 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] NoLocalSettings: Pass an EmptyBagOStuff to TemplateParser

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

Change 736536 merged by jenkins-bot:

[mediawiki/core@master] NoLocalSettings: Pass an EmptyBagOStuff to TemplateParser

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

Change 736513 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_37] NoLocalSettings: Pass an EmptyBagOStuff to TemplateParser

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

Change 736514 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_36] NoLocalSettings: Pass an EmptyBagOStuff to TemplateParser

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

Change 736515 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_35] NoLocalSettings: Pass an EmptyBagOStuff to TemplateParser

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

Change 736514 merged by jenkins-bot:

[mediawiki/core@REL1_36] NoLocalSettings: Pass an EmptyBagOStuff to TemplateParser

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

Change 736513 merged by jenkins-bot:

[mediawiki/core@REL1_37] NoLocalSettings: Pass an EmptyBagOStuff to TemplateParser

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

Change 736515 abandoned by Reedy:

[mediawiki/core@REL1_35] NoLocalSettings: Pass an EmptyBagOStuff to TemplateParser

Reason:

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

Reedy claimed this task.

Change 673810 abandoned by Ppchelko:

[mediawiki/core@master] Allow MediaWikiServices when there's no local settings

Reason:

Issue fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/736536

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

I installed a fresh copy of mediawiki tonight by cloning the GitHub repository. Still getting Premature access to service container warnings on the index page with a fresh install. Perhaps an additional patch is needed? Hope this helps.

Deprecated: Premature access to service container [Called from TemplateParser::getTemplate in F:\Dropbox\Code\MediaWiki\mediawiki\includes\TemplateParser.php at line 115] in F:\Dropbox\Code\MediaWiki\mediawiki\includes\debug\MWDebug.php on line 377

Deprecated: Premature access to service 'HookContainer' [Called from MediaWiki\MediaWikiServices::getInstance in F:\Dropbox\Code\MediaWiki\mediawiki\includes\MediaWikiServices.php at line 277] in F:\Dropbox\Code\MediaWiki\mediawiki\includes\debug\MWDebug.php on line 377

Deprecated: Premature access to service 'ObjectFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in F:\Dropbox\Code\MediaWiki\mediawiki\includes\ServiceWiring.php at line 675] in F:\Dropbox\Code\MediaWiki\mediawiki\includes\debug\MWDebug.php on line 377

Deprecated: Premature access to service 'MainConfig' [Called from TemplateParser::getTemplate in F:\Dropbox\Code\MediaWiki\mediawiki\includes\TemplateParser.php at line 115] in F:\Dropbox\Code\MediaWiki\mediawiki\includes\debug\MWDebug.php on line 377

Deprecated: Premature access to service 'ConfigFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in F:\Dropbox\Code\MediaWiki\mediawiki\includes\ServiceWiring.php at line 883] in F:\Dropbox\Code\MediaWiki\mediawiki\includes\debug\MWDebug.php on line 377

Deprecated: Premature access to service 'BootstrapConfig' [Called from Wikimedia\Services\ServiceContainer::{closure} in F:\Dropbox\Code\MediaWiki\mediawiki\includes\ServiceWiring.php at line 380] in F:\Dropbox\Code\MediaWiki\mediawiki\includes\debug\MWDebug.php on line 377

Windows 10
MediaWiki 1.38.0-alpha
PHP 7.4.25