User::loadFromSession called before the end of Setup.php
There are a few such errors, the one investigated was on wikidatawiki and the request sequence is roughly:
authentication | MediaWiki\Auth\AuthManager::autoCreateUser: creating new user XXX |
preferences | Couldn't find a global ID for user XXX |
CentralAuth | Attaching local user XXX@wikidatawiki by 'login' |
preferences | Couldn't find a global ID for user XXX |
session | multiples User::loadFromSession called before the end of Setup.php |
preferences | Couldn't find a global ID for user XXX |
session | Persisting session for unknown reason |
authevents | Autocreation attempt |
The five User::loadFromSession called before the end of Setup.php come when saving the UserOptions which triggers a BetaFeatures job to update the features usage counts. The job is passed Title::newMainPage() which loads a Language and the User while in Setup.php.
The traces from first to last:
#0 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2024): User->load() #1 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2963): User->getId() #2 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(587): User->isRegistered() #3 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(490): MediaWiki\User\UserOptionsManager->getCacheKey(User) #4 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(138): MediaWiki\User\UserOptionsManager->loadUserOptions(User, integer) #5 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2564): MediaWiki\User\UserOptionsManager->getOption(User, string, NULL, boolean) #6 /srv/mediawiki/php-1.36.0-wmf.10/includes/context/RequestContext.php(351): User->getOption(string) #7 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(391): RequestContext->getLanguage() #8 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(1291): Message->getLanguage() #9 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(849): Message->fetchMessage() #10 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(941): Message->toString(string) #11 /srv/mediawiki/php-1.36.0-wmf.10/includes/Title.php(660): Message->text() #12 /srv/mediawiki/php-1.36.0-wmf.10/extensions/BetaFeatures/includes/BetaFeaturesHooks.php(93): Title::newMainPage() #13 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(331): BetaFeaturesHooks::updateUserCounts(User, array, array) #14 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(138): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array) #15 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookRunner.php(4450): MediaWiki\HookContainer\HookContainer->run(string, array) #16 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(397): MediaWiki\HookContainer\HookRunner->onUserSaveOptions(User, array, array) #17 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(3401): MediaWiki\User\UserOptionsManager->saveOptions(User) #18 /srv/mediawiki/php-1.36.0-wmf.10/includes/auth/AuthManager.php(1767): User->saveSettings() #19 /srv/mediawiki/php-1.36.0-wmf.10/includes/Setup.php(812): MediaWiki\Auth\AuthManager->autoCreateUser(User, string, boolean) #20 /srv/mediawiki/php-1.36.0-wmf.10/includes/WebStart.php(89): require_once(string) #21 /srv/mediawiki/php-1.36.0-wmf.10/api.php(43): require(string) #22 /srv/mediawiki/w/api.php(3): require(string) #23 {main}
#0 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2024): User->load() #1 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2963): User->getId() #2 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(499): User->isRegistered() #3 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(138): MediaWiki\User\UserOptionsManager->loadUserOptions(User, integer) #4 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2564): MediaWiki\User\UserOptionsManager->getOption(User, string, NULL, boolean) #5 /srv/mediawiki/php-1.36.0-wmf.10/includes/context/RequestContext.php(351): User->getOption(string) #6 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(391): RequestContext->getLanguage() #7 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(1291): Message->getLanguage() #8 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(849): Message->fetchMessage() #9 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(941): Message->toString(string) #10 /srv/mediawiki/php-1.36.0-wmf.10/includes/Title.php(660): Message->text() #11 /srv/mediawiki/php-1.36.0-wmf.10/extensions/BetaFeatures/includes/BetaFeaturesHooks.php(93): Title::newMainPage() #12 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(331): BetaFeaturesHooks::updateUserCounts(User, array, array) #13 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(138): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array) #14 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookRunner.php(4450): MediaWiki\HookContainer\HookContainer->run(string, array) #15 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(397): MediaWiki\HookContainer\HookRunner->onUserSaveOptions(User, array, array) #16 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(3401): MediaWiki\User\UserOptionsManager->saveOptions(User) #17 /srv/mediawiki/php-1.36.0-wmf.10/includes/auth/AuthManager.php(1767): User->saveSettings() #18 /srv/mediawiki/php-1.36.0-wmf.10/includes/Setup.php(812): MediaWiki\Auth\AuthManager->autoCreateUser(User, string, boolean) #19 /srv/mediawiki/php-1.36.0-wmf.10/includes/WebStart.php(89): require_once(string) #20 /srv/mediawiki/php-1.36.0-wmf.10/api.php(43): require(string) #21 /srv/mediawiki/w/api.php(3): require(string) #22 {main}
#0 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2024): User->load() #1 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2963): User->getId() #2 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(606): User->isRegistered() #3 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(491): MediaWiki\User\UserOptionsManager->canUseCachedValues(User, integer) #4 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(138): MediaWiki\User\UserOptionsManager->loadUserOptions(User, integer) #5 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2564): MediaWiki\User\UserOptionsManager->getOption(User, string, NULL, boolean) #6 /srv/mediawiki/php-1.36.0-wmf.10/includes/context/RequestContext.php(351): User->getOption(string) #7 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(391): RequestContext->getLanguage() #8 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(1291): Message->getLanguage() #9 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(849): Message->fetchMessage() #10 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(941): Message->toString(string) #11 /srv/mediawiki/php-1.36.0-wmf.10/includes/Title.php(660): Message->text() #12 /srv/mediawiki/php-1.36.0-wmf.10/extensions/BetaFeatures/includes/BetaFeaturesHooks.php(93): Title::newMainPage() #13 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(331): BetaFeaturesHooks::updateUserCounts(User, array, array) #14 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(138): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array) #15 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookRunner.php(4450): MediaWiki\HookContainer\HookContainer->run(string, array) #16 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(397): MediaWiki\HookContainer\HookRunner->onUserSaveOptions(User, array, array) #17 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(3401): MediaWiki\User\UserOptionsManager->saveOptions(User) #18 /srv/mediawiki/php-1.36.0-wmf.10/includes/auth/AuthManager.php(1767): User->saveSettings() #19 /srv/mediawiki/php-1.36.0-wmf.10/includes/Setup.php(812): MediaWiki\Auth\AuthManager->autoCreateUser(User, string, boolean) #20 /srv/mediawiki/php-1.36.0-wmf.10/includes/WebStart.php(89): require_once(string) #21 /srv/mediawiki/php-1.36.0-wmf.10/api.php(43): require(string) #22 /srv/mediawiki/w/api.php(3): require(string) #23 {main}
#0 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2024): User->load() #1 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2963): User->getId() #2 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2979): User->isRegistered() #3 /srv/mediawiki/php-1.36.0-wmf.10/extensions/UniversalLanguageSelector/includes/UniversalLanguageSelectorHooks.php(329): User->isAnon() #4 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(331): UniversalLanguageSelectorHooks::getLanguage(User, string, RequestContext) #5 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(138): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array) #6 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookRunner.php(4261): MediaWiki\HookContainer\HookContainer->run(string, array) #7 /srv/mediawiki/php-1.36.0-wmf.10/includes/context/RequestContext.php(367): MediaWiki\HookContainer\HookRunner->onUserGetLanguageObject(User, string, RequestContext) #8 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(391): RequestContext->getLanguage() #9 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(1291): Message->getLanguage() #10 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(849): Message->fetchMessage() #11 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(941): Message->toString(string) #12 /srv/mediawiki/php-1.36.0-wmf.10/includes/Title.php(660): Message->text() #13 /srv/mediawiki/php-1.36.0-wmf.10/extensions/BetaFeatures/includes/BetaFeaturesHooks.php(93): Title::newMainPage() #14 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(331): BetaFeaturesHooks::updateUserCounts(User, array, array) #15 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(138): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array) #16 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookRunner.php(4450): MediaWiki\HookContainer\HookContainer->run(string, array) #17 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(397): MediaWiki\HookContainer\HookRunner->onUserSaveOptions(User, array, array) #18 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(3401): MediaWiki\User\UserOptionsManager->saveOptions(User) #19 /srv/mediawiki/php-1.36.0-wmf.10/includes/auth/AuthManager.php(1767): User->saveSettings() #20 /srv/mediawiki/php-1.36.0-wmf.10/includes/Setup.php(812): MediaWiki\Auth\AuthManager->autoCreateUser(User, string, boolean) #21 /srv/mediawiki/php-1.36.0-wmf.10/includes/WebStart.php(89): require_once(string) #22 /srv/mediawiki/php-1.36.0-wmf.10/api.php(43): require(string) #23 /srv/mediawiki/w/api.php(3): require(string) #24 {main}
#0 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2049): User->load() #1 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(587): User->getName() #2 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(490): MediaWiki\User\UserOptionsManager->getCacheKey(User) #3 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(138): MediaWiki\User\UserOptionsManager->loadUserOptions(User, integer) #4 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(2564): MediaWiki\User\UserOptionsManager->getOption(User, string, NULL, boolean) #5 /srv/mediawiki/php-1.36.0-wmf.10/includes/context/RequestContext.php(351): User->getOption(string) #6 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(391): RequestContext->getLanguage() #7 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(1291): Message->getLanguage() #8 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(849): Message->fetchMessage() #9 /srv/mediawiki/php-1.36.0-wmf.10/includes/language/Message.php(941): Message->toString(string) #10 /srv/mediawiki/php-1.36.0-wmf.10/includes/Title.php(660): Message->text() #11 /srv/mediawiki/php-1.36.0-wmf.10/extensions/BetaFeatures/includes/BetaFeaturesHooks.php(93): Title::newMainPage() #12 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(331): BetaFeaturesHooks::updateUserCounts(User, array, array) #13 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookContainer.php(138): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array) #14 /srv/mediawiki/php-1.36.0-wmf.10/includes/HookContainer/HookRunner.php(4450): MediaWiki\HookContainer\HookContainer->run(string, array) #15 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/UserOptionsManager.php(397): MediaWiki\HookContainer\HookRunner->onUserSaveOptions(User, array, array) #16 /srv/mediawiki/php-1.36.0-wmf.10/includes/user/User.php(3401): MediaWiki\User\UserOptionsManager->saveOptions(User) #17 /srv/mediawiki/php-1.36.0-wmf.10/includes/auth/AuthManager.php(1767): User->saveSettings() #18 /srv/mediawiki/php-1.36.0-wmf.10/includes/Setup.php(812): MediaWiki\Auth\AuthManager->autoCreateUser(User, string, boolean) #19 /srv/mediawiki/php-1.36.0-wmf.10/includes/WebStart.php(89): require_once(string) #20 /srv/mediawiki/php-1.36.0-wmf.10/api.php(43): require(string) #21 /srv/mediawiki/w/api.php(3): require(string) #22 {main}
Impact
- Notes