Page MenuHomePhabricator

"BadMethodCallException: Sessions are disabled for this entry point" via GrowthExperiments
Closed, ResolvedPublic

Description

Error

MediaWiki version: 1.35.0-wmf.10

message
BadMethodCallException: Sessions are disabled for this entry point
at /srv/mediawiki/php-1.35.0-wmf.10/includes/session/SessionManager.php:826

Impact

Notes

Details

Request ID
XflCrwpAAEQAABw7C1cAAABW
Request URL
https://eu.wikipedia.org/w/opensearch_desc.php
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.10/includes/session/SessionManager.php(310): MediaWiki\Session\SessionManager->getSessionFromInfo(MediaWiki\Session\SessionInfo, WebRequest)
#1 /srv/mediawiki/php-1.35.0-wmf.10/includes/session/SessionManager.php(244): MediaWiki\Session\SessionManager->getEmptySessionInternal(WebRequest)
#2 /srv/mediawiki/php-1.35.0-wmf.10/includes/session/SessionManager.php(194): MediaWiki\Session\SessionManager->getEmptySession(WebRequest)
#3 /srv/mediawiki/php-1.35.0-wmf.10/includes/WebRequest.php(812): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)
#4 /srv/mediawiki/php-1.35.0-wmf.10/includes/user/User.php(1313): WebRequest->getSession()
#5 /srv/mediawiki/php-1.35.0-wmf.10/includes/user/User.php(392): User->loadFromSession()
#6 /srv/mediawiki/php-1.35.0-wmf.10/includes/user/User.php(5154): User->load()
#7 /srv/mediawiki/php-1.35.0-wmf.10/includes/user/User.php(2970): User->loadOptions()
#8 /srv/mediawiki/php-1.35.0-wmf.10/includes/user/User.php(3028): User->getOption(string)
#9 /srv/mediawiki/php-1.35.0-wmf.10/extensions/GrowthExperiments/includes/HomepageModules/SuggestedEdits.php(75): User->getBoolOption(string)
#10 /srv/mediawiki/php-1.35.0-wmf.10/extensions/GrowthExperiments/includes/HomepageHooks.php(64): GrowthExperiments\HomepageModules\SuggestedEdits::isEnabled(RequestContext)
#11 /srv/mediawiki/php-1.35.0-wmf.10/includes/Hooks.php(174): GrowthExperiments\HomepageHooks::onSpecialPageInitList(array)
#12 /srv/mediawiki/php-1.35.0-wmf.10/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#13 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPageFactory.php(324): Hooks::run(string, array)
#14 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPageFactory.php(340): MediaWiki\Special\SpecialPageFactory->getPageList()
#15 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPageFactory.php(698): MediaWiki\Special\SpecialPageFactory->getAliasList()
#16 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPage.php(100): MediaWiki\Special\SpecialPageFactory->getLocalNameFor(string, boolean)
#17 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPage.php(85): SpecialPage::getTitleValueFor(string, boolean, string)
#18 /srv/mediawiki/php-1.35.0-wmf.10/opensearch_desc.php(81): SpecialPage::getTitleFor(string)
#19 /srv/mediawiki/w/opensearch_desc.php(3): require(string)
#20 {main}

Event Timeline

Krinkle created this task.Dec 17 2019, 9:16 PM
Restricted Application added a project: Growth-Team. · View Herald TranscriptDec 17 2019, 9:16 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle triaged this task as Unbreak Now! priority.Dec 17 2019, 9:17 PM

Affects all requests to opensearch_desc.php and load.php?modules=startup requests on group0 wikis.

exception.trace from load.php
#0 /srv/mediawiki/php-1.35.0-wmf.10/includes/session/SessionManager.php(310): MediaWiki\Session\SessionManager->getSessionFromInfo(MediaWiki\Session\SessionInfo, WebRequest)
#1 /srv/mediawiki/php-1.35.0-wmf.10/includes/session/SessionManager.php(244): MediaWiki\Session\SessionManager->getEmptySessionInternal(WebRequest)
#2 /srv/mediawiki/php-1.35.0-wmf.10/includes/session/SessionManager.php(194): MediaWiki\Session\SessionManager->getEmptySession(WebRequest)
#3 /srv/mediawiki/php-1.35.0-wmf.10/includes/WebRequest.php(812): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)
#4 /srv/mediawiki/php-1.35.0-wmf.10/includes/user/User.php(1313): WebRequest->getSession()
#5 /srv/mediawiki/php-1.35.0-wmf.10/includes/user/User.php(392): User->loadFromSession()
#6 /srv/mediawiki/php-1.35.0-wmf.10/includes/user/User.php(5154): User->load()
#7 /srv/mediawiki/php-1.35.0-wmf.10/includes/user/User.php(2970): User->loadOptions()
#8 /srv/mediawiki/php-1.35.0-wmf.10/includes/user/User.php(3028): User->getOption(string)
#9 /srv/mediawiki/php-1.35.0-wmf.10/extensions/GrowthExperiments/includes/HomepageModules/SuggestedEdits.php(75): User->getBoolOption(string)
#10 /srv/mediawiki/php-1.35.0-wmf.10/extensions/GrowthExperiments/includes/HomepageHooks.php(64): GrowthExperiments\HomepageModules\SuggestedEdits::isEnabled(RequestContext)
#11 /srv/mediawiki/php-1.35.0-wmf.10/includes/Hooks.php(174): GrowthExperiments\HomepageHooks::onSpecialPageInitList(array)
#12 /srv/mediawiki/php-1.35.0-wmf.10/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#13 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPageFactory.php(324): Hooks::run(string, array)
#14 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPageFactory.php(340): MediaWiki\Special\SpecialPageFactory->getPageList()
#15 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPageFactory.php(698): MediaWiki\Special\SpecialPageFactory->getAliasList()
#16 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPage.php(100): MediaWiki\Special\SpecialPageFactory->getLocalNameFor(string, boolean)
#17 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPage.php(85): SpecialPage::getTitleValueFor(string, boolean, string)
#18 /srv/mediawiki/php-1.35.0-wmf.10/extensions/VisualEditor/includes/VisualEditorHooks.php(949): SpecialPage::getTitleFor(string)
#19 /srv/mediawiki/php-1.35.0-wmf.10/includes/Hooks.php(174): VisualEditorHooks::onResourceLoaderGetConfigVars(array, string, GlobalVarConfig)
#20 /srv/mediawiki/php-1.35.0-wmf.10/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#21 /srv/mediawiki/php-1.35.0-wmf.10/includes/resourceloader/ResourceLoaderStartUpModule.php(141): Hooks::run(string, array)
#22 /srv/mediawiki/php-1.35.0-wmf.10/includes/resourceloader/ResourceLoaderStartUpModule.php(481): ResourceLoaderStartUpModule->getConfigSettings(ResourceLoaderContext)
#23 /srv/mediawiki/php-1.35.0-wmf.10/includes/resourceloader/ResourceLoaderModule.php(713): ResourceLoaderStartUpModule->getScript(ResourceLoaderContext)
#24 /srv/mediawiki/php-1.35.0-wmf.10/includes/resourceloader/ResourceLoaderModule.php(681): ResourceLoaderModule->buildContent(ResourceLoaderContext)
#25 /srv/mediawiki/php-1.35.0-wmf.10/includes/resourceloader/ResourceLoaderModule.php(816): ResourceLoaderModule->getModuleContent(ResourceLoaderContext)
#26 /srv/mediawiki/php-1.35.0-wmf.10/includes/resourceloader/ResourceLoader.php(666): ResourceLoaderModule->getVersionHash(ResourceLoaderContext)
#27 [internal function]: ResourceLoader->{closure}(string)
#28 /srv/mediawiki/php-1.35.0-wmf.10/includes/resourceloader/ResourceLoader.php(678): array_map(Closure, array)
#29 /srv/mediawiki/php-1.35.0-wmf.10/includes/resourceloader/ResourceLoader.php(765): ResourceLoader->getCombinedVersion(ResourceLoaderContext, array)
#30 /srv/mediawiki/php-1.35.0-wmf.10/load.php(43): ResourceLoader->respond(ResourceLoaderContext)
#31 /srv/mediawiki/w/load.php(3): require(string)
#32 {main}
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptDec 17 2019, 9:17 PM

The list of special pages cannot depend on user preferences, only on site configs.

Even special pages a user does not have user rights for are listed when searching with autocomplete
Due to red or blue links a special page depending on user preferences needs to split parser cache when used in wikitext, that sounds not like a good idea.

If you want that the user not using the special page, than the special page itself needs message to hint the user enabling the beta preference.

https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/GrowthExperiments/+/556360/ are last changes in that code area

Tgr added a subscriber: Tgr.Dec 18 2019, 12:02 AM

The list of special pages in GrowthExperiments does not depend on user preferences, it just gets initialized differently.

IMO the overarching failure here is that ResourceLoader has its own weird context object which does not integrate with RequestContext in any way (and that the proposal was rejected that RequestContext should just return an anonymous user and log a warning when called within load.php, instead of throwing an exception).

In any case, this is an easy fix.

Change 558736 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/GrowthExperiments@master] Do not use RequestContext in onSpecialPageInitList

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

Tgr moved this task from Incoming to Code Review on the Growth-Team (Current Sprint) board.

Change 558736 abandoned by Gergő Tisza:
Do not use RequestContext in onSpecialPageInitList

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

Tgr added a comment.Dec 18 2019, 7:14 AM

Patch at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/558819, but the train will fix this anyway so maybe not worth the effort.

Patch at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/558819, but the train will fix this anyway so maybe not worth the effort.

The train won't fix it until January (wmf.11 was already cut and deployed). Oh, sorry, didn't see it landed into wmf.11. I'll still push it now, as it's by far the largest new logspam item.

Since it's not a deployment blocker (T240997#5750217) and not happening in wmf.11 can we lower the priority of this?

Jdforrester-WMF closed this task as Resolved.Dec 18 2019, 10:13 AM
Jdforrester-WMF assigned this task to Tgr.

Backport deployed. All now seems quiet. Declaring fixed.

kostajh claimed this task.Dec 18 2019, 10:13 AM

Change 559007 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/extensions/GrowthExperiments@master] Simplify TrackerFactory injection

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

kostajh reopened this task as Open.Dec 18 2019, 10:03 PM
kostajh lowered the priority of this task from Unbreak Now! to Low.

Re-opening for review of the follow-up patch.

Change 559007 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Simplify TrackerFactory / SpecialHomepage dependency injection

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

Tgr closed this task as Resolved.Dec 19 2019, 7:42 AM