Page MenuHomePhabricator

Toolbar occasionally missing at no.wiki (due to some cookie issue?)
Closed, ResolvedPublic

Description

The toolbar at no.wiki is missing during ordinary editing. See for example w:no:Bagn?action=edit&debug=true. For original complaints, see w:no:Wikipedia:Torget#Tekniske problemer med knapperekka igjen (den blir borte).

There is an error, but it is not clear that this is the root cause. As it involves jquery.wikiEditor.toolbar.js it is a likely cause. It is the only log entry I can find that seems likely to be connected with this.

URIError: malformed URI sequence  jquery.cookie.js:17:20
	decoded https://no.wikipedia.org/w/resources/lib/jquery/jquery.cookie.js:17:20
	$.cookie https://no.wikipedia.org/w/resources/lib/jquery/jquery.cookie.js:65:17
	buildSection https://no.wikipedia.org/w/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js:676:16
	build https://no.wikipedia.org/w/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js:751:8
	create https://no.wikipedia.org/w/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js:233:5
	addModule https://no.wikipedia.org/w/extensions/WikiEditor/modules/jquery.wikiEditor.js:339:9
	$.fn.wikiEditor https://no.wikipedia.org/w/extensions/WikiEditor/modules/jquery.wikiEditor.js:647:5
	<anonymous> https://no.wikipedia.org/w/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:13:2
	fire https://no.wikipedia.org/w/load.php:3148:10
	fireWith https://no.wikipedia.org/w/load.php:3260:7
	ready https://no.wikipedia.org/w/load.php:3472:3
	completed https://no.wikipedia.org/w/load.php:3503:3

Event Timeline

jeblad triaged this task as High priority.Apr 28 2017, 8:46 PM

Cannot reproduce. https://no.wikipedia.org/wiki/Bagn?action=edit&debug=true shows the toolbar above the text field for me, being logged in and using the traditional wikitext editor.

Even after I also switched on all gadgets on https://no.wikipedia.org/wiki/Spesial:Innstillinger#mw-prefsection-gadgets I only got mw.util is undefined for https://no.wikipedia.org/wiki/MediaWiki:Gadget-GoogleTrans.js (because that file does not follow https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoader#Client-side_.28dynamically.29 ).

Force browser cache to reload? I had a complete purge earlier today.

The toolbar is gone for me even when all gadgets are turned off.

When not logged in and using Chromium the toolbar is there. Using Firefox the toolbar is missing when am logged in.

It's trying to retrieve something from your cookies (collapsed state of the advanced toolbar I suspect), and fails on reading that. So it is likely specific to your cookie.

I suspect something on no.wp has written an invalid cookie value and the cookie reader (that happens to be) used by WikiEditor dies on it.

Deleted all cookies a wikipedia-page and the toolbar is back.

I'll tell them about how to solve the problem.
Let the task hang around a day in case someone needs it, but I guess the fix is "Eat all cookies!"

@jeblad try to find out if the users affected have a gadget or userscript in common. Might be something like that is not using the jquery.cookie module and messing about with cookies on its own.

no:MediaWiki:Gadget-notifications.js, no:MediaWiki:Gadget-recent-changes-patrol.js and no:MediaWiki:Gadget-GoogleTrans.js all seem suspicious to me.

Problem persisted even if all gadgets was turned off.
It seems likely that something has messed with a cookie, ... argh, perhaps I know what...

@jeblad, a cookie is persistent, so if something wrote a broken value, then another cookie reader will have to deal with that broken value regardless.

cookies all share the same string of data basically, and if you don't properly escape the parts, then you can easily break things. This is why we have jquery.cookie (or in new code mw.cookie, which automatically has appropriate default values and prefixes etc for things. But that might break old code that didn't expect cookie prefixes)

Not me! ;) But my hunch was wrong, I suspected some new code, but it wasn't that code.
But yes, the code for some of the gadgets should be burned over live fire.

I can provoke this to happen, but I can't narrow down why.
It is a bit of a Heisenbug, so don't expect me to find it anytime soon.

Aklapper renamed this task from Toolbar missing at no.wiki to Toolbar occasionally missing at no.wiki (due to some cookie issue?).Apr 29 2017, 12:06 AM

Seems like w:no:MediaWiki:Gadgets-definition lacks definitions of dependencies for some entries. Some of the entries lacks mediawiki.util and it seems to be some of the same entries creating problems.

That is, Gadgets-definition should have been updated with MW 1.27.

This is reported to the community, with a description of how to solve the problem.

Perhaps not resolved at all, could be several things going on.

On call

https://no.wikipedia.org/w/load.php?debug=false&lang=nb&modules=es5-shim%2Coojs%2Csite%7Cext.centralNotice.choiceData%2Cdisplay%2CgeoIP%2CimpressionDiet%2CkvStore%2CkvStoreMaintenance%2CstartUp%7Cext.centralauth.ForeignApi%7Cext.centralauth.centralautologin.clearcookie%7Cext.cite.a11y%7Cext.cx.campaigns.contributionsmenu%7Cext.cx.eventlogging%2Cinterlanguagelink%2Cmodel%2Csitemapper%2Cutil%7Cext.cx.widgets.callout%7Cext.echo.api%2Cinit%7Cext.eventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.eventLogging.subscriber%7Cext.gadget.hide-references%2Cref-toolbar%7Cext.uls.common%2Ccompactlinks%2Ceventlogger%2Cinit%2Cinterface%2Cpreferences%2Cwebfonts%7Cext.visualEditor.desktopArticleTarget.init%7Cext.visualEditor.supportCheck%2CtargetLoader%2Ctrack%2Cve%7Cext.wikimediaEvents.loggedin%7Cjquery.accessKeyLabel%2CbyteLength%2CcheckboxShiftClick%2Cclient%2Ccookie%2CgetAttrs%2ChighlightText%2Cmw-jump%2Csuggestions%2CtabIndex%2CtextSelection%2Cthrottle-debounce%7Cjquery.uls.data%7Cmediawiki.ForeignApi%2CRegExp%2CTitle%2CUri%2Capi%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Cnotify%2CsearchSuggest%2Cstorage%2Ctemplate%2Ctoc%2Cuser%2Cutil%7Cmediawiki.ForeignApi.core%7Cmediawiki.action.view.postEdit%7Cmediawiki.api.options%2Cuser%2Cwatch%7Cmediawiki.language.data%2Cinit%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%2Cstartup%7Cmediawiki.page.watch.ajax%7Cmediawiki.template.regexp%7Cmediawiki.ui.button%2Cicon%7Cmmv.bootstrap%2Chead%7Cmmv.bootstrap.autostart%7Cschema.UniversalLanguageSelector%7Cskins.vector.js%7Cuser.defaults&skin=vector&version=1u0x15s

I got an malformed URI sequenceat line 189 column number 472

At the same time I get from the stack

decoded@https://no.wikipedia.org/w/load.php?debug=false&lang=nb&modules=es5-shim%2Coojs%2Csite%7Cext.centralNotice.choiceData%2Cdisplay%2CgeoIP%2CimpressionDiet%2CkvStore%2CkvStoreMaintenance%2CstartUp%7Cext.centralauth.ForeignApi%7Cext.centralauth.centralautologin.clearcookie%7Cext.cite.a11y%7Cext.cx.campaigns.contributionsmenu%7Cext.cx.eventlogging%2Cinterlanguagelink%2Cmodel%2Csitemapper%2Cutil%7Cext.cx.widgets.callout%7Cext.echo.api%2Cinit%7Cext.eventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.eventLogging.subscriber%7Cext.gadget.hide-references%2Cref-toolbar%7Cext.uls.common%2Ccompactlinks%2Ceventlogger%2Cinit%2Cinterface%2Cpreferences%2Cwebfonts%7Cext.visualEditor.desktopArticleTarget.init%7Cext.visualEditor.supportCheck%2CtargetLoader%2Ctrack%2Cve%7Cext.wikimediaEvents.loggedin%7Cjquery.accessKeyLabel%2CbyteLength%2CcheckboxShiftClick%2Cclient%2Ccookie%2CgetAttrs%2ChighlightText%2Cmw-jump%2Csuggestions%2CtabIndex%2CtextSelection%2Cthrottle-debounce%7Cjquery.uls.data%7Cmed

This url is truncated, but it could be some kind of formatter for the stack in Firefox that truncate this.

I tracked down the bugs, and with a little help of @jhsoby the Mediawiki:Gadgets-definition was changed (diff). It is a bunch of missing dependencies (diff), and an old gadget that messes with pretty large cookies (diff). The later should probably be reimplemented with session storage.

There are also five gadgets that needs update because they use the deprecated jquery.ui interface.