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

Error : unable to communicate with Docker | Error checking and/or regenerating the certs #690

Open
G3z opened this issue Dec 15, 2018 · 1 comment

Comments

@G3z
Copy link

G3z commented Dec 15, 2018

i'm using nanobox with docker in the lightweight VM

$ nanobox start
Starting Nanobox :

--------------------------------------------------------------------------------
+ HEADS UP:
+ Nanobox will run a single VM transparently within VirtualBox.
+ All apps and containers will be launched within the same VM.
--------------------------------------------------------------------------------

  ! Launching VM
    Running pre-create checks...
    (nanobox) Boot2Docker URL was explicitly set to "https://d1ormdui8qdvue.cloudfront.net/boot2docker/v1/boot2docker.iso" at create time, so Docker Machine cannot upgrade this machine to the latest version.
    Creating machine...
    (nanobox) Boot2Docker URL was explicitly set to "https://d1ormdui8qdvue.cloudfront.net/boot2docker/v1/boot2docker.iso" at create time, so Docker Machine cannot upgrade this machine to the latest version.
    (nanobox) Downloading /Users/g3z/.docker/machine/cache/boot2docker.iso from https://d1ormdui8qdvue.cloudfront.net/boot2docker/v1/boot2docker.iso...
    (nanobox) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
    (nanobox) Creating VirtualBox VM...
    (nanobox) Creating SSH key...
    (nanobox) Starting the VM...
    (nanobox) Check network to re-create if needed...
    (nanobox) Waiting for an IP...
    Waiting for machine to be running, this may take a few minutes...
    Detecting operating system of created instance...
    Waiting for SSH to be available...
    Detecting the provisioner...
    Provisioning with boot2docker...
    Copying certs to the local machine directory...
    Copying certs to the remote machine...
    Setting Docker configuration on the remote daemon...
    Checking connection to Docker...
    Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.101:2376": x509: certificate has expired or is not yet valid
    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 running containers.

  ✓ Configuring Network
  ✓ Loading kernel modules
  ✓ Cleaning DHCP
  ✓ Regenerating Docker certs
  ✓ Joining virtual network

Error   : unable to communicate with Docker
Context : failed to initialize docker for provider

than on any subsequent start:

$ nanobox start
✓ Skipping (already running)

Error   : unable to communicate with Docker
Context : failed to initialize docker for provider

by using docker-machine I saw this

$docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
nanobox   -        virtualbox   Running   tcp://192.168.99.101:2376           Unknown   Unable to query docker version: Get https://192.168.99.101:2376/v1.15/version: x509: certificate has expired or is not yet valid

SOLUTION

$ docker-machine regenerate-certs -f --client-certs nanobox
$ docker-machine stop nanobox
$ nanobox run
@G3z G3z changed the title Error : unable to communicate with Docker Error : unable to communicate with Docker | Error checking and/or regenerating the certs Dec 15, 2018
@adambouchard
Copy link

Thanks for posting this @G3z . I ran into the same issue and this solution solved it.

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