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

Docker for Mac beta - containers do not start #227

Closed
rnorth opened this issue May 30, 2016 · 26 comments · Fixed by #249
Closed

Docker for Mac beta - containers do not start #227

rnorth opened this issue May 30, 2016 · 26 comments · Fixed by #249

Comments

@rnorth
Copy link

rnorth commented May 30, 2016

I think this is potentially, mainly, a Docker for Mac issue, but I'm raising here for visibility and because a fix may be possible on this side.

Here's the issue I've raised in the Docker forums: https://forums.docker.com/t/space-in-new-no-proxy-env-var-breaking-old-containers/14075

In brief:

  • Recent versions of Docker for Mac seem to be adding a new environment variable, no_proxy, which contains whitespace: no_proxy=*.local, 169.254/16
  • The entrypoint script for the version of selenium containers I have doesn't properly handle spaces environment variables, causing containers to fail to startup:
Waiting xvfb...
-bash: 169.254/16: No such file or directory
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...

To see this, with Docker for Mac beta 13 run:

$ docker run selenium/standalone-chrome-debug:2.52.0 env

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=0d98e7c76683
no_proxy=*.local, 169.254/16
DEBIAN_FRONTEND=noninteractive
DEBCONF_NONINTERACTIVE_SEEN=true
TZ=US/Pacific
SCREEN_WIDTH=1360
SCREEN_HEIGHT=1020
SCREEN_DEPTH=24
DISPLAY=:99.0
CHROME_DRIVER_VERSION=2.20
LANGUAGE=en_US.UTF-8
LANG=en_US.UTF-8
HOME=/root

This line of the entrypoint script seems to need some extra work to deal with spaces in env vars: https://github.com/SeleniumHQ/docker-selenium/blob/master/StandaloneChromeDebug/entry_point.sh#L21

I'll try and submit a patch if I can, but I'd hope the primary fix can be made in the Docker side.

@MartinNuc
Copy link

I am having the same issue. Unfortunately overriding it with -e no_proxy="" doesnt work :(

@rnorth
Copy link
Author

rnorth commented May 31, 2016

@MartinNuc actually looking at how I worked around it, I set the no_proxy value to localhost rather than an empty string. Maybe that makes a difference?

On trying to reproduce this tonight, it looks like this has indeed been fixed in Beta 13.1. I now have a version string of: Version 1.11.1-beta13.1 (build: 8193)

This doesn't seem to be injecting a broken no_proxy env var any more.

@rnorth rnorth closed this as completed May 31, 2016
@philjones88
Copy link

I'm on version: Version 1.11.1-beta13.1 (build: 8193) and this issue seems to happen to me. Using the debug version of node-chrome (node-chrome-debug).

@MartinNuc
Copy link

I experience this behaviour in Version 1.11.1-beta13.1 (build: 8193).

Using -e no_proxy=localhost has no effect :-(

I am using this command: docker run -d -P -p 5900:5900 --name selenium-node-firefox -e no_proxy=localhost --link selenium-hub:hub selenium/node-firefox-debug:2.53.0

@rnorth
Copy link
Author

rnorth commented Jun 4, 2016

This is strange - I was launching via an API rather than docker run, so perhaps there's some difference there. I'll go back and try and figure out what's going on!

@rnorth rnorth reopened this Jun 4, 2016
@rnorth
Copy link
Author

rnorth commented Jun 5, 2016

@MartinNuc I've checked through the CLI as well as the API - things seem to be working for me setting no_proxy to localhost. My Docker for Mac version string is Version 1.11.1-beta13.1 (build: 8193) e9f58bbe60f0debccc097b7d27cad200556ec6f5...

What do you get from executing these commands:

docker run selenium/standalone-chrome-debug:2.53.0 env

and

docker run -e "no_proxy=localhost" selenium/standalone-chrome-debug:2.53.0 env

?

My output is:

$ docker run selenium/standalone-chrome-debug:2.53.0 env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=39665a2d708e
no_proxy=*.local, 169.254/16
DEBIAN_FRONTEND=noninteractive
DEBCONF_NONINTERACTIVE_SEEN=true
TZ=US/Pacific
SCREEN_WIDTH=1360
SCREEN_HEIGHT=1020
SCREEN_DEPTH=24
DISPLAY=:99.0
CHROME_DRIVER_VERSION=2.21
DBUS_SESSION_BUS_ADDRESS=/dev/null
LANGUAGE=en_US.UTF-8
LANG=en_US.UTF-8
HOME=/root
$ docker run -e "no_proxy=localhost" selenium/standalone-chrome-debug:2.53.0 env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=524027ad54de
no_proxy=localhost
DEBIAN_FRONTEND=noninteractive
DEBCONF_NONINTERACTIVE_SEEN=true
TZ=US/Pacific
SCREEN_WIDTH=1360
SCREEN_HEIGHT=1020
SCREEN_DEPTH=24
DISPLAY=:99.0
CHROME_DRIVER_VERSION=2.21
DBUS_SESSION_BUS_ADDRESS=/dev/null
LANGUAGE=en_US.UTF-8
LANG=en_US.UTF-8
HOME=/root

If I omit the env command, the container starts up when I set no_proxy but fails (with the error above) when I don't set it.

rnorth added a commit to testcontainers/testcontainers-java that referenced this issue Jun 5, 2016
@MartinNuc
Copy link

MartinNuc commented Jun 9, 2016

Sorry for late reply. I was sick for few days.

Meanwhile I upgraded to Docker version 1.11.1, build 5604cbe

Tried again -e and indeed it changed env:

docker run -P -p 5900:5900 -e "no_proxy=localhost" --link selenium-hub:hub selenium/node-firefox-debug:2.53.0 env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=18c7ea1a4e19
HUB_PORT=tcp://172.17.0.2:4444
HUB_PORT_4444_TCP=tcp://172.17.0.2:4444
HUB_PORT_4444_TCP_ADDR=172.17.0.2
HUB_PORT_4444_TCP_PORT=4444
HUB_PORT_4444_TCP_PROTO=tcp
HUB_NAME=/drunk_wescoff/hub
HUB_ENV_no_proxy=*.local, 169.254/16
HUB_ENV_GRID_NEW_SESSION_WAIT_TIMEOUT=-1
HUB_ENV_GRID_JETTY_MAX_THREADS=-1
HUB_ENV_GRID_NODE_POLLING=5000
HUB_ENV_GRID_CLEAN_UP_CYCLE=5000
HUB_ENV_GRID_TIMEOUT=30000
HUB_ENV_GRID_BROWSER_TIMEOUT=0
HUB_ENV_GRID_MAX_SESSION=5
HUB_ENV_GRID_UNREGISTER_IF_STILL_DOWN_AFTER=30000
no_proxy=localhost
DEBIAN_FRONTEND=noninteractive
DEBCONF_NONINTERACTIVE_SEEN=true
TZ=US/Pacific
SCREEN_WIDTH=1360
SCREEN_HEIGHT=1020
SCREEN_DEPTH=24
DISPLAY=:99.0
FIREFOX_VERSION=45.0.2
LANGUAGE=en_US.UTF-8
LANG=en_US.UTF-8
HOME=/root

However there is another env with space: HUB_ENV_no_proxy=*.local, 169.254/16 (i am using hub+nodes mode)

So using -e no_proxy=localhost -e HUB_ENV_no_proxy=localhost did the trick :-) Thank you for assistance.

@tommyz0123
Copy link

Docker version 1.11.1, build 5604cbe

happen for the debug versions, none debug seems to work fine.

using @MartinNuc trick worked.

rnorth added a commit to testcontainers/testcontainers-java that referenced this issue Jul 3, 2016
rnorth added a commit to testcontainers/testcontainers-java that referenced this issue Jul 3, 2016
@lukeaus
Copy link

lukeaus commented Jul 5, 2016

I had the same problem - setting -e no_proxy=localhost fixes the issue using standalone-firefox-debug:2.52.0 on osx using docker for mac (beta) version 1.12.0-rc2-beta17 (build: 9779)

@alexander-clark
Copy link

Just in case this is helpful to someone else, I encountered this issue using docker-compose on Docker Beta for OSX. In order to get it working, I had to specify the env var not only for my selenium container, but for each of the containers it linked.

@jamesottaway
Copy link
Contributor

jamesottaway commented Jul 24, 2016

According to the official Docker for Mac forums this has been resolved: https://forums.docker.com/t/space-in-new-no-proxy-env-var-breaking-old-containers/14075/2

I've tested the fix (upgrade to the latest version, then reset to factory defaults) and was able to remove the workaround from my docker-compose.yml, so hopefully others can confirm whether it's fixed for them too.

Just keep in mind you lose all local images and containers when you reset to factory defaults…

EDIT: Maybe I spoke too soon. It just came back somehow, so I did a factory reset again and now it's gone. Not sure what's happening…

@nathanmarks
Copy link

nathanmarks commented Aug 8, 2016

FWIW I am running these containers in Docker for Mac with no problem right now.

@SergeyPirogov
Copy link

SergeyPirogov commented Aug 15, 2016

Faced with problem on Mac. Docker version 1.12.0, build 8eab29e.

This helped as workaround:

-e no_proxy=localhost -e HUB_ENV_no_proxy=localhost

@gurukiran007
Copy link

Guys the issue reported was seen on the Debug container and its due to entrypoint looking for a file created by root but as seluser when updating the password. This pull req should solve it:
#256
If you are using a regular chrome/FF container you should not see this issue.

@SergeyPirogov
Copy link

Yes, problem only with Debug Containers.

schmunk42 added a commit to dmstr/docker-acception that referenced this issue Sep 28, 2016
@vikramvi
Copy link

vikramvi commented Sep 29, 2016

I'm having Mac mini ( 10.10.5 ) with docker 1.12.1 ( build: 121333)

I tried below and didn't work

docker run -P -p 5901:5900 -e no_proxy=localhost -e HUB_ENV_no_proxy=localhost --link selenium-hub:hub selenium/standalone-chrome-debug:2.53.0

it hung with last message

Setting default value
Failed to read: session.screen0.iconbar.iconTextPadding
Setting default value
Failed to read: session.screen0.iconbar.usePixmap
Setting default value

@vikramvi
Copy link

Got it working with below command

docker run -d -P -e no_proxy=localhost -e HUB_ENV_no_proxy=localhost --link selenium-hub:hub selenium/node-chrome-debug

@ddavison
Copy link
Member

ddavison commented Oct 2, 2016

since this is on Docker's side, closing. once an update comes out for docker, we can ensure that this is indeed fixed.

@saradcd77
Copy link

saradcd77 commented Jan 3, 2017

I am having issue linking selenium/node-chrome with selenium/hub in Mac OS.

docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
selenium/node-firefox latest ebb546f58b4b 2 weeks ago 638.5 MB
selenium/node-chrome latest a0a996ba56a1 2 weeks ago 794.2 MB
selenium/hub latest 5079a24eb3bb 2 weeks ago 321 MB
Sarads-MBP:~ saraddhungel$ docker run -d -P —link selenium-hub:hub selenium/node-chrome-debug
docker: Error parsing reference: "—link" is not a valid repository/tag.
See 'docker run --help'.
Sarads-MBP:~ saraddhungel$ docker run -d -P —link selenium-hub:hub selenium/node-chrome-debug

@BeyondEvil
Copy link
Contributor

I'm seeing the same issue, seems to not like spaces on osx:

LC02T26AAGTFM:Downloads jimb$ docker run -p 5555:5555 -p 5900:5900 -e HUB_PORT_4444_TCP_ADDR=172.17.42.1 -e HUB_PORT_4444_TCP_PORT=4444 -e SE_OPTS="-host 172.17.42.1" ppselenium/node-firefox-debug:2.53.1-binks
appending selenium options: -host 172.17.42.1
Waiting xvfb...
-bash: 172.17.42.1: command not found
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
Waiting xvfb...
LC02T26AAGTFM:Downloads jimb$

meta:
LC02T26AAGTFM:Downloads jimb$ docker version
Client:
Version: 17.03.0-ce
API version: 1.24 (downgraded from 1.26)
Go version: go1.8
Git commit: 60ccb22
Built:
OS/Arch: darwin/amd64

Server:
Version: 1.12.3
API version: 1.24 (minimum version )
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 23:26:11 2016
OS/Arch: linux/amd64
Experimental: false

@saradcd77
Copy link

Please use this command :
First expose the port using :
docker run -d -p 4446:4444 -name selenium-hub -P selenium/hub
Then to link the hub to the node:
docker run -d -P -e no_proxy=localhost -e HUB_ENV_no_proxy=localhost --link selenium-hub-P:hub selenium/node-chrome.

@BeyondEvil
Copy link
Contributor

So the issue for me is SE_OPTS, not no_proxy.

The offending bit of code is: env | cut -f 1 -d "=" | sort > asroot

Suggested fix is to change it to env | cut -f 1 -d "=" | grep -v SE_OPTS | sort > asroot

@saradcd77
Copy link

saradcd77 commented Mar 23, 2017 via email

@sandeep540
Copy link

@saradcd77 , I got this issue

$ docker run -d -P -e no_proxy=localhost -e HUB_ENV_no_proxy=localhost --link selenium-hub-P:hub selenium/node-chrome
docker: Error response from daemon: Could not get container for selenium-hub-P.

@saradcd77
Copy link

@sandeep540, Not sure if you were able to fix the issue already. Did you tried to expose the ports prior before linking them?
You might want to name the port first, expose them so that it can be excessed by your code and then you set up the nodes and link it to the hubs.

@diemol
Copy link
Member

diemol commented Apr 20, 2017

@sandeep540's command's error says:
docker: Error response from daemon: Could not get container for selenium-hub-P

Did you start the hub?
docker run -d -p 4446:4444 -name selenium-hub -P selenium/hub

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.