nodejs-npm-run-test fails because of "No binary for Chrome browser on your platform"

Bug #1731421 reported by Akihiro Motoki
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Akihiro Motoki

Bug Description

nodejs-npm-run-test job fails with the following error:

2017-11-10 08:40:38.047617 | ubuntu-xenial | 10 11 2017 08:40:38.044:INFO [karma]: Karma v1.1.2 server started at http://localhost:9876/
2017-11-10 08:40:38.048797 | ubuntu-xenial | 10 11 2017 08:40:38.048:INFO [launcher]: Launching browser Chrome with unlimited concurrency
2017-11-10 08:40:38.056114 | ubuntu-xenial | 10 11 2017 08:40:38.056:INFO [launcher]: Starting browser Chrome
2017-11-10 08:40:38.057322 | ubuntu-xenial | 10 11 2017 08:40:38.057:ERROR [launcher]: No binary for Chrome browser on your platform.
2017-11-10 08:40:38.057372 | ubuntu-xenial | Please, set "CHROME_BIN" env variable.

http://logs.openstack.org/44/518844/1/check/nodejs-npm-run-test/19e8ef5/job-output.txt.gz#_2017-11-10_08_40_38_057322

Tags: gate-failure
Akihiro Motoki (amotoki)
Changed in horizon:
importance: Undecided → Critical
milestone: none → queens-2
tags: added: gate-failure
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/518870

Changed in horizon:
assignee: nobody → Akihiro Motoki (amotoki)
status: New → In Progress
Akihiro Motoki (amotoki)
Changed in horizon:
assignee: Akihiro Motoki (amotoki) → nobody
Revision history for this message
Akihiro Motoki (amotoki) wrote :

The failure happens after https://review.openstack.org/#/c/517770/ was merged.

After this, nodejs4-jobs uses nodejs-npm-run-test instead of legacy-nodejs4-npm-run-test.

This creates the following regressions:
- xvfb and chromium-browser are not installed
- "/usr/bin/Xvfb :99 -screen 0 ${DIMENSIONS} -ac +extension GLX +render -noreset 2>&1 > /dev/null &" is not called [1]

[1] http://git.openstack.org/cgit/openstack-infra/openstack-zuul-jobs/tree/playbooks/legacy/nodejs4-npm-run-test/run.yaml?id=4a484988151afe1de638c8a17db67e53e1912cf6#n105

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Akihiro Motoki (<email address hidden>) on branch: master
Review: https://review.openstack.org/518870
Reason: This looks unnecessary. for more detail see the bug comment.

Revision history for this message
Andreas Jaeger (jaegerandi) wrote :

Proposed fix https://review.openstack.org/518879 - testing in I40b7d019551c227e4b8a0e11366b1ce448d5bbed

Revision history for this message
Andreas Jaeger (jaegerandi) wrote :

Let's do a partial revert:
https://review.openstack.org/518881

Revision history for this message
Akihiro Motoki (amotoki) wrote :

The partial revert was merged, so it is no longer a critical issue.
However, the new job should be used soon, so it is still high.

Changed in horizon:
importance: Critical → High
assignee: nobody → Akihiro Motoki (amotoki)
Revision history for this message
Antoine "hashar" Musso (hashar) wrote :

Hello Andreas,

After all the reviews and useful comments you did for me, there is finally a time I think I can help.

For Wikimedia/MediaWiki we do use npm/Karma/Xvfb/Chromium. The tldr is:

  export CHROME_BIN=/usr/bin/chromium-browser
  https://github.com/karma-runner/karma-chrome-launcher/pull/41

The forensic version:

The log being:

| ubuntu-xenial
| No binary for Chrome browser on your platform.
| Please, set "CHROME_BIN" env variable.

Assuming your image has the chromium-browser package installed, the binary is /usr/bin/chromium-browser

karma-chrome-launcher should support chromium (instead of chrome) since 0.1.8. And on Windows/Mac since 2.0.0.

The fault is most probably that Karma is configured for "Chrome", that would be what is configured in the Horizon source repository. But it most definitely is NOT available in Ubuntu:

* Chrome is the Google browser with their "features"
* Chromium is the pure open source one. That is the one in Debian/Ubuntu.

Since developers usually have Chrome but you can't get it on the CI machine, you gotta to do some usurpation. For MediaWiki/Wikimedia, what we ended doing is to set CHROME_BIN ourselves:

  export CHROME_BIN=`which chromium-browser || which chromium`

https://gerrit.wikimedia.org/r/#/c/331110/1/bin/global-set-env.sh

(credits to Timo "Krinkle" Tijhof)

Or really just /usr/bin/chromium-browser

When Karma is configured to use Chrome, it would use CHROME_BIN if indicated, else try to find eg /usr/bin/chrome.

By pointing Chrome to Chromium, the source repo is still configured for Chrome which makes developers happy. And on CI you trick it in using Chromium.

Hope that helps!

Revision history for this message
Antoine "hashar" Musso (hashar) wrote :
Revision history for this message
Akihiro Motoki (amotoki) wrote :

After the partial revert, further effort to convert the legacy job to the modern style is being done.

- The main patch : https://review.openstack.org/#/c/518879/
  (tested by https://review.openstack.org/518880)
- https://review.openstack.org/#/c/520338/ drops the legacy jobs.

Revision history for this message
Akihiro Motoki (amotoki) wrote :

As horizon perspective, the gate fix has been fixed, so let's mark it as Fix Released.

Changed in horizon:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.