Topic on Project:Support desk

Error "Sessions are supposed to be disabled for this entry point"

22
Summary by Kghbln

Please upgrade to SMW 2.5.0 to mitigate the issue. Moreover $wgMFAllowNonJavaScriptEditing = true; should be set if MobileFrontend is used on the wiki.

Waanders (talkcontribs)

We are busy upgrading our wiki from MW 1.27.1 to version 1.28.

I encounter an error: Console tab of the browser gives "Fatal exception of type "BadMethodCallException" (load.php?debug=false&lang=nl&modules=startup&only=scripts&skin=vector:formatted:5)".

After adding "$wgShowExceptionDetails = true;" to LocalSettings.php it gives "/wiki/portfoliotest/wiki/load.php?debug=false&lang=nl&modules=startup&only=scripts&skin=vector BadMethodCallException from line 845 of /home/test/mediawiki/core/includes/session/SessionManager.php: Sessions are disabled for this entry point".

How do I fix this?

Release notes/1.28 says "The load.php entry point now enforces the existing policy of not allowing access to session data, which includes the session user and the session user's language. If such access is attempted, an exception will be thrown".

Manual:Load.php gives "Code executed via load.php should not rely on the user's session as its results will be cached and sent to other users. Starting from MW 1.28, this is enforced and a "Sessions are supposed to be disabled for this entry point" exception will be thrown if a session access is attempted. See these tips on how to fix".

But "these tips" (Manual:SessionManager and AuthManager/Updating tips#Exception .22Sessions are supposed to be disabled for this entry point.22) doesn't help me further (well, I don't fully understand the solution).

MarkAHershberger (talkcontribs)

Is there any backtrace provided? If your wiki is public, can you point to it?

Waanders (talkcontribs)

No, not a public wiki.

This will help?

[resourceloader] Calculating version hash failed: [Exception BadMethodCallException( .../core/includes/session/SessionManager.php:845) Sessions are disabled for this entry point]

#0 .../includes/session/SessionManager.php(308): MediaWiki\Session\SessionManager->getSessionFromInfo(MediaWiki\Session\SessionInfo, WebRequest)
#1 .../includes/session/SessionManager.php(242): MediaWiki\Session\SessionManager->getEmptySessionInternal(WebRequest)
#2 .../includes/session/SessionManager.php(192): MediaWiki\Session\SessionManager->getEmptySession(WebRequest)
#3 .../includes/WebRequest.php(735): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)
#4 .../includes/user/User.php(1199): WebRequest->getSession()
#5 .../includes/user/User.php(404): User->loadFromSession()
#6 .../includes/user/User.php(5125): User->load()
#7 .../includes/user/User.php(2768): User->loadOptions()
#8 .../includes/context/RequestContext.php(364): User->getOption(string)
#9 .../includes/StubObject.php(207): RequestContext->getLanguage()
#10 .../includes/StubObject.php(169): StubUserLang->_newObject()
#11 .../includes/StubObject.php(112): StubObject->_unstub(string, integer)
#12 .../includes/StubObject.php(139): StubObject->_call(string, array)
#13 .../extensions/SemanticMediaWiki/src/DataTypeRegistry.php(126): StubObject->__call(string, array)
#14 .../extensions/SemanticMediaWiki/src/DataTypeRegistry.php(126): StubUserLang->getCode()
#15 .../extensions/SemanticMediaWiki/src/DataValueFactory.php(57): SMW\DataTypeRegistry::getInstance()
#16 .../extensions/SemanticMediaWiki/src/InTextAnnotationParser.php(88): SMW\DataValueFactory::getInstance()
#17 .../extensions/SemanticMediaWiki/src/ApplicationFactory.php(235): SMW\InTextAnnotationParser->__construct(SMW\ParserData, SMW\MediaWiki\MagicWordsFinder, SMW\MediaWiki\RedirectTargetFinder)
#18 .../extensions/SemanticMediaWiki/src/MediaWiki/Hooks/InternalParseBeforeLinks.php(108): SMW\ApplicationFactory->newInTextAnnotationParser(SMW\ParserData)
#19 .../extensions/SemanticMediaWiki/src/MediaWiki/Hooks/InternalParseBeforeLinks.php(62): SMW\MediaWiki\Hooks\InternalParseBeforeLinks->performUpdate()
#20 .../extensions/SemanticMediaWiki/src/MediaWiki/Hooks/HookRegistry.php(204): SMW\MediaWiki\Hooks\InternalParseBeforeLinks->process()
#21 [internal function]: SMW\MediaWiki\Hooks\HookRegistry->SMW\MediaWiki\Hooks\{closure}(Parser, string, StripState)
#22 .../includes/Hooks.php(195): call_user_func_array(Closure, array)
#23 .../includes/parser/Parser.php(1277): Hooks::run(string, array)
#24 .../includes/parser/Parser.php(441): Parser->internalParse(string)
#25 .../includes/cache/MessageCache.php(1124): Parser->parse(string, Title, ParserOptions, boolean)
#26 .../includes/Message.php(1152): MessageCache->parse(string, Title, boolean, boolean, Language)
#27 .../includes/Message.php(828): Message->parseText(string)
#28 .../includes/Message.php(890): Message->toString()
#29 .../extensions/VisualEditor/VisualEditorDataModule.php(25): Message->parse()
#30 .../includes/resourceloader/ResourceLoaderModule.php(627): VisualEditorDataModule->getScript(DerivativeResourceLoaderContext)
#31 .../includes/resourceloader/ResourceLoaderModule.php(595): ResourceLoaderModule->buildContent(DerivativeResourceLoaderContext)
#32 .../includes/resourceloader/ResourceLoaderModule.php(743): ResourceLoaderModule->getModuleContent(DerivativeResourceLoaderContext)
#33 .../includes/resourceloader/ResourceLoader.php(624): ResourceLoaderModule->getVersionHash(DerivativeResourceLoaderContext)
#34 [internal function]: ResourceLoader->{closure}(string)
#35 .../includes/resourceloader/ResourceLoader.php(625): array_map(Closure, array)
#36 .../includes/resourceloader/ResourceLoaderStartUpModule.php(404): ResourceLoader->getCombinedVersion(DerivativeResourceLoaderContext, array)
#37 .../includes/resourceloader/ResourceLoaderStartUpModule.php(377): ResourceLoaderStartUpModule->getAllModuleHashes(DerivativeResourceLoaderContext)
#38 .../includes/resourceloader/ResourceLoaderModule.php(746): ResourceLoaderStartUpModule->getDefinitionSummary(DerivativeResourceLoaderContext)
#39 .../includes/resourceloader/ResourceLoader.php(624): ResourceLoaderModule->getVersionHash(ResourceLoaderContext)
#40 [internal function]: ResourceLoader->{closure}(string)
#41 .../includes/resourceloader/ResourceLoader.php(625): array_map(Closure, array)
#42 .../includes/resourceloader/ResourceLoader.php(709): ResourceLoader->getCombinedVersion(ResourceLoaderContext, array)
#43 .../load.php(53): ResourceLoader->respond(ResourceLoaderContext)
#44 {main}

It's from the $wgDebugLogFile file.

Thanks for your help!

MarkAHershberger (talkcontribs)
Kghbln (talkcontribs)

Indeed SMW 2.4.x is not compatible with MW 1.28. Just today SMW 2.5.0 was released. MW 1.28 is painful for another reason too: See here.

Waanders (talkcontribs)

I did upgrade to SMW 2.4.6 and got that error, now I've upgraded to 2.5 and the error has disappeared. Thanks!

"Indeed SMW 2.4.x is not compatible with MW 1.28". MW 1.28 was released 2016-11-28, so SMW-users had to wait for 3 months+ upgrading to 1.28?

Ciencia Al Poder (talkcontribs)

Not only that, but there are a lot of annoying bugs in 1.27.1 (an LTS, remember) fixed in 1.27.2 but there hasn't been a release since more than 6 months...

Waanders (talkcontribs)

@Kghbln @Ciencia Al Poder "MW 1.28 is painful for another reason" and "there are a lot of annoying bugs in 1.27.1". So? Wait for 1.28.1? Wait for 1.27.2?

Waanders (talkcontribs)
Kghbln (talkcontribs)

Indeed we are in a difficult situation since WMF does no longer seem to do point releases for maintenance fixes. So we have to wait for the next security issue to arise I'm afraid. What I do is to use branch master for both branches but this is not an option for most shared hosting users. Yes, waiting for the next releases to 1.27 and 1.28 seems to be the best choice.

Waanders (talkcontribs)
Waanders (talkcontribs)

@Kghbln What exactly do you mean by "to use branch master for both branches"?

Kghbln (talkcontribs)

Fixes to both branches were already merged. So if you use Git than you update to master (latest revision) of the respective branch. A point release only includes the latest revision on the release date.

Waanders (talkcontribs)
Kghbln (talkcontribs)

Every major version is developed on a branch after release, so there is a branch for 1.27 and one for 1.28 and these branches get fixed specific to that version. The category issue e.g. is on the 1.28 branch whereas other issues were fixed on the 1.27 as well. Since you are using point release you do not need to worry about this. Just wait for the next releases.

Kghbln (talkcontribs)

I believe that your original issue was solved by upgrading to SMW 2.5.0 thus closing this thread.

Waanders (talkcontribs)
Naramoksu (talkcontribs)

I'm using private wiki which have MW 1.28.1 and SWM 2.5.0 on debian+Apache+PHP 5.6.30+MySql 5.6.35.

When I use wiki at desktop it works well and it's possible to view at mobile page. But I can not edit the page at mobile view.

As soon as I switch to mobile view, I got a error below at a browser console.

[7e95061a17c72f3ca98427ea] /load.php?debug=false&lang=ko&modules=ext.relatedArticles.readMore.bootstrap%2Cgateway%7Cjquery.byteLength%2Ccookie%2Cthrottle-debounce%7Cmediawiki.Title%2CUri%2Capi%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Crouter%2Cstorage%2Cuser%2Cviewport%7Cmediawiki.api.user%7Cmediawiki.language.data%2Cinit%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.template.regexp%7Cmediawiki.ui.input%7Cmobile.ajax%2Cbetaoptin%2Ccache%2Ccontext%2Cdrawers%2Cissues%2CmodifiedBar%2Coverlays%2Cpagelist%2Creferences%2Csearch%2Csettings%2Csite%2Cstartup%2Ctoast%2Ctoggle%2Cuser%2Cwatchstar%7Cmobile.editor.api%7Cmobile.issues.images%7Cmobile.loggingSchemas.edit%2CmobileWebSearch%7Cmobile.overlay.images%7Cmobile.pagelist.scripts%2Cstyles%7Cmobile.pagesummary.styles%7Cmobile.references.gateway%2Cimages%7Cmobile.search.images%2Cutil%7Coojs-router%7Cskins.minerva.editor%2Cscripts%2Ctalk%2Ctoggling%2Cwatchstar%7Cskins.minerva.icons.images.scripts%2Cvariants%7Cuser.defaults&skin=minerva&version=0e25361   BadMethodCallException from line 845 of /opt/bitnami/apps/mediawiki/htdocs/includes/session/SessionManager.php: Sessions are disabled for this entry point

Trying to edit a page, it try to go to editor but fail and return to page.

/load.php?debug=false&lang=ko&modules=mobile.search%7Cskins.minerva.editor%2Cscripts%2Ctalk%2Ctoggling%2Cwatchstar&skin=minerva&version=1z0hv18   BadMethodCallException from line 845 of /opt/bitnami/apps/mediawiki/htdocs/includes/session/SessionManager.php: Sessions are disabled for this entry point

Meanwhile, I have some login issue. I login my wiki and set to remember me. But 10 min later, the wiki ask me to log in.

I know there is several thread talking about similar issue. But not yet find a solution.

I hope someone give me a kind advice to solve my issues.

Kghbln (talkcontribs)

Are you using the WikiEditor? If yes, than mobile editing is broken and will not be fixed. People are focusing on some new editing method. Do not hold your breath since it will from experience presumably take a couple of years if this one will enter beta status.

Did you set $wgSessionCacheType = CACHE_DB;, if not this should fix you second issue.

Naramoksu (talkcontribs)

Kghbln,

I disabled the WikiEditor but mobile editing was not possible. And error "Sessions are disabled for this entry point" happened.

At a link in your comment, I found good tip. After I insert $wgMFAllowNonJavaScriptEditing = true; to LocalSettings.php, I can edit a page at mobile view. I think it is not mobile edit I used before I upgrade to 1.28. Anyway I can edit a page on my phone.

Thanks.

Kghbln (talkcontribs)

Thanks for reporting back. So this turns out to be a WikiEditor issue.

Xavi (talkcontribs)

This fixed it for me:

  1. Open DevTools in your browser and go to the Console window
  2. Go to a page in your wiki
  3. Check for BadMethodCallException (it should be displayed even if you do not click Edit to start VisualEditor):
[58e7ec1228f8444ce4c92c47] /.../load.php?debug=false&lang=en&modules=startup&only=scripts&skin=vector   BadMethodCallException from line 845 of /.../MediaWiki/includes/session/SessionManager.php: Sessions are disabled for this entry point

If that is the case get the newer version of VisualEditor for your MediaWiki installation (for MediaWiki 1.28 use VisualEditor for 1.27) and replace the existing VisualEditor files in the extension folder. The one from the Extension Distributor worked for me: Special:ExtensionDistributor/VisualEditor