boot2docker / osx-installer

Docker installer for Mac OS X
Apache License 2.0
1.25k stars 258 forks source link

x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.59.105 #119

Closed damnhandy closed 6 years ago

damnhandy commented 9 years ago

I am getting the following error when I restart boot2docker and run any docker command:

$ docker images
An error occurred trying to connect: Get https://192.168.59.105:2376/v1.19/images/json: x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.59.105

The only fix right now to is to delete the ISO and rerun boot2docker init, which is costly and slow when riding on the MBTA :) Not to mention, I it requires a full rebuild of all of the images I'm working on.

dimio111 commented 9 years ago

I am having this problem as well. Every time i restart boot2docker 1.7 on mac i am getting: An error occurred trying to connect: Get https://192.168.59.103:2376/v1.19/containers/json: x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.59.103

Al my colleges i know of are having the same problem.

This is really painfull with images over 5Gb

bfagundez commented 9 years ago

Try running

boot2docker delete
boot2docker init
boot2docker down
boot2docker up

I was having the same problem after 1.7 upgrade and worked after the delete/init

monomadic commented 9 years ago

I keep reading this 'solution' over and over of nuking your images and re-doing it all. This kind of makes docker useless... is there any info out there either on what's causing this or when/how it can be fixed/patched?

I hate being 'that guy' to complain but I don't really understand how such an obviously far-reaching bug has been in the main source release for so long now. Perhaps there's something wrong with the development process the boot2docker team is using because to me ... well I'm off investigating other solutions even though they don't suit.

Perhaps someone in the Docker team can point the community to why this might be happening so someone can try to patch it, or provide a way to repair our broken installs so we can move on? Every thread is just showing this awful workaround which is not even close to a solution or explanation. I have no faith in using this in production.

bfagundez commented 9 years ago

@robsaunders, I agree, this needs to be examined.

mygoare commented 9 years ago

+1

damnhandy commented 9 years ago

This is actually not specific to OS X and is being tracked here:

https://github.com/boot2docker/boot2docker/issues/968

I have been seeing the same thing on Windows 7 Enterprise as well. My solution has been rolling back to 1.6.2 until a patch for 1.7 is released.

This issue should probably be marked as a dupe of 968.

Priyanky commented 9 years ago

+1

caledhwa commented 9 years ago

+1

damnhandy commented 9 years ago

This seems to be fixed in 1.7.1. I can stop and restart boot2docker and I get no error about the certificates and the IP doesn't change either.

jangalinski commented 9 years ago

Seems to be fixed with 1.7.1 -> close?

Thanks for confirming this is a dupe and its fixed ... again: why not just close it?

carlossg commented 9 years ago

this is a dupe of #938, fixed in 1.7.1

geronimo-iia commented 9 years ago

1.7.1 fixed this issue for me

dimio111 commented 9 years ago

Fixed for me to, but i had to delete the boot2docker iso file manually?

fordlee404 commented 9 years ago

@dimio111 you can update the boot2docker with command boot2docker upgrade

innokenty commented 8 years ago

I do confirm a single boot2docker upgrade to 1.7.1 fixes the issue.

KimJBaran commented 8 years ago

I am at 1.7.1 and still have that issue. I am going through the delete/init/up cycle as described by @bfagundez as workaround every now and then.

fordlee404 commented 8 years ago

@indiedotkim try this to solve the problem

$ boot2docker ssh
$ sudo /etc/init.d/docker stop
$ sudo /etc/init.d/docker start

and you will not lose your images and containers.

KimJBaran commented 8 years ago

@fordlee404 Not seeing the errors anymore -- I hope it stays this way. Thank you!

rnoska commented 8 years ago

@fordlee404 - Thanks for posting. Restarting docker worked for me.

pejvan commented 8 years ago

unfortunately, the error still exists for me:

pejvan$ boot2docker status
running
pejvan$ $(boot2docker shellinit)
Writing /Users/pejvan/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/pejvan/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/pejvan/.boot2docker/certs/boot2docker-vm/key.pem
Your environment variables are already set correctly.
pejvan$ boot2docker status
running
pejvan$ docker ps -a
An error occurred trying to connect: Get https://192.168.59.103:2376/v1.19/containers/json?all=1: x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.59.103

indeed, stopping and restarting the service inside the vm solves the problem -- though all the running containers are obviously stopped.

EDIT: I just realised I had boot2docker 1.7.1 but the iso was still running docker 1.7.0.

pejvan$ boot2docker ssh
                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.7.0, build master : 7960f90 - Thu Jun 18 18:31:45 UTC 2015
Docker version 1.7.0, build 0baf609

pejvan$ boot2docker version
Boot2Docker-cli version: v1.7.1
Git commit: 8fdc6f5

I'm upgrading the ISO and will see wether the problem disappears.

pejvan$ boot2docker upgrade
docker is up to date (1.7.1), skipping upgrade...
boot2docker is up to date (v1.7.1), skipping upgrade...
Latest release for github.com/boot2docker/boot2docker is v1.7.1
Downloading boot2docker ISO image...
Success: downloaded https://github.com/boot2docker/boot2docker/releases/download/v1.7.1/boot2docker.iso
    to /Users/pejvan/.boot2docker/boot2docker.iso
Waiting for VM and Docker daemon to start...
.................ooooooooo
Started.
Writing /Users/pejvan/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/pejvan/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/pejvan/.boot2docker/certs/boot2docker-vm/key.pem
Your environment variables are already set correctly.

pejvan$ boot2docker version
Boot2Docker-cli version: v1.7.1
Git commit: 8fdc6f5
pejvan$ boot2docker ssh
                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.7.1, build master : c202798 - Wed Jul 15 00:16:02 UTC 2015
Docker version 1.7.1, build 786b29d
hackervera commented 8 years ago

Upgrade fixed for me

CocaCola183 commented 8 years ago

@bfagundez I fix the problem in you way, thx

jacobtomlinson commented 8 years ago

Looks like the upgrade worked for me too :+1:

olalonde commented 8 years ago

boot2docker upgrade also worked here although I just installed boot2docker yesterday! Guess docker.com's download link is out of sync with releases.

claudiouzelac commented 8 years ago

Worked for me as well, thanks!

huseyinbabal commented 8 years ago

@bfagundez worked for me, thanks!

JonathanRosado commented 8 years ago

experiencing this bug docker 1.11

tianon commented 6 years ago

Sorry, this repository is long-since deprecated in favor of Docker Toolbox (whose usage is now also discouraged in favor of Docker for Windows and Docker for Mac).