Page MenuHomePhabricator

VE fails startup module with "Sessions are disabled for this entry point"
Closed, ResolvedPublic1 Estimated Story Points

Description

Started getting these today on every page, seems to be related to VisualEditor (?)

In the console:

debug=false&lang=en&modules=startup&only=scripts&skin=vector   BadMethodCallException from line 845 of /vagrant/mediawiki/includes/session/SessionManager.php: Sessions are disabled for this entry point

From my vagrant logs:

2016-09-26 19:16:47 wiki exception ERROR: [17779759e6d90a9c9c7f8620] /w/load.php?debug=false&lang=en&modules=startup&only=scripts&skin=vector   BadMethodCallException from line 845 of /vagrant/mediawiki/includes/session/SessionManager.php: Sessions are disabled for this entry point {"exception_id":"17779759e6d90a9c9c7f8620"} 
[Exception BadMethodCallException] (/vagrant/mediawiki/includes/session/SessionManager.php:845) Sessions are disabled for this entry point
  #0 /vagrant/mediawiki/includes/session/SessionManager.php(308): MediaWiki\Session\SessionManager->getSessionFromInfo(MediaWiki\Session\SessionInfo, WebRequest)
  #1 /vagrant/mediawiki/includes/session/SessionManager.php(242): MediaWiki\Session\SessionManager->getEmptySessionInternal(WebRequest)
  #2 /vagrant/mediawiki/includes/session/SessionManager.php(192): MediaWiki\Session\SessionManager->getEmptySession(WebRequest)
  #3 /vagrant/mediawiki/includes/WebRequest.php(735): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)
  #4 /vagrant/mediawiki/includes/user/User.php(1198): WebRequest->getSession()
  #5 /vagrant/mediawiki/includes/user/User.php(403): User->loadFromSession()
  #6 /vagrant/mediawiki/includes/user/User.php(5120): User->load()
  #7 /vagrant/mediawiki/includes/user/User.php(2763): User->loadOptions()
  #8 /vagrant/mediawiki/includes/context/RequestContext.php(363): User->getOption(string)
  #9 /vagrant/mediawiki/includes/Message.php(364): RequestContext->getLanguage()
  #10 /vagrant/mediawiki/includes/Message.php(1188): Message->getLanguage()
  #11 /vagrant/mediawiki/includes/Message.php(802): Message->fetchMessage()
  #12 /vagrant/mediawiki/includes/Message.php(890): Message->toString()
  #13 /vagrant/mediawiki/includes/EditPage.php(3513): Message->parse()
  #14 /vagrant/mediawiki/extensions/VisualEditor/VisualEditorDataModule.php(57): EditPage::getCopyrightWarning(Title, string)
  #15 /vagrant/mediawiki/extensions/VisualEditor/VisualEditorDataModule.php(21): VisualEditorDataModule->getMessageInfo(DerivativeResourceLoaderContext)
  #16 /vagrant/mediawiki/includes/resourceloader/ResourceLoaderModule.php(626): VisualEditorDataModule->getScript(DerivativeResourceLoaderContext)
  #17 /vagrant/mediawiki/includes/resourceloader/ResourceLoaderModule.php(594): ResourceLoaderModule->buildContent(DerivativeResourceLoaderContext)
  #18 /vagrant/mediawiki/includes/resourceloader/ResourceLoaderModule.php(742): ResourceLoaderModule->getModuleContent(DerivativeResourceLoaderContext)
  #19 /vagrant/mediawiki/includes/resourceloader/ResourceLoader.php(624): ResourceLoaderModule->getVersionHash(DerivativeResourceLoaderContext)
  #20 [internal function]: Closure$ResourceLoader::getCombinedVersion(string)
  #21 /vagrant/mediawiki/includes/resourceloader/ResourceLoader.php(625): array_map(Closure$ResourceLoader::getCombinedVersion;1299315079, array)
  #22 /vagrant/mediawiki/includes/resourceloader/ResourceLoaderStartUpModule.php(404): ResourceLoader->getCombinedVersion(DerivativeResourceLoaderContext, array)
  #23 /vagrant/mediawiki/includes/resourceloader/ResourceLoaderStartUpModule.php(377): ResourceLoaderStartUpModule->getAllModuleHashes(DerivativeResourceLoaderContext)
  #24 /vagrant/mediawiki/includes/resourceloader/ResourceLoaderModule.php(745): ResourceLoaderStartUpModule->getDefinitionSummary(DerivativeResourceLoaderContext)
  #25 /vagrant/mediawiki/includes/resourceloader/ResourceLoader.php(624): ResourceLoaderModule->getVersionHash(DerivativeResourceLoaderContext)
  #26 [internal function]: Closure$ResourceLoader::getCombinedVersion(string)
  #27 /vagrant/mediawiki/includes/resourceloader/ResourceLoader.php(625): array_map(Closure$ResourceLoader::getCombinedVersion;1299315079, array)
  #28 /vagrant/mediawiki/includes/resourceloader/ResourceLoader.php(709): ResourceLoader->getCombinedVersion(ResourceLoaderContext, array)
  #29 /vagrant/mediawiki/load.php(46): ResourceLoader->respond(ResourceLoaderContext)
  #30 /var/www/w/load.php(5): include(string)
  #31 {main}

Event Timeline

Krinkle subscribed.

Most likely caused by rEVEDc0cf9c1e7552: Don't re-implement EditPage::getCopyrightWarning().

Previously it used ResourceLoaderContext::msg(). Now it statically calls EditPage::getCopyrightWarning().

class EditPage {
	public static function getCopyrightWarning( $title, $format = 'plain' ) {
		$copywarnMsg = [ 'copyrightwarning',
				'[[' . wfMessage( 'copyrightpage' )->inContentLanguage()->text() . ']]', ..
		...
		return  .. call_user_func_array( 'wfMessage', $copywarnMsg )->title( $title )->$format() ..
	}
}

And while that EditPage mostly sticks to content language (which doesn't consider the "current user" language), that method ends with one more call to wfMessage() - with no indication of content language or other language - which ends up falling back to trying to determine the current user's language - without considering ResourceLoaderContext - and thus ends up trying to load the user session - which isn't allowed in load.php (since it's cached statically).

Krinkle renamed this task from Startup module error "Sessions are disabled for this entry point" to VE fails startup module with "Sessions are disabled for this entry point".Sep 26 2016, 7:38 PM
Krinkle triaged this task as Unbreak Now! priority.
Krinkle added a project: Regression.
Krinkle added a subscriber: Legoktm.

Change 312960 had a related patch set uploaded (by Alex Monk):
EditPage: Allow language of copyright warning to be specified

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

Change 312961 had a related patch set uploaded (by Alex Monk):
Set language on copyright warning to RL default

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

AlexMonk-WMF subscribed.

We should fix this before 1.28.0-wmf.21 branches

Change 312960 merged by jenkins-bot:
EditPage: Allow language of copyright warning to be specified

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

Change 312961 merged by jenkins-bot:
Set language on copyright warning to RL default

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

Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Jdforrester-WMF set the point value for this task to 1.

At the moment we try to upgrade our wiki to MW 1.28.2 but I encounter exactly that same error (also see https://www.mediawiki.org/wiki/Topic:Trnjlmc7a4oobq1e). How can I fix this? I'm using the REL1_28-version of the VE.

Thanks for your help!

Regards, Jethro

I'm still seeing this error in MW 1.30.0 (830bb58fa2d24eb93d45135c6becd53f6c50d491) using VE tested at the following commits:

  1. REL1_30 (rEVED61f161a39b8e)
  2. fe09c22e33f4b24f05cca71dba13de86e4896092 (last commit before MW >= 1.31 required in extension.json)
  3. Current master (3a9ec6bccebaf0acc9e1181c49bc6f8b2bca7ebe) but with extension.json modified to allow MW 1.30.0

Commenting out wfLoadExtension( 'VisualEditor' ); removes this error.

Error text:

[Ws-6tO7RfvrF05JHnaep3gAAAAA] /demo/load.php?debug=false&lang=en&modules=startup&only=scripts&skin=vector   BadMethodCallException from line 847 of /opt/htdocs/mediawiki/includes/session/SessionManager.php: Sessions are disabled for this entry point
Backtrace:
#0 /opt/htdocs/mediawiki/includes/session/SessionManager.php(309): MediaWiki\Session\SessionManager->getSessionFromInfo(MediaWiki\Session\SessionInfo, WebRequest)
#1 /opt/htdocs/mediawiki/includes/session/SessionManager.php(243): MediaWiki\Session\SessionManager->getEmptySessionInternal(WebRequest)
#2 /opt/htdocs/mediawiki/includes/session/SessionManager.php(193): MediaWiki\Session\SessionManager->getEmptySession(WebRequest)
#3 /opt/htdocs/mediawiki/includes/WebRequest.php(735): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)
#4 /opt/htdocs/mediawiki/includes/user/User.php(1231): WebRequest->getSession()
#5 /opt/htdocs/mediawiki/includes/user/User.php(408): User->loadFromSession()
#6 /opt/htdocs/mediawiki/includes/user/User.php(5266): User->load()
#7 /opt/htdocs/mediawiki/includes/user/User.php(2884): User->loadOptions()
#8 /opt/htdocs/mediawiki/includes/context/RequestContext.php(364): User->getOption(string)
#9 /opt/htdocs/mediawiki/includes/StubObject.php(205): RequestContext->getLanguage()
#10 /opt/htdocs/mediawiki/includes/StubObject.php(167): StubUserLang->_newObject()
#11 /opt/htdocs/mediawiki/includes/StubObject.php(110): StubObject->_unstub(string, integer)
#12 /opt/htdocs/mediawiki/includes/StubObject.php(137): StubObject->_call(string, array)
#13 /opt/htdocs/mediawiki/extensions/Arrays/Arrays.php(108): StubObject->__call(string, array)
#14 /opt/htdocs/mediawiki/extensions/Arrays/Arrays.php(108): StubUserLang->getMessageFromDB(string)
#15 [internal function]: ExtArrays::init(Parser)
#16 /opt/htdocs/mediawiki/includes/Hooks.php(177): call_user_func_array(string, array)
#17 /opt/htdocs/mediawiki/includes/Hooks.php(205): Hooks::callHook(string, string, array, NULL)
#18 /opt/htdocs/mediawiki/includes/parser/Parser.php(337): Hooks::run(string, array)
#19 [internal function]: Parser->firstCallInit()
#20 /opt/htdocs/mediawiki/includes/StubObject.php(111): call_user_func_array(array, array)
#21 /opt/htdocs/mediawiki/includes/StubObject.php(137): StubObject->_call(string, array)
#22 /opt/htdocs/mediawiki/includes/cache/MessageCache.php(1127): StubObject->__call(string, array)
#23 /opt/htdocs/mediawiki/includes/cache/MessageCache.php(1127): StubObject->firstCallInit()
#24 /opt/htdocs/mediawiki/includes/cache/MessageCache.php(1103): MessageCache->getParser()
#25 /opt/htdocs/mediawiki/includes/Message.php(1259): MessageCache->transform(string, boolean, LanguageEn, NULL)
#26 /opt/htdocs/mediawiki/includes/Message.php(874): Message->transformText(string)
#27 /opt/htdocs/mediawiki/includes/Message.php(934): Message->toString(string)
#28 /opt/htdocs/mediawiki/includes/EditPage.php(3558): Message->text()
#29 /opt/htdocs/mediawiki/extensions/VisualEditor/VisualEditorDataModule.php(68): EditPage::getCopyrightWarning(Title, string, string)
#30 /opt/htdocs/mediawiki/extensions/VisualEditor/VisualEditorDataModule.php(26): VisualEditorDataModule->getMessageInfo(DerivativeResourceLoaderContext)
#31 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoaderModule.php(719): VisualEditorDataModule->getScript(DerivativeResourceLoaderContext)
#32 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoaderModule.php(687): ResourceLoaderModule->buildContent(DerivativeResourceLoaderContext)
#33 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoaderModule.php(841): ResourceLoaderModule->getModuleContent(DerivativeResourceLoaderContext)
#34 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoader.php(667): ResourceLoaderModule->getVersionHash(DerivativeResourceLoaderContext)
#35 [internal function]: ResourceLoader->{closure}(string)
#36 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoader.php(680): array_map(Closure, array)
#37 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoaderStartUpModule.php(434): ResourceLoader->getCombinedVersion(DerivativeResourceLoaderContext, array)
#38 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoaderStartUpModule.php(407): ResourceLoaderStartUpModule->getAllModuleHashes(DerivativeResourceLoaderContext)
#39 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoaderModule.php(844): ResourceLoaderStartUpModule->getDefinitionSummary(DerivativeResourceLoaderContext)
#40 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoader.php(667): ResourceLoaderModule->getVersionHash(ResourceLoaderContext)
#41 [internal function]: ResourceLoader->{closure}(string)
#42 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoader.php(680): array_map(Closure, array)
#43 /opt/htdocs/mediawiki/includes/resourceloader/ResourceLoader.php(760): ResourceLoader->getCombinedVersion(ResourceLoaderContext, array)
#44 /opt/htdocs/mediawiki/load.php(53): ResourceLoader->respond(ResourceLoaderContext)
#45 {main}
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=vector:51

Disregard the above. Removing additional extensions (Arrays, NumerAlpha) removed this issue.

@Jamesmontalvo3 Indeed. The stack trace parts EditPage::getCopyrightWarning(Title, string, string) and MessageCache->transform(string, boolean, LanguageEn, NULL) indicate that VisualEditor is correctly providing a specific language, without relying on "current user language" fallback, which would require initiation of the current user session.

Instead, when the wikitext parser is invoked, an extension hook from "Arrays" retrieved an unrelated interface message in a way that is not explicit about the language, and thus triggers the session violation. The below is a reversed copy of your stack trace, with the important bits highlighted.

(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=vector:51
[..]
#38 includes/resourceloader/ResourceLoaderStartUpModule.php(407): [..]
#30 extensions/VisualEditor/VisualEditorDataModule.php(26): VisualEditorDataModule->getMessageInfo(DerivativeResourceLoaderContext)
#29 extensions/VisualEditor/VisualEditorDataModule.php(68): EditPage::getCopyrightWarning(Title, string, string) [..]
#25 includes/Message.php(1259): MessageCache->transform(string, boolean, LanguageEn, NULL)
[..]
#19 [internal function]: Parser->firstCallInit()
#18 includes/parser/Parser.php(337): Hooks::run(string, array)
[..]
#15 [internal function]: ExtArrays::init(Parser)
#14 extensions/Arrays/Arrays.php(108): StubUserLang->getMessageFromDB(string) [..]
#10 includes/StubObject.php(167): StubUserLang->_newObject()
#9 includes/StubObject.php(205): RequestContext->getLanguage() [..]
#5 includes/user/User.php(408): User->loadFromSession() [..]
> Sessions are disabled for this entry point