Page MenuHomePhabricator

UserOptionsManager: Argument 1 passed to MediaWiki\User\UserOptionsManager::setOption() must implement interface MediaWiki\User\UserIdentity, null given
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.34

message
Argument 1 passed to MediaWiki\User\UserOptionsManager::setOption() must implement interface MediaWiki\User\UserIdentity, null given, called in /srv/mediawiki/php-1.36.0-wmf.34/extensions/MobileFrontend/includes/specials/SpecialMobileOptions.php on line 333

Impact

Unclear. Wasn't able to reproduce trivially.

Notes

35 of these for 1.36.0-wmf.34 (T274938), mostly since deploy to all wikis.

Details

Request ID
YEpUB8-0V7guOs9y9gacowAAAMk
Request URL
https://commons.wikimedia.org/wiki/Special:MobileOptions
Stack Trace
exception.trace
from /srv/mediawiki/php-1.36.0-wmf.34/includes/user/UserOptionsManager.php(183)
#0 /srv/mediawiki/php-1.36.0-wmf.34/extensions/MobileFrontend/includes/specials/SpecialMobileOptions.php(333): MediaWiki\User\UserOptionsManager->setOption(NULL, string, string)
#1 /srv/mediawiki/php-1.36.0-wmf.34/includes/deferred/MWCallableUpdate.php(38): SpecialMobileOptions->{closure}()
#2 /srv/mediawiki/php-1.36.0-wmf.34/includes/deferred/DeferredUpdates.php(513): MWCallableUpdate->doUpdate()
#3 /srv/mediawiki/php-1.36.0-wmf.34/includes/deferred/DeferredUpdates.php(390): DeferredUpdates::attemptUpdate(MWCallableUpdate, Wikimedia\Rdbms\LBFactoryMulti)
#4 /srv/mediawiki/php-1.36.0-wmf.34/includes/deferred/DeferredUpdates.php(221): DeferredUpdates::run(MWCallableUpdate, Wikimedia\Rdbms\LBFactoryMulti, Monolog\Logger, BufferingStatsdDataFactory, string)
#5 /srv/mediawiki/php-1.36.0-wmf.34/includes/deferred/DeferredUpdatesScope.php(267): DeferredUpdates::{closure}(MWCallableUpdate, integer)
#6 /srv/mediawiki/php-1.36.0-wmf.34/includes/deferred/DeferredUpdatesScope.php(196): DeferredUpdatesScope->processStageQueue(integer, integer, Closure)
#7 /srv/mediawiki/php-1.36.0-wmf.34/includes/deferred/DeferredUpdates.php(242): DeferredUpdatesScope->processUpdates(integer, Closure)
#8 /srv/mediawiki/php-1.36.0-wmf.34/includes/MediaWiki.php(685): DeferredUpdates::doUpdates(string, integer)
#9 /srv/mediawiki/php-1.36.0-wmf.34/includes/MediaWiki.php(650): MediaWiki::preOutputCommit(RequestContext, Closure)
#10 /srv/mediawiki/php-1.36.0-wmf.34/includes/MediaWiki.php(940): MediaWiki->doPreOutputCommit(Closure)
#11 /srv/mediawiki/php-1.36.0-wmf.34/includes/MediaWiki.php(547): MediaWiki->main()
#12 /srv/mediawiki/php-1.36.0-wmf.34/index.php(53): MediaWiki->run()
#13 /srv/mediawiki/php-1.36.0-wmf.34/index.php(46): wfIndexMain()
#14 /srv/mediawiki/w/index.php(3): require(string)
#15 {main}

Event Timeline

Mentioned in SAL (#wikimedia-operations) [2021-03-11T21:20:25Z] <brennen> train status: 1.36.0-wmf.34 (T274938): rolling back to group1 and marking T277229 a train blocker

See T218835: prefUpdate schema contains multiple identical events for the same preference update and edd9d1ad24d07023de95585b9373398eaf07c477

Caused by User::getInstanceForUpdate returning null, meaning that either the user is anon (shouldn't be the issue here) or the loading from the database failed.

Change 670958 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/extensions/MobileFrontend@master] SpecialMobileOptions: Do not try to save options if getInstanceForUpdate returns null

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

Change 670876 had a related patch set uploaded (by Jdlrobson; owner: Mholloway):
[mediawiki/extensions/MobileFrontend@master] Revert "Fix: Save user options only once when Advanced Mode is toggled"

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

Change 670958 abandoned by Urbanecm:
[mediawiki/extensions/MobileFrontend@master] SpecialMobileOptions: Do not try to save options if getInstanceForUpdate returns null

Reason:

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

Mentioned in SAL (#wikimedia-operations) [2021-03-11T22:30:51Z] <brennen@deploy1002> Synchronized php-1.36.0-wmf.34/extensions/MobileFrontend/includes/: Backport: [[gerrit:670877|Revert "Fix: Save user options only once when Advanced Mode is toggled" (T277229)]] (duration: 01m 09s)

Change 670876 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Revert "Fix: Save user options only once when Advanced Mode is toggled"

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

I'm seeing a lot of this in the logs, too, and it doesn't make any sense to me, because the patch updates both signatures:

Declaration of MobileFrontend\Amc\UserMode::setEnabled(bool $isEnabled) must be compatible with MobileFrontend\Features\IUserSelectableMode::setEnabled($isEnabled)
#0 /srv/mediawiki/php-1.36.0-wmf.34/extensions/MobileFrontend/includes/Amc/UserMode.php(12): unknown()
#1 /srv/mediawiki/php-1.36.0-wmf.34/includes/AutoLoader.php(111): require()
#2 [internal function]: AutoLoader::autoload()
#3 /srv/mediawiki/php-1.36.0-wmf.34/extensions/MobileFrontend/includes/Amc/Hooks.php(36): spl_autoload_call()
#4 /srv/mediawiki/php-1.36.0-wmf.34/includes/HookContainer/HookContainer.php(333): MobileFrontend\Amc\Hooks::onUserGetDefaultOptions()
#5 /srv/mediawiki/php-1.36.0-wmf.34/includes/HookContainer/HookContainer.php(140): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#6 /srv/mediawiki/php-1.36.0-wmf.34/includes/HookContainer/HookRunner.php(4268): MediaWiki\HookContainer\HookContainer->run()
#7 /srv/mediawiki/php-1.36.0-wmf.34/includes/user/DefaultOptionsLookup.php(102): MediaWiki\HookContainer\HookRunner->onUserGetDefaultOptions()
#8 /srv/mediawiki/php-1.36.0-wmf.34/includes/user/UserOptionsManager.php(497): MediaWiki\User\DefaultOptionsLookup->getDefaultOptions()
#9 /srv/mediawiki/php-1.36.0-wmf.34/includes/user/UserOptionsManager.php(138): MediaWiki\User\UserOptionsManager->loadUserOptions()
#10 /srv/mediawiki/php-1.36.0-wmf.34/includes/user/UserOptionsLookup.php(123): MediaWiki\User\UserOptionsManager->getOption()
#11 /srv/mediawiki/php-1.36.0-wmf.34/includes/user/User.php(2706): MediaWiki\User\UserOptionsLookup->getIntOption()
#12 /srv/mediawiki/php-1.36.0-wmf.34/includes/user/User.php(2898): User->getIntOption()
#13 /srv/mediawiki/php-1.36.0-wmf.34/includes/linker/LinkRendererFactory.php(99): User->getStubThreshold()
#14 /srv/mediawiki/php-1.36.0-wmf.34/includes/ServiceWiring.php(658): MediaWiki\Linker\LinkRendererFactory->createForUser()
#15 /srv/mediawiki/php-1.36.0-wmf.34/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer::{closure}()
#16 /srv/mediawiki/php-1.36.0-wmf.34/vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService()
#17 /srv/mediawiki/php-1.36.0-wmf.34/includes/MediaWikiServices.php(261): Wikimedia\Services\ServiceContainer->getService()
#18 /srv/mediawiki/php-1.36.0-wmf.34/includes/MediaWikiServices.php(970): MediaWiki\MediaWikiServices->getService()
#19 /srv/mediawiki/php-1.36.0-wmf.34/includes/page/Article.php(123): MediaWiki\MediaWikiServices->getLinkRenderer()
#20 /srv/mediawiki/php-1.36.0-wmf.34/includes/page/Article.php(169): Article->__construct()
#21 /srv/mediawiki/php-1.36.0-wmf.34/includes/page/Article.php(185): Article::newFromTitle()
#22 /srv/mediawiki/php-1.36.0-wmf.34/includes/actions/Action.php(188): Article::newFromWikiPage()
#23 /srv/mediawiki/php-1.36.0-wmf.34/includes/MediaWiki.php(168): Action::getActionName()
#24 /srv/mediawiki/php-1.36.0-wmf.34/includes/MediaWiki.php(888): MediaWiki->getAction()
#25 /srv/mediawiki/php-1.36.0-wmf.34/includes/MediaWiki.php(547): MediaWiki->main()
#26 /srv/mediawiki/php-1.36.0-wmf.34/index.php(53): MediaWiki->run()
#27 /srv/mediawiki/php-1.36.0-wmf.34/index.php(46): wfIndexMain()
#28 /srv/mediawiki/w/index.php(3): require()

I'm seeing a lot of this in the logs, too, and it doesn't make any sense to me, because the patch updates both signatures

Unless it's still happening, I have a feeling this is an artifact of my syncing multiple files for the revert.

Ah, sorry, not happening anymore. Looks like this was only occurring for a brief window at 22:30.

brennen claimed this task.