Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VNC enabled container cannot start when env var SE_OPTS contains whitespace. #335

Closed
vimagick opened this issue Nov 23, 2016 · 7 comments
Closed

Comments

@vimagick
Copy link

vimagick commented Nov 23, 2016

I'm try to run selenium/node-chrome-debug with this docker-compose.yml:

chrome:
  image: selenium/node-chrome-debug
  ports:
    - "5555:5555"
    - "5900:5900"
  environment:
    - JAVA_OPTS=-Xmx512m
    - NODE_MAX_INSTANCES=2
    - NODE_MAX_SESSION=2
    - SE_OPTS=-host 1.2.3.4 -port 5555
    - HUB_PORT_4444_TCP_ADDR=5.6.7.8
    - HUB_PORT_4444_TCP_PORT=4444
  restart: always

I'm try to connect this node (1.2.3.4:5555) to remote hub (5.6.7.8:4444).

$ docker-compose up -d
Creating selenium_chrome_1

$ docker-compose logs -f
Attaching to selenium_chrome_1
chrome_1  | appending selenium options: -host 1.2.3.4 -port 5555
chrome_1  | Waiting xvfb...
chrome_1  | -bash: 1.2.3.4: command not found
chrome_1  | Waiting xvfb...
chrome_1  | Waiting xvfb...
chrome_1  | Waiting xvfb...

$ docker-compose ps
      Name                  Command             State                          Ports
---------------------------------------------------------------------------------------------------------
selenium_chrome_1   /opt/bin/entry_point.sh   Restarting   0.0.0.0:5555->5555/tcp, 0.0.0.0:5900->5900/tcp

I found that entry_point.sh cannot handle white-spaces inside $SE_OPTS very well.

@FelikZ
Copy link

FelikZ commented Nov 29, 2016

This is similar issue to this #249 , I bet.

@ddavison
Copy link
Member

ddavison commented Dec 1, 2016

out of curiosity, instead of specifying an array, have you also tried just an object?

...

environment:
    JAVA_OPTS: '-Xmx512m'
    NODE_MAX_INSTANCES: 2
    NODE_MAX_SESSION: 2
    SE_OPTS: '-host 1.2.3.4 -port 5555'
    HUB_PORT_4444_TCP_ADDR: 5.6.7.8
    HUB_PORT_4444_TCP_PORT: 4444

@vimagick
Copy link
Author

vimagick commented Dec 2, 2016

@ddavison I've tried environment object, the result is the same:

$ docker-compose up -d
Creating selenium_firefox_1

$ docker-compose logs -f
Attaching to selenium_firefox_1
firefox_1  | appending selenium options: -host 1.2.3.4 -port 5555
firefox_1  | Waiting xvfb...
firefox_1  | -bash: 1.2.3.4: command not found
firefox_1  | Waiting xvfb...
firefox_1  | Waiting xvfb...
firefox_1  | Waiting xvfb...

The problem is entry_point.sh will run this command:

SE_OPTS=-host 1.2.3.4 -port 5555 ... xvfb-run ... java ... -host 1.2.3.4 -port 5555

(1.2.3.4 is a command now, the rest are arguments of it).

@Zechtitus
Copy link

Zechtitus commented Dec 9, 2016

Ran into same thing.
I can get the node-chrome working, not the node-chrome-debug variant.

This is pretty much required for getting a remote node hooked up to a remote grid.

Found a similar issue that worked for handling the spaces in env vars here: https://github.com/SeleniumHQ/docker-selenium/pull/249/files

to get this working - you can make a the following changes:
chrome: image: selenium/node-chrome-debug:latest volumes: - $PWD/opt/bin/entry_point.sh:/opt/bin/entry_point.sh

and just copy the fixes that were made in that one merge request and put in in the folder as defined above ($PWD/op/bin/entry_point.sh) - hackish but will override the entry_point.sh until it is working (also chmod +x entry_point.sh is needed)

entry_point.sh

@vimagick
Copy link
Author

vimagick commented Dec 9, 2016

👍 I'll try it.

@Zechtitus
Copy link

@vimagick did this work for you? I'm still using my hacked file in the meantime... would be nice to have this fixed in the main project files

@diemol
Copy link
Member

diemol commented Apr 22, 2017

This was solved with #459, which was merged and released, this issue can be closed.

@lock lock bot locked and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants