rancher / vagrant

Vagrant file to stand up a Local Rancher install with 3 nodes
81 stars 56 forks source link

Restarting Vagrant project causes Rancher Server to fail with `Error starting daemon: error initializing graphdriver: \"/var/lib/docker\" contains several valid graphdrivers: overlay, overlay2; Please cleanup or explicitly choose storage driver (-s <DRIVER>)` #42

Closed stefanlasiewski closed 6 years ago

stefanlasiewski commented 6 years ago

This Vagrant project works when I first run vagrant up, but it fails to work after reloading the project in any form, including restarting my laptop, allowing the laptop to sleep and wake, etc.

Host detais: MacOS 10.13.4 High Sierra Vagrant 2.0.4 VirtualBox 5.2.10

The root cause appears to be that the Docker daemon in the server-01 VM is confused by which graphdriver to use, as shown by the error below. Can you help figure out a workaround? This seems to be caused by https://github.com/rancher/os/issues/2278 .

stefanl@stefanl:vagrant $ vagrant status
Current machine states:

master                    running (virtualbox)
server-01                 running (virtualbox)
node-01                   running (virtualbox)
node-02                   running (virtualbox)

stefanl@stefanl:vagrant $ vagrant ssh server-01
[rancher@server-01 ~]$ sudo docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
[rancher@server-01 ~]$ tail /var/log/docker.log 
time="2018-04-24T21:49:32.850635694Z" level=fatal msg="Error starting daemon: error initializing graphdriver: \"/var/lib/docker\" contains several valid graphdrivers: overlay, overlay2; Please cleanup or explicitly choose storage driver (-s <DRIVER>)" 

Steps to reproduce:

  1. Check out the code:
stefanl@stefanl:Vagrant $ git clone https://github.com/rancher/vagrant
Cloning into 'vagrant'...
remote: Counting objects: 347, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 347 (delta 0), reused 1 (delta 0), pack-reused 341
Receiving objects: 100% (347/347), 230.47 KiB | 4.80 MiB/s, done.
Resolving deltas: 100% (190/190), done.
stefanl@stefanl:Vagrant $ cd vagrant
stefanl@stefanl:vagrant $ git checkout 2.0
Branch 2.0 set up to track remote branch 2.0 from origin.
Switched to a new branch '2.0'
  1. Start the project for the first time, and confirm that I can reach the Rancher Server:
stefanl@stefanl:vagrant $ vagrant up
...
Bringing machine 'master' up with 'virtualbox' provider...
Bringing machine 'server-01' up with 'virtualbox' provider...
Bringing machine 'node-01' up with 'virtualbox' provider...
Bringing machine 'node-02' up with 'virtualbox' provider...
...

    node-02: Status: Downloaded newer image for rancher/agent:master
    node-02: f87f8b6d02619d7e00477da0d722df42287a002d25690620672d46765ced5439

stefanl@stefanl:vagrant $ curl --head --insecure https://172.22.101.101/
HTTP/1.1 200 OK
Content-Type: application/json
Expires: Wed 24 Feb 1982 18:42:00 GMT
X-Api-Schemas: https://172.22.101.101/meta/schemas
Date: Tue, 24 Apr 2018 21:46:06 GMT

stefanl@stefanl:vagrant $ 
  1. Restart the Vagrant project. The Rancher Server becomes unavailable.

stefanl@stefanl:vagrant $ vagrant reload
==> master: Attempting graceful shutdown of VM...
==> master: Machine booted and ready!
...
==> server-01: Attempting graceful shutdown of VM...
==> master: Machine booted and ready!
...

stefanl@stefanl:vagrant $ vagrant status
...

Current machine states:

master                    running (virtualbox)
server-01                 running (virtualbox)
node-01                   running (virtualbox)
node-02                   running (virtualbox)

This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.
stefanl@stefanl:vagrant $ curl --head --insecure https://172.22.101.101/
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 172.22.101.101:443 
stefanl@stefanl:vagrant $ 
chrisurwin commented 6 years ago

What is ROS_version set to in the config.yml?

chrisurwin commented 6 years ago

I've just pushed a fix for this.

stefanlasiewski commented 6 years ago

My config file says ROS_version: 1.0.3.

Thanks for pushing a fix Chris. That seems to fix my problem. Closing this ticket.