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

Install process errors during bin/check phase #118

Closed
brynary opened this issue Sep 19, 2015 · 8 comments
Closed

Install process errors during bin/check phase #118

brynary opened this issue Sep 19, 2015 · 8 comments

Comments

@brynary
Copy link
Member

brynary commented Sep 19, 2015

Following the Linux install instructions, but sudo make install is failing during the bin/check step.

Note: I am running this from within a Docker container.

$ docker version
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 4749651
OS/Arch (client): linux/amd64
Server version: 1.6.0
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 4749651
OS/Arch (server): linux/amd64

$ curl -L https://github.com/codeclimate/codeclimate/archive/master.tar.gz | tar xvz
<<snipped>>

$ cd codeclimate-* && sudo make install
bin/check
time="2015-09-19T16:21:17Z" level=fatal msg="Get http:///var/run/docker.sock/v1.18/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?" 
Unable to run `docker version', the docker daemon may not be running
Please ensure `docker version' succeeds and try again
make: *** [install] Error 1

$ docker version
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 4749651
OS/Arch (client): linux/amd64
Server version: 1.6.0
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 4749651
OS/Arch (server): linux/amd64

$ env | grep -i docker
DOCKER_HOST=tcp://192.168.59.103:2376
DOCKER_TLS_VERIFY=1

☺ ~/codeclimate-master 
 [devbox 16:22:34] $ ./bin/check 

☺ ~/codeclimate-master 
 [devbox 16:22:35] $ echo $?
0

What you can see here is:

  • docker version is happy. I am able to use the Docker client from within this shell. Therefore, I think the codeclimate CLI install should succeed
  • Docker is configured to use a remote DOCKER_HOST and DOCKER_TLS_VERIFY is set to true.
  • Curiously, running bin/check from within the ./codeclimate-master directory exits cleanly with exit code 0.
  • However, sudo make install appears to error out when it runs bin/check

/c @pbrisbin

@pbrisbin
Copy link
Contributor

docker version is happy when run as your user. make install is being executed with sudo. I'd imagine the issue is the docker commands ran by bin/check don't work for your root user.

Does

cd /tmp && make install PREFIX=$PWD && ./bin/codeclimate version

work?

@pbrisbin
Copy link
Contributor

@brynary
Copy link
Member Author

brynary commented Sep 19, 2015

You are correct that sudo docker version errors out. Good catch.

(And, as expected, sudo DOCKER_HOST=$DOCKER_HOST DOCKER_TLS_VERIFY=$DOCKER_TLS_VERIFY docker version works. It's the missing ENV vars that break it.)

At the very least, does this mean we should update our instructions to ask the user if sudo docker version works?

Anyways, continuing on make install PREFIX=/tmp seems to work. However, /tmp/bin/codeclimate version then fails with:

$ /tmp/bin/codeclimate version
Your Docker setup does not support the codeclimate wrapper script:

  > /var/run/docker.sock

We require a local Docker daemon that supports communication via the default
socket path.

Please use `docker run' to run the `codeclimate/codeclimate' image directly.

See https://github.com/codeclimate/codeclimate for more details.

This doesn't surprise me, as I remember we accepted this limitation. However, I think we could workaround this limitation in the wrapper fairly easily for people using a boot2docker/Docker machine setup (like I am). My understanding of the issue with the wrapper is around volume mounting... however, in the case of Docker machine, there is a shared filesystem between the Mac and the VM running Docker. So, I think we'd need something like a CODECLIMATE_VOLUME_PATH environment variable, and then we could tweak the --volume options we send to Docker appropriately, and things would just work.

That can/should be a separate issue/PR, but what do you think about updating the bin/check error output to help avoid this tripping someone else up?

@pbrisbin
Copy link
Contributor

what do you think about updating the bin/check error output

I think we could update it to be more helpful, but just saying "sudo docker version" is too naive as we can't know if it was run with sudo when it failed or not. Something like "ensure docker version works for the XYZ user" we could do though, and hopefully seeing "for the root user" would be enough to get people going?

@brynary
Copy link
Member Author

brynary commented Sep 21, 2015

@pbrisbin if ran as root can we insert sudo into the help text, but not if it is not run as root?

That should be easy/simple/quick and I don't think the edge case of root-without-sudo is particularly worth worrying about

@pbrisbin
Copy link
Contributor

I don't think the edge case of root-without-sudo is particularly worth worrying about

I guess I (slightly) disagree here, but if that's how you feel, then I'm OK with it.

@pbrisbin
Copy link
Contributor

#120 -- could you do me a favor and try out that branch to ensure it shows you the right message?

@pbrisbin
Copy link
Contributor

pbrisbin commented Oct 1, 2015

That can/should be a separate issue/PR, but what do you think about updating the bin/check error output to help avoid this tripping someone else up?

Closing this -- when we get some time, let's open that separate issue to discuss. For a standard boot2docker/docker-machine setup, we expect everything to work, so I'm curious what's different about yours that it doesn't.

@pbrisbin pbrisbin closed this as completed Oct 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants