-
Notifications
You must be signed in to change notification settings - Fork 2k
x509: certificate is valid for 192.168.99.103, not 192.168.99.100 #531
Comments
Can you give some more detail on the issue?
Thanks |
docker-machine version 0.1.0 I also added an --insecure-registry to the daemon so I could talk to our private registry (if that matters). |
Would you mind testing from master (you can use https://docker-machine-builds.evanhazlett.com/latest/ if you don't want to build locally). I have tested this with VMs changing IPs and everything works as expected:
You can see that |
Ok, here is what I did: Stop the current machine "docker info" produces: |
thanks. did you try with the master build above? I ran the same procedure you did and I didn't have any cert issues. |
I downloaded that "latest" binary. |
Hmm ok. @sthulb can you try to see if you can reproduce this?
@stephenlawrence is that process correct? Thanks |
@ehazlett Technically this is not how it started. It started when I rebooted my Mac and the DM came up with a different IP on the reboot. I don't know if that is different than just doing what you describe. But now, any attempts at accessing that previously-working machine result in the x509 message. |
@stephenlawrence i cannot re-create that as my IP always changes and the VM stays. I simply emulated the VM getting a different IP which should create the same thing I believe. Would you mind trying the above with the new binary and a fresh set of VMs? I'm wondering if the certs were created using an old build not using the correct process or something. |
@stephenlawrence Are you sure you don't have something in your bashrc that is messing with your settings, like DOCKER_CERT_PATH? |
Since I didn't see anyone else reference the relevant code, I'll just point out that Line 123 in 973b267
If the IP address changes, that cert will no longer work. In the b2d init scripts, there is code that regenerates the server certificates if the relevant IP addresses change: https://github.com/boot2docker/boot2docker/blob/5db7efbb4e0557f6efefdb56cb0263f80ed55834/rootfs/rootfs/usr/local/etc/init.d/docker#L46 I'm not entirely sure why that bit of b2d code isn't triggered in the |
Yeah thanks, I know this code is there however, when the IP changed (as On Sat, Feb 14, 2015 at 12:58 AM, Mike Dillon [email protected]
|
@md5 @stephenlawrence would you mind checking to see if you have anything that would be using the b2d certs by chance? after debugging, it looks like the b2d certs are being used with machine. |
@ehazlett I'm not sure what you're asking me to check. |
@md5 sorry i should have been more clear. check the environment variables |
@ehazlett if this were a case of an incorrect The error that we're seeing here is clearly that the client (i.e. |
@md5 that makes sense. how do i re-create? as you can see above i've changed the IP of my virtualbox instances and don't see this issue. |
That's a good question. I haven't been able to reproduce it myself either. |
Closing as we cannot seem to reproduce. My suspicion is that the environment variables are getting mixed for the boot2docker VM and the machine instance. I would recommend to check your |
I have this issue happening again. I had a docker-machine running on 192.168.99.101, and after a re-boot of my Mac, that machine is now running on 192.168.99.100. This seems as if its a docker issue since I can do "docker-compose run" into a container OK, but trying any docker commands throws this error: $docker ps |
Current env: $ ls -l ~/.docker/machines/.client/ |
@stephenlawrence ugh ok. would you be using b2d as well by chance? the only time i've seen this was something between b2d and machine. i can't personally reproduce but it had to do with the certs and env vars. maybe we need that "regenerate-certs" command sooner rather than later :) |
Well, I had been using b2d alone before I switch to DM. DM uses b2d as well no? |
@stephenlawrence just use |
I've had this happen to me as well. I used |
Removing b2d doesn't necessarily resolve my issue, but I have removed it. I would add that this is making docker-machine unusable for me at the moment. I just created a new machine hoping to get rid of that issue, but I have the same issue on a new machine. |
I'm using OS X and tired of using these hacks and having them broken eventually. Vagrant has option to set ip address in configuration. I can't understand why this kind of parameter or flag is not already existing in docker-machine (Just comparing to vagrant because both use virtualbox) |
@onnimonni: this has been resolved for a long long time (almost a year). Machine includes a command to regenerate certs in case the ip changed. |
I just ran into this issue for the first time and checked everything in this thread with any of the following options successfully fixing the issue: (pick one)
To repro this issue on OSX:
|
so it comes down to multiple machines started in different order may cause a different IP which breaks the certificate which requires searching github for this issue to find the resolution of creating a new certificate to allow you to use them again ... is there a way to PREVENT this happening? is it so unusual for folks to flip between multiple docker machines? |
$alias docker="docker --tlsverify=false" Work for me! |
@ivancarrancho Why not |
@nathanleclaire yes, that's better than "--tlsveify" many many thanks |
@nathanleclaire because it takes ~ 4 minutes ... Imagine you have a cluster of 6+ nodes... I will have to write a parallel certificate regenerator thingy to not spend whole day by regenerating some certificates.... Moreover it restarts all docker containers on the target machine ... This requirement to regenerate certificates after IP address change is a huge pain on aws cloud... Public IPs change all the time. The only solution known to me is creating new instances from an ec2 instance, but for some reason it doesn't work #1453 (comment) Btw any idea if This is the only way I'm aware of how to avoid constant certificate regeneration... |
Yes, unless there is some other way you have to access the private IP from the creation node (e.g. proxy). We are considering a variety of solutions, e.g. Elastic IP, to potentially resolve this issue. |
yeah,but as I mentioned,it is hanging on ssh access even with this option
|
Maybe the security group is not configured properly? Currently, if using |
I dont understand why I have to run that ugly $eval statement everytime docker needs to be started via a terminal. I dont understand why this issue even exists. Docker is seeming more and more like a horribly broken product that a lot of people got behind because it was the "in" thing. |
I'm using the latest version of docker-machine create -d virtualbox xxxx \
--engine-opt="cluster-store=${KVSTORE}" \
--engine-opt="cluster-advertise=eth1:2376" \
${NAME}
... and almost every time I reboot the VMs, or reboot my Mac, I will face the error like My versions are: $ docker --version
Docker version 1.12.0-rc4, build e4a0dbc, experimental
$ docker-machine -v
docker-machine version 0.8.0-rc2, build 4ca1b85
$ vboxmanage -v
5.1.0r108711 Is there any solution to prevent those error to happen? or create a virtualbox host with a fixed IP? |
Workaround: |
Fixed the issue by
|
Following @VonC link I came across $ cd ~/.docker/ $ git clone https://github.com/fivestars/docker-machine-ipconfig.git # Add to ~/.profile $ echo 'alias docker-machine-ipconfig=~/.docker/docker-machine-ipconfig/docker-machine-ipconfig' >> ~/.profile $ source ~/.profile E.g: Assign machine-name a static IP: $ docker-machine-ipconfig static machine-name # or specify implicit IP $ docker-machine-ipconfig static machine-name 192.168.99.110 This eliminate need of |
Does it supports Windows? I mean both "for" and "on". |
it looks like it is still an issue. any way to fix it? |
@johnmccabe, |
how can i have static account of container , it enables me to change the account every time i restart the docker-machine ? |
I see the workaround with |
Might want to tweak this message "Started machines may have new IP addresses. You may need to re-run the |
@rdp nice catch, I had this problem was half an hour looking what had happened, and after trying to do some things with kubernetes, installing and uninstalling things... running |
|
@PatMyron Surprisingly, this worked for me too! |
I had the same exact issue just now and apparently it was fixed by resetting docker to factory settings and enabling the Kubernetes cluster again. EDIT: I managed to reproduce the fix on a second machine. The exact steps in my case were: start Docker Desktop |
I had the same problem and I solved it by doing this: In your command prompt run:
it will return
get the of the machine you want to fix then run:
The last command will output more lines, copy the last one, in my case it was like this:
then paste it in the command prompt without the |
After having my machine running on the .103 IP I rebooted my Mac. Upon reboot my docker-machine switched to the .100 address. When I tried to perform any docker commands on my machine I get things like this:
docker exec -it mycontainer bash
:FATA[0000] An error occurred trying to connect: Post https://192.168.99.100:2376/v1.16/containers/mycontainer/exec: x509: certificate is valid for 192.168.99.103, not 192.168.99.100
The text was updated successfully, but these errors were encountered: