← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1684321] Re: tox -e npm fails to start Chrome

 

Reviewed:  https://review.openstack.org/459418
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=989e10e7a5e6d81a961fffe973330e0251961c4d
Submitter: Jenkins
Branch:    master

commit 989e10e7a5e6d81a961fffe973330e0251961c4d
Author: Jack Choy <jack.likes.to.code@xxxxxxxxx>
Date:   Thu Apr 20 16:37:49 2017 -0700

    Allow Chrome to start when tox is running npm
    
    Chrome in *nix environments requires the HOME and DISPLAY variables
    to be set for Chrome to start properlyi when running the 'npm' rule.
    The HOME variable is needed so Chrome can load up the user's
    preferences.  The DISPLAY variable is needed so it know what display
    to launch Chrome into.
    
    Change-Id: I84f4d1d47f065158e8f5bf5691c241061cc16aab
    Closes-Bug: #1684321


** Changed in: horizon
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1684321

Title:
  tox -e npm fails to start Chrome

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  When running 'tox -e npm' on Ubuntu, Chrome fails to start with the
  following error:

  19 04 2017 16:34:15.249:INFO [karma]: Karma v1.1.2 server started at http://localhost:9876/
  19 04 2017 16:34:15.251:INFO [launcher]: Launching browser Chrome with unlimited concurrency
  19 04 2017 16:34:15.261:INFO [launcher]: Starting browser Chrome
  19 04 2017 16:34:15.461:ERROR [launcher]: Cannot start Chrome
  	
  19 04 2017 16:34:15.468:INFO [launcher]: Trying to start Chrome again (1/2).
  19 04 2017 16:34:15.809:ERROR [launcher]: Cannot start Chrome
  	
  19 04 2017 16:34:15.810:INFO [launcher]: Trying to start Chrome again (2/2).
  19 04 2017 16:34:16.415:ERROR [launcher]: Cannot start Chrome
  	
  19 04 2017 16:34:16.416:ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up.

  If you revise the [testenv:npm] rule to start chrome first, you'll see
  why it failed:

  grep: write error
  mkdir: cannot create directory ‘/.local’: Permission denied
  touch: cannot touch ‘/.local/share/applications/mimeapps.list’: No such file or directory
  [7633:7633:0419/163528:ERROR:browser_main_loop.cc(267)] Gtk: cannot open display: 

  Obviously, the permission denied error is valid in that you shouldn't
  be able to create a directory off of root.  What's missing is the
  $HOME preceding the directory name.

  The second problem is due to an unset DISPLAY variable needed when
  running this in *nix environments.

  This tells me Chrome needs at least $HOME and $DISPLAY, but it is not
  set because tox only passes the PATH variable in *nix environments as
  mentioned in http://tox.readthedocs.io/en/latest/example/basic.html

  To fix this, we can add the following lines to the [testenv:npm] section:
  passenv =
    HOME
    DISPLAY

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1684321/+subscriptions


References