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

Starting eclipse che with parameters in docker outputs "You are missing a mandatory parameter" #3955

Closed
koustuvsinha opened this Issue Jan 31, 2017 · 36 comments

Comments

Projects
None yet
@koustuvsinha
Copy link

koustuvsinha commented Jan 31, 2017

Reproduction Steps:

I am trying to run eclipse che following the documentation. Upon providing the command :

docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/docker eclipse/che start

Always provides this output:

INFO: Welcome to Eclipse Che!
INFO:
INFO: You are missing a mandatory parameter:
INFO:    1. Mount 'docker.sock' for accessing Docker with unix sockets.
INFO:    2. Or, set DOCKER_HOST to Docker's daemon location (unix or tcp).
INFO:
INFO: Mount Syntax:
INFO:    Start with 'docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock' ...
INFO:
INFO: DOCKER_HOST Syntax:
INFO:    Start with 'docker run -it --rm -e DOCKER_HOST=<daemon-location> ...'

Which I do not understand as I am explicitly providing the same parameters.

OS and version:

Ubuntu 16.04

I am new to docker. Point to note that I am not the sudo user, my user just have been added to docker group.

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Jan 31, 2017

Your syntax is missing the :/data with the volume mount :)

@koustuvsinha

This comment has been minimized.

Copy link

koustuvsinha commented Jan 31, 2017

@TylerJewell done that same issue :(

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Jan 31, 2017

Let's get more explicit - if you use the eclipse/che:nightly image, do you have the same result? Also, make sure you wipe all of your images just as a confirmation.

@koustuvsinha

This comment has been minimized.

Copy link

koustuvsinha commented Jan 31, 2017

$ docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/data eclipse/che:nightly start
Unable to find image 'eclipse/che:nightly' locally
nightly: Pulling from eclipse/che
f4b850b0e9c8: Pull complete
b273535d1b7b: Pull complete
2ec627760ca0: Pull complete
db9a3af77a21: Pull complete
e9d303c88565: Pull complete
6f8afccfec17: Already exists
b31782ce6cc6: Already exists
53ac0122da52: Already exists
a15b321426a7: Already exists
76bd9d1152d5: Already exists
Digest: sha256:9580aa744e8abcb48a12ce8f64a7a9d24b765beba6613d43bbe2c08ce418d958
Status: Downloaded newer image for eclipse/che:nightly
INFO: Welcome to Eclipse Che!
INFO:
INFO: You are missing a mandatory parameter:
INFO:    1. Mount 'docker.sock' for accessing Docker with unix sockets.
INFO:    2. Or, set DOCKER_HOST to Docker's daemon location (unix or tcp).
INFO:
INFO: Mount Syntax:
INFO:    Start with 'docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock' ...
INFO:
INFO: DOCKER_HOST Syntax:
INFO:    Start with 'docker run -it --rm -e DOCKER_HOST=<daemon-location> ...'

Same issue

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Jan 31, 2017

That particular error occurs because we are not able to reach the Docker daemon. I suspect that it is because your user is not in the right Docker group. Can you try it as sudo?

Are you able to determine the tcp address of your Docker daemon and then connect to it using a -e DOCKER_HOST=tcp://:2375?

@koustuvsinha

This comment has been minimized.

Copy link

koustuvsinha commented Jan 31, 2017

you mean adding -e DOCKER_HOST=tcp://0.0.0.0:2375 ? I get an error "Cannot connect to the Docker daemon. Is the docker daemon running on this host?"

@koustuvsinha

This comment has been minimized.

Copy link

koustuvsinha commented Jan 31, 2017

also I do not have sudo privileges. my sysadmin just added my user to docker group

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Jan 31, 2017

You need to get from your admin how you can connect to the Docker daemon. It's usually like tcp://127.0.0.1:2375. We need direct access to the daemon to be able to launch other containers. Usually this is mounting a unix socket, but it seems that your user does not have appropriate permissions.

This is the check that we are doing which is failing on your system:
https://github.com/eclipse/che/blob/master/dockerfiles/base/scripts/base/docker.sh#L218-L233

@koustuvsinha

This comment has been minimized.

Copy link

koustuvsinha commented Jan 31, 2017

that is strange. If i do docker ps then I am able to view the current running containers. then why is the line https://github.com/eclipse/che/blob/master/dockerfiles/base/scripts/base/docker.sh#L219 failing? 😕

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Jan 31, 2017

Because that line is running inside of another container. So what is happening is we are testing if (inside a container) can we gain access to the Docker Daemon. Inside of the CLI is another OS and different configuration settings. So you have to pass in your docker configuration on the command line to enable our docker client inside to connect to the daemon outside.

@koustuvsinha

This comment has been minimized.

Copy link

koustuvsinha commented Jan 31, 2017

ah i get it. anyway to get that configuration from docker command line?

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Jan 31, 2017

Start with docker info.

@koustuvsinha

This comment has been minimized.

Copy link

koustuvsinha commented Jan 31, 2017

Doing a simple ps aux | grep docker leads me to this :

root   /usr/bin/docker -d --dns 8.8.8.8 --dns 8.8.4.4
root   docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8004 -container-ip 172.17.0.51 -container-port 8888

So I guess the tcp ip is 0.0.0.0 . However passing -e DOCKER_HOST=tcp://0.0.0.0:2375 still not works

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Jan 31, 2017

You need to use your actual IP address for Docker. Usually what is bound to docker0 or eth0.

@koustuvsinha

This comment has been minimized.

Copy link

koustuvsinha commented Jan 31, 2017

I guess the issue is this as I see no daemons listening on port 2375.

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Jan 31, 2017

It's possible that your sys admins have prevented all access to the Daemon. It can be seen that accessing the docker socket means that we can launch other types of containers on the system. But this sort of access is necessary because after Che starts, each ws is itself other containers, and we need to control the Daemon to do it.

@koustuvsinha

This comment has been minimized.

Copy link

koustuvsinha commented Jan 31, 2017

right. thanks for the help, seems like i have to convince sysadmin to bind it in a specific port

@eivantsov

This comment has been minimized.

Copy link
Member

eivantsov commented Jan 31, 2017

@koustuvsinha try setting permissions for /var/run/docker.sock smth like 777. I wonder if it helps.

@Virtlink

This comment has been minimized.

Copy link

Virtlink commented Feb 1, 2017

I have the same issue when I follow the instructions here:

$ docker run -it eclipse/che start

INFO: Welcome to Eclipse Che!
INFO: 
INFO: You are missing a mandatory parameter:
INFO:    1. Mount 'docker.sock' for accessing Docker with unix sockets.
INFO:    2. Or, set DOCKER_HOST to Docker's daemon location (unix or tcp).
INFO: 
INFO: Mount Syntax:
INFO:    Start with 'docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock' ...
INFO: 
INFO: DOCKER_HOST Syntax:
INFO:    Start with 'docker run -it --rm -e DOCKER_HOST=<daemon-location> ...'

Neither using sudo, nor using nightly, nor sudo chmod 777 /var/run/docker.sock makes a difference. The environment variable $DOCKER_HOST is undefined in my shell.

However, this full command does work:

$ docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock \
  -v ~/test/:/data eclipse/che start

OS: Linux Mint 18.1 Cinnamon 64-bit
Docker: 1.13.0 build 49bf474 (info)

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Feb 1, 2017

@Virtlink - your execution is expected. We already require docker sock or docker host to be added to run. We provide the simpler syntax in our docs to simplify how people get started. You provide the simple syntax first and then we guide you to add the other mounts.

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Feb 1, 2017

Closing this issue as we know that it is a sysadmin issue now.

@TylerJewell TylerJewell closed this Feb 1, 2017

@ioadler

This comment has been minimized.

Copy link

ioadler commented Feb 4, 2017

@TylerJewell - My problem looks very similar to virtlink's. Unfortunately I don't understand your closing comment regarding sysadmin. What's the way forward?

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Feb 4, 2017

You need to have permissions to access /var/run/docker.sock on your host. If your sysadmin has prevented access to this socket, or you cannot connect over tcp://0.0.0.0:2375, then Che will not be able to perform necessary functions around workspace management with Docker. So this is a system configuration issue where your admin needs to grant access.

@ioadler

This comment has been minimized.

Copy link

ioadler commented Feb 4, 2017

Thanks for your very immediate response.
I'm the sysadmin :-(
... of this trial/testing configuration.
I log in as a normal user and start the commands with sudo.
I granted all rights to /var/run/docker.sock (chmod).
What's needed to grant access to /var/run/docker.sock?

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Feb 4, 2017

Hmm, that is a curious situation. It's hard to say - as this would sound like an issue with how Docker was configured on your OS. Was the Docker daemon configured by someone else on the system?

@ioadler

This comment has been minimized.

Copy link

ioadler commented Feb 4, 2017

No, only by me. It's a standalone testing system with the current version of Fedora and Docker - installed from scratch. I used it to successfully build/run Oracle docker versions (some kind of proof, that the whole thing works). Since it's a testing system I could rebuild it any time - without possibly wasting your time. Although I believe it's "clean" and "up to date". Proposal: I'll reinstall Fedora Server and Docker - and tell you, how it went.

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Feb 4, 2017

Thanks - please open new issue if you can provide diagnostics on the system. We have our CI systems create fedora instances on Digital Ocean for testing, and so we know it works....

@okit247

This comment has been minimized.

Copy link

okit247 commented Feb 27, 2017

Same problem. I'm using docker v 1.6.2
Pls help

docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v ~/test/:/data eclipse/che start
INFO: Welcome to Eclipse Che!
INFO:
INFO: You are missing a mandatory parameter:
INFO: 1. Mount 'docker.sock' for accessing Docker with unix sockets.
INFO: 2. Or, set DOCKER_HOST to Docker's daemon location (unix or tcp).
INFO:
INFO: Mount Syntax:
INFO: Start with 'docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock' ...
INFO:
INFO: DOCKER_HOST Syntax:
INFO: Start with 'docker run -it --rm -e DOCKER_HOST= ...'

@eivantsov

This comment has been minimized.

Copy link
Member

eivantsov commented Feb 27, 2017

@okit247 , we support Docker 1.12.+. Please upgrade your Docker.

@okit247

This comment has been minimized.

Copy link

okit247 commented Mar 5, 2017

upgraded. that fixed it. thx

@anthonybudd

This comment has been minimized.

Copy link

anthonybudd commented Apr 3, 2017

I have read all the above and I'm still getting the same error. Can anyone help?

Things I have tried:
sudo chmod 777 /var/run/docker.sock

docker run eclipse/che start
sudo docker run eclipse/che start
sudo docker run eclipse/che:nightly start

INFO: Welcome to Eclipse Che!
INFO: 
INFO: You are missing a mandatory parameter:
INFO:    1. Mount 'docker.sock' for accessing Docker with unix sockets.
INFO:    2. Or, set DOCKER_HOST to Docker's location (unix or tcp).
INFO: 
INFO: Mount Syntax:
INFO:    Start with 'docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock' ...
INFO: 
INFO: DOCKER_HOST Syntax:
INFO:    Start with 'docker run -it --rm -e DOCKER_HOST=<daemon-location> ...'
INFO: 
INFO: Possible root causes:
INFO:    1. Your admin has not granted permissions to /var/run/docker.sock.
INFO:    2. You passed '--user uid:gid' with bad values.
INFO:    3. Your firewall is blocking TCP ports for accessing Docker daemon.

/Applications/Docker.app/Contents/Resources/bin/docker-diagnose

macOS: version 10.12.3 (build: 16D32)
Docker.app: version: 17.03.1-ce-mac5 (b18e2a50c)
Local time: Mon  3 Apr 2017 21:50:50 BST
UTC:        Mon  3 Apr 2017 20:50:50 UTC
Timestamp:  20170403-215050
Running diagnostic tests:
[OK]      docker-cli
[OK]      Moby booted
[OK]      driver.amd64-linux
[OK]      vmnetd
[OK]      osxfs
[OK]      db
[OK]      slirp
[OK]      disk
[OK]      menubar
[OK]      environment
[OK]      Docker
[OK]      VT-x
[OK]      kern.hv_support

docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete 
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.
...
@slemeur

This comment has been minimized.

Copy link
Contributor

slemeur commented Apr 3, 2017

Hi @anthonybudd, thanks for reaching!

Here, the command you provided is starting the Interactive mode for the Che CLI. If you read the outputs provided, you'll have instructions about how to continue. Check the outputs from the CLI here:

INFO: You are missing a mandatory parameter:
INFO:    1. Mount 'docker.sock' for accessing Docker with unix sockets.
INFO:    2. Or, set DOCKER_HOST to Docker's location (unix or tcp).
INFO: 
INFO: Mount Syntax:
INFO:    Start with 'docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock' ...
INFO: 
INFO: DOCKER_HOST Syntax:
INFO:    Start with 'docker run -it --rm -e DOCKER_HOST=<daemon-location> ...'

Also, please check the the documentation for that:
https://www.eclipse.org/che/docs/setup/getting-started/index.html#quick-start

The interactive mode will guide you to build the proper command to start che, based on your installation. At the end of the sequence, you should end with a command like this:

docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v <path>:/data eclipse/che start```
@aguther

This comment has been minimized.

Copy link

aguther commented Apr 23, 2017

In my case the "problem" was SELinux that enforced that the docker.sock could not be accessed although file mode 777.

@darkyelox

This comment has been minimized.

Copy link

darkyelox commented Jun 21, 2017

@aguther how did you solve it? i'm experiencing the same problem, i'm using docker 17.03.1-ce

@aguther

This comment has been minimized.

Copy link

aguther commented Jun 24, 2017

@darkyelox I solved it in my test environment with sudo setenforce 0. For production use the much better way is to configure SELinux properly and not to just disable it.

@xutao1976

This comment has been minimized.

Copy link

xutao1976 commented Nov 14, 2017

Using --privileged option solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment