Eval "$(docker-machine env --swarm swarm-master)" returns (an error validating certificates for host "192.168.99.101:3376")

Hi Team,

I just setup the docker swarm with toolbox. I can do
eval "$(docker-machine env swarm-master)"
without any issue but
eval "$(docker-machine env --swarm swarm-master)"
returns following error

Error checking TLS connection: Error checking and/or regenerating the certs: The
re was an error validating certificates for host “192.168.99.101:3376”: dial tcp
192.168.99.101:3376: connectex: No connection could be made because the target
machine actively refused it.
You can attempt to regenerate them using ‘docker-machine regenerate-certs [name]
’.
Be advised that this will trigger a Docker daemon restart which will stop runnin
g containers.

I think the problem is “192.168.99.101:3376”. It should be 2376 instead of 3376 but I do not know where the 3376 is generated. Can you please help me to locate the config so I can manually edit the config?

Thank you very much for your help!

William

Here is my environment

$ docker-machine version
C:\Program Files\Docker Toolbox\docker-machine.exe version 0.5.4, build 6643d0e

$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWA
RM DOCKER ERRORS
default - virtualbox Running tcp://192.168.99.100:2376
v1.9.1
local - virtualbox Stopped
Unknown
swarm-agent-00 - virtualbox Running tcp://192.168.99.103:2376 swa
rm-master v1.9.1
swarm-agent-01 - virtualbox Running tcp://192.168.99.104:2376 swa
rm-master v1.9.1
swarm-master * virtualbox Running tcp://192.168.99.101:2376 swa
rm-master (master) v1.9.1

The
re was an error validating certificates for host “192.168.99.101:3376”: dial tcp
192.168.99.101:3376: connectex: No connection could be made because the target
machine actively refused it.
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]

As suggested regenerate the certs.

When a Docker machine is restarted the IP Address is invariably new and the certificates need to be regenerated. For example, regenerate the certs for the swarm-master machine with the following docker-machine regenerate-certs command.
docker-machine regenerate-certs swarm-master
The certs gets regenerated.