Page MenuHomePhabricator

Merge blocker: TypeError: Cannot read property 'Infobar' of undefined
Closed, ResolvedPublic

Description

Error: TypeError: Cannot read property 'Infobar' of undefined happening in the quibble-vendor-mysql-hhvm-docker job. For example https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-hhvm-docker/41981/console

Happens every time. Other jobs pass. Doing a diff between this job and wmf-quibble-vendor-mysql-hhvm-docker the following extra extensions are present in the failing job (there are also extension not present, but that sounds less likely cause):

mediawiki/extensions/AntiSpoof
mediawiki/extensions/ArticlePlaceholder
mediawiki/extensions/BetaFeatures
mediawiki/extensions/Capiunto
mediawiki/extensions/CentralAuth
mediawiki/extensions/EducationProgram
mediawiki/extensions/LiquidThreads
mediawiki/extensions/MassMessage
mediawiki/extensions/PropertySuggester
mediawiki/extensions/Renameuser
mediawiki/extensions/Scribunto
mediawiki/extensions/SyntaxHighlight_GeSHi
mediawiki/extensions/TitleBlacklist
mediawiki/extensions/UserMerge
mediawiki/extensions/WikibaseLexeme
mediawiki/extensions/WikibaseMediaInfo
mediawiki/extensions/WikibaseQualityConstraints
mediawiki/extensions/WikimediaBadges
mediawiki/extensions/WikimediaEvents

There also messages like Cannot read property 'Translation' of undefined\n at HTMLDivElement coming from jquery.wikibase.entitysearch that are not present in the successful job. That seems a lead... perhaps not the cause but symptom of a common cause, since Wikibase extension is present on both jobs.

Impact: Blocks merges to ContentTranslation

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 29 2019, 6:48 PM
Nikerabbit triaged this task as Unbreak Now! priority.Mar 29 2019, 6:49 PM
Restricted Application added subscribers: Liuxinyu970226, TerraCodes. · View Herald TranscriptMar 29 2019, 6:49 PM

First failure I could find was at Mar 22, 2019, 22:19:49 UTC+02:00 and last passing before that was Mar 21, 2019, 20:19:41 UTC+02:00.

The output is not from QUnit, but from the browser console.

It is appearing close to jquery.wikibase.entitysearch from QUnit, but I don't think it is related to that. It's an unfortunate side effect from how the different programs all write to standard out at the same time.

 MobileFrontend TalkSectionOverlay.js - anonymous (logged out)
    ✔ …

DEBUG [middleware:source-files]: Requesting /extensions/ContentTranslation/tests/qunit/data/dm-translation-source-article.html

  jquery.wikibase.entitysearch
    ✔ Create & destroy

HeadlessChrome 72.0.3626 (Linux 0.0.0) ERROR
  {
    "message": "
Uncaught TypeError: Cannot read property 'Translation' of undefined
   at http://localhost:9876/load.php?…
   at HTMLDivElement.<anonymous> (http:…

Note that it does not output any failed test from Wikibase. It simply shows no further output.

This means the exception is likely coming from the "next" test, which QUnit hasn't printed yet.

I believe this might be correlated to ContentTranslation:…/mw.cx.dm.Translation.test.js

testDataPath =  '/ContentTranslation/tests/qunit/data/dm-translation-source-article.html';

	QUnit.test( 'Source and target dom build test', function ( assert ) {
		var $fixture = $( '#qunit-fixture' ),
			done = assert.async();
		$fixture.load( testDataPath, function () {
			
			sourceDom = mw.cx.dm.Translation.static.getSourceDom(  )
			                   ^ undefined

As far as I can see the test has proper dependencies to mw.cx.dm.Translation should be defined (or some other failure would have had to be occured during loading and logged). It also hasn't changed in a while.

Infobar should exist in mw.cx.ui.Infobar. Would it be possible that something is overwriting mw.cx? Such as ArticlePlaceHolder in https://codesearch.wmflabs.org/search/?q=mw%5C.cx%20%3D&i=nope&files=&repos= which is also one mentioned in my list above. Would the execution order matter?

I can reproduce the failure when ArticlePlaceholder is installed. Krinkle was also right about the failure. At that point only mw.cx.Sitemapper is defined.

Restricted Application added a project: Wikidata. · View Herald TranscriptMar 29 2019, 7:35 PM

This presumably started with rCICF53185ed59d05: Add ArticlePlaceholder to Wikibase Tests / https://gerrit.wikimedia.org/r/#/c/integration/config/+/485753/.

Zuul config for ContentTranslation installs Wikibase, which in turn, as of the above change, also installs ArticlePlaceholder.

Actually, no, it started with https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/ArticlePlaceholder/+/444936/.

That job passed because ContentTranslation commits install Wikibase+ArticlePlaceholder. But commits for ArticlePlaceholder do not install ContentTranslation.

Change 500112 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/ArticlePlaceholder@master] Fix broken sinon.stub use in createArticleTranslation.test.js

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

Tarrow added a subscriber: Tarrow.Apr 1 2019, 8:47 AM

I'm taking a look at this from the WMDE side. Thanks both of you for digging into this.

Right now it looks to me like https://gerrit.wikimedia.org/r/500112 for fixing the stub should be enough.

It doesn't look to me like there was originally an intention in ArticlePlaceholder to require ContentTranslation but rather was always there as an optional dependency so I don't think we need to add ContentTranslation to always be loaded with the Article placeholder tests.

Change 500112 merged by jenkins-bot:
[mediawiki/extensions/ArticlePlaceholder@master] Fix broken sinon.stub use in createArticleTranslation.test.js

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

Krinkle closed this task as Resolved.Apr 1 2019, 3:44 PM
Krinkle claimed this task.
Krinkle added a project: Performance-Team.