TritonDataCenter / sdc-docker

Docker Engine for Triton
Mozilla Public License 2.0
183 stars 49 forks source link

An error occurred trying to connect: Get http://eu-ams-1.docker.joyent.com:2376/v1.21/info: EOF #58

Closed matthiasg closed 8 years ago

matthiasg commented 8 years ago

been trying sdc to get a feel of the ease of it. but after trying the initial setup i feel the basic docker scripts and documentation seem to diverge.

i was trying to follow the steps as described here: https://docs.joyent.com/public-cloud/api-access/docker and in the readme of this repo.

when i follow the exact steps including the export DOCKER_TLS_VERIFY=1 it complains that the CA cert ca.pem is missing. Which is correct, since the script did not create that. When i remove TLS_VERIFY as hinted at here https://github.com/joyent/sdc-docker/blob/master/docs/api/troubleshooting.md i get the error as described in this issues title An error occurred trying to connect: Get http://eu-ams-1.docker.joyent.com:2376/v1.21/info: EOF. When i use docker --tls info i get Error response from daemon: Unauthorized (36e66d70-b2d4-11e5-9157-7323d12cdcf2)

creating an account on the public cloud was easy. trying to create a docker container not so much. in the GUI it prompted me for an image. i found one i liked on from the popup, which it says it downloaded but its not in the dropdown after the download and cannot be selected ? i did find the image in the manta section though. But i wanted to do it from the CLI anyway so i gave up on that for now.

Note:

Output from sdc-docker-setup.sh was:

$ bash sdc-docker-setup.sh https://eu-ams-1.api.joyentcloud.com mgoetzke ~/.ssh/id_rsa
Setting up Docker client for SDC using:
    CloudAPI:        https://eu-ams-1.api.joyentcloud.com
    Account:         mgoetzke
    Key:             /c/Users/mgt57/.ssh/id_rsa

If you have a pass phrase on your key, the openssl command will
prompt you for your pass phrase now and again later.

Verifying CloudAPI access.
CloudAPI access verified.

Generating client certificate from SSH private key.

Which created the private key fine.

PS: I am currently working from a GitBash on Windows but i didnt have any such issues with docker against other backends (e.g local in vbox) from this env.

PPS: I did set export DOCKER_CERT_PATH=/c/Users/mgt57/.sdc/docker/mgoetzke export DOCKER_HOST=tcp://eu-ams-1.docker.joyent.com:2376 export DOCKER_CLIENT_TIMEOUT=300

i removed the TLS part though as described above

matthiasg commented 8 years ago

btw the cloud api url is inconsistent

https://docs.joyent.com/public-cloud/data-centers says its https://eu-ams-1.api.joyentcloud.com but on https://docs.joyent.com/public-cloud/api-access/docker its says https://eu-ams-1.api.joyent.com

xer0x commented 8 years ago

@Matthiasg sorry your blazing into new territory running this in Git bash on Windows. I think you're hitting an issue with MinGW's magic paths.

As a workaround you can try editing sdc-docker-setup.sh and adding an extra slash before CN=$account on line 500 so the openssl command looks like this: openssl req -new -key $keyPath -out $csrPath -subj "//CN=$account" >/dev/null 2>/dev/null

http://stackoverflow.com/questions/31506158/running-openssl-from-a-bash-script-on-windows-subject-does-not-start-with

matthiasg commented 8 years ago

@xer0x yeah i am sorry too :) but getting my entire dev setup here onto linux proved to be to cumbersome and i develop on windows, smartos and my macs.

the fix you suggested worked! It created all proper keys now and docker info worked well (against eu-ams-1.api.joyent.com). I would have too look at the script, but its quite sad that it just stops without error or hint of an error. and that the troubleshooting article https://github.com/joyent/sdc-docker/blob/master/docs/api/troubleshooting.md seems to indicate that the original process isnt quite correct anymore.

btw git bash and docker for windows both use MINGW64 and thus both have this issue and would require this workaround.