WDQS GUI build fails on CI
Closed, ResolvedPublic

Description

When building WDQS with newest GUI, I get this:

01:24:39 [INFO] Running "qunit:all" (qunit) task
01:24:39 [INFO] >> There was an error with headless chrome
01:24:39 [INFO] Fatal error: Failed to launch chrome!
01:24:39 [INFO] /src/gui/node_modules/puppeteer/.local-chromium/linux-579032/chrome-linux/chrome: error while loading shared libraries: libXcursor.so.1: cannot open shared object file: No such file or directory
01:24:39 [INFO] 
01:24:39 [INFO] 
01:24:39 [INFO] TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
01:24:39 [INFO] 
01:24:39 [ERROR] npm ERR! Test failed.  See above for more details.

Example: https://integration.wikimedia.org/ci/job/wikidata-query-rdf-maven-java8-docker/579/console

Using: docker-registry.wikimedia.org/releng/java8-wikidata-query-rdf:0.1.2 clean verify

I suspect it has something to do with newest changes in the GUI.

Restricted Application added a project: Wikidata. · View Herald TranscriptSat, Nov 17, 11:58 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
hashar updated the task description. (Show Details)Mon, Nov 19, 3:32 PM
hashar added a subscriber: hashar.Mon, Nov 19, 3:40 PM

grunt-contrib-qunit 0.3.0 migrates from PhantomJS to Chrome using Puppeteer. So we can probably drop PhantomJS from the container.

Puppeteer download a fixed version of Chrome from somewhere but it obviously does not install any shared libraries. Adding the chromium package to the container should bring all required dependencies. Or at least enough dependencies so that a downloaded Chrome would be all happy.

$ apt-file search libXcursor.so.1
libxcursor1: /usr/lib/x86_64-linux-gnu/libXcursor.so.1
$ apt-cache depends chromium|grep libxcur
  Depends: libxcursor1

mediawiki/services/chromium-render uses Puppeter as well, it is intended to be run on production and CI injects PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true to prevent downloading Chrome. Instead I guess it uses Chromium provided by Debian. It would be interesting to reuse the same logic there to save on downloading Chrome over and over on each build, but it might not be compatible with puppeteer / grunt-contrib-qunit. Probably node-contrib-qunit depends on a specific version of Puppeteer which in turns might only work with a specific version of Chrome and not with the Chromium version from Debian.

The change got updated to pass options to puppeteer / Chrome: https://gerrit.wikimedia.org/r/#/c/wikidata/query/gui/+/472969/1..2/Gruntfile.js , namely disable Chrome sandbox :) Kudos.

The build is still failing. Is there somebody that should do something, and if so, who and what?

Smalyshev triaged this task as High priority.Wed, Nov 21, 11:47 PM

Change 475298 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] docker: add Chrome deps to java8-wikidata-query-rdf

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

Change 475298 merged by jenkins-bot:
[integration/config@master] docker: add Chrome deps to java8-wikidata-query-rdf

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

Mentioned in SAL (#wikimedia-releng) [2018-11-22T10:34:28Z] <hashar> Building container releng/java8-wikidata-query-rdf:0.2.0 to support Chrome ( https://gerrit.wikimedia.org/r/#/c/integration/config/+/475298/ | T209776 )

Change 475305 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] Switch Jenkins job to releng/java8-wikidata-query-rdf:0.2.0

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

I eventually though the issue got fixed but that was for the gui repository.

For the rdf repository, I have added the chromium Debian package which would bring all system dependencies, hopefully fulfilling the ones required by the Chrome version downloaded by Puppetteer.

I have rebased the rdf change which update the GUI https://gerrit.wikimedia.org/r/#/c/wikidata/query/rdf/+/474391/4 . It still fails though: https://integration.wikimedia.org/ci/job/wikidata-query-rdf-maven-java8-docker/607/console

The job now crashes with:

[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?

The job used to run the container docker-registry.wikimedia.org/releng/java8-wikidata-query-rdf:0.1.2, 0.1.3 got skipped which updated openjdk-8-jre-headless from 8u151-b12-1~deb9u1 to 8u181-b13-2~deb9u1. I know that Java update caused issues with Surefire ( T208377 ) might be related.

Change 475334 had a related patch set uploaded (by Hashar; owner: Hashar):
[wikidata/query/rdf@master] Fix pom.xml for SureFire issue

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

hashar claimed this task.Thu, Nov 22, 3:26 PM

The summary:

  • The new GUI failed due to the lack of some Chrome system dependencies. Chrome is downloaded by grunt-contrib-qunit / puppeter. The container now install (tag 0.2.0 the chromium Debian packages which bring in all system dependencies). Stas change https://gerrit.wikimedia.org/r/#/c/wikidata/query/rdf/+/474391/ should be working now.

Change 475305 merged by jenkins-bot:
[integration/config@master] Switch Jenkins job to releng/java8-wikidata-query-rdf:0.2.0

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

hashar added a subscriber: pmiazga.Thu, Nov 22, 9:23 PM
/src/gui/node_modules/puppeteer/.local-chromium/linux-579032/chrome-linux/chrome:
error while loading shared libraries: libatk-bridge-2.0.so.0: cannot open shared object file: No such file or directory

I guess I will just add the missing package :-/ We have hit similar issue with mediawiki/services/chromium-renderer T180037#3760625 has some explanations. Eventually Puppeteer since 1.7.0 releases two node modules on npmjs:

  • puppeteer: which downloads chrome
  • puppeteer-core which is just the library

puppeteer can be instructed to skip downloading by setting the environment variable PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 then configure puppeter executable path if CHROME_BIN is defined. An example is: 594e80725e318b80b3fa2e4b42f7a5a9fc2119e6

Eventually @pmiazga bumped that repository to use Puppeteer 1.7.0 (the same that grunt-contrib-qunit is using): 7bcecd5e4d62cd1284fed6716fb9502198f870fe but it hardcodes the path :/

But Puppeteer 1.9.0 comes with a way to override the chrome executable path via PUPPETEER_EXECUTABLE_PATH cffdd76920691ce3ac902d74c2ff6d2e2621c595

Change 475427 had a related patch set uploaded (by Hashar; owner: Hashar):
[wikidata/query/gui@master] When set, use CHROME_BIN as Puppeteer ExecutablePath

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

Change 475428 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] docker: puppeteer tweaks for java8-wikidata-query-rdf

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

Summary

https://gerrit.wikimedia.org/r/#/c/wikidata/query/gui/+/475427/ would set Puppeteer ExcecutablePath when CHROME_BIN is set.

https://gerrit.wikimedia.org/r/#/c/integration/config/+/475428/ updates the Docker container:

  • Set CHROME_BIN=/usr/bin/chromium
  • Prevent Puppeteer from downloading Chrome
  • Set PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium which is recognized by Puppeteer 1.8.0+ (and in turn would allow us to revert the gui patch above).

Change 475427 merged by jenkins-bot:
[wikidata/query/gui@master] When set, use CHROME_BIN as Puppeteer ExecutablePath

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

Change 475431 had a related patch set uploaded (by WDQSGuiBuilder; owner: WDQSGuiBuilder):
[wikidata/query/gui-deploy@production] Merging from 50df741fab96004cbc14b5bcde586d99aec408d5:

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

Change 475334 merged by jenkins-bot:
[wikidata/query/rdf@master] Fix pom.xml for SureFire issue

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

Change 475428 merged by jenkins-bot:
[integration/config@master] docker: puppeteer tweaks for java8-wikidata-query-rdf

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

Mentioned in SAL (#wikimedia-releng) [2018-11-23T10:29:04Z] <hashar> Building releng/java8-wikidata-query-rdf:0.2.1 container for https://gerrit.wikimedia.org/r/#/c/integration/config/+/475428/ T209776

Change 475452 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] Switch Jenkins job to releng/java8-wikidata-query-rdf:0.2.1

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

Change 475452 merged by jenkins-bot:
[integration/config@master] Switch Jenkins job to releng/java8-wikidata-query-rdf:0.2.1

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