docker-selenium icon indicating copy to clipboard operation
docker-selenium copied to clipboard

Docker for Mac beta - containers do not start

Open rnorth opened this issue 10 years ago • 26 comments

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.

rnorth avatar May 30 '16 07:05 rnorth

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

MartinNuc avatar May 31 '16 17:05 MartinNuc

@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 avatar May 31 '16 19:05 rnorth

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).

philjones88 avatar Jun 02 '16 13:06 philjones88

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

MartinNuc avatar Jun 03 '16 08:06 MartinNuc

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 avatar Jun 04 '16 07:06 rnorth

@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 avatar Jun 05 '16 19:06 rnorth

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.

MartinNuc avatar Jun 09 '16 11:06 MartinNuc

Docker version 1.11.1, build 5604cbe

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

using @MartinNuc trick worked.

tommyz0123 avatar Jun 10 '16 07:06 tommyz0123

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)

lukeaus avatar Jul 05 '16 11:07 lukeaus

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.

alexander-clark avatar Jul 24 '16 13:07 alexander-clark

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…

jamesottaway avatar Jul 24 '16 22:07 jamesottaway

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

nathanmarks avatar Aug 08 '16 13:08 nathanmarks

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

SergeyPirogov avatar Aug 15 '16 09:08 SergeyPirogov

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: https://github.com/SeleniumHQ/docker-selenium/pull/256 If you are using a regular chrome/FF container you should not see this issue.

gurukiran007 avatar Aug 16 '16 07:08 gurukiran007

Yes, problem only with Debug Containers.

SergeyPirogov avatar Aug 16 '16 07:08 SergeyPirogov

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 avatar Sep 29 '16 12:09 vikramvi

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

vikramvi avatar Sep 29 '16 15:09 vikramvi

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

ddavison avatar Oct 02 '16 07:10 ddavison

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

saradcd77 avatar Jan 03 '17 19:01 saradcd77

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

BeyondEvil avatar Mar 22 '17 11:03 BeyondEvil