Public bug reported:

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

** Affects: horizon
     Importance: Undecided
         Status: New

-- 
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):
  New

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

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to