Restart rancher/server lose all hosts and stacks

I start use : docker run -d --restart=always --name=rancher-server -p 8080:8080 -v /var/lib/rancher:/var/lib/rancher rancher/server:v1.1.0

shutdown the server host , then restart the host , loses all hosts and stack added before

Hello there,

I just started to use Rancher and I love it, so after a week of test I decided to deploy it on our qa servers, then on production at OVH, so I just figured aout after a power lost that the rancher server ost all stacks and hosts configured, It just did keep the users information. then it is a normal behaviour? how I can void it?

My configuration:
OS: Ubuntu Server 16.04.1 LTS

Firewalling with UFW:

To                         Action      From
-----                      ------      -----
22                         ALLOW            
22                         ALLOW            
8080                       ALLOW            
8080                       ALLOW            
80                         ALLOW            
80                         ALLOW            
443                        ALLOW            
443                        ALLOW            
500/udp                    ALLOW            
4500/udp                   ALLOW            
8081/tcp                   ALLOW            
8080/tcp                   ALLOW             
8081/tcp                   ALLOW  

All IP address where substituted with non valid IP subnets for our security but those that belongs to docker and rancher :wink:

Server Version: 1.12.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 25
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
 Volume: local
 Network: bridge host null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-38-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.791 GiB
Name: dnodo-srv02
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
WARNING: No swap limit support
Insecure Registries:

My server was deployed using a docker-compose file:

version: '2'
    image: rancher/server:v1.1.4
    restart: unless-stopped
      - 8080:8080
      - CATTLE_DB_CATTLE_MYSQL_HOST=my_mysql_percona_based_server
      - CATTLE_DB_CATTLE_MYSQL_NAME=my_database
      - CATTLE_DB_CATTLE_PASSWORD=my_password
    network_mode: bridge

So I reviewed the database just to be sure that the configuration of hosts was saved and there exists, but isn’t fetched by the server after a restart.

I hope some one can help me with this and thanks in advance,


All the persistent state is in the database… Are you sure you’re not looking at the wrong environment? It doesn’t really make sense that auth would be configured but all the other info was lost.

Thank you for your reply,

I figured out that all the issue was related with the environments. I was looking in the wrong place and I can say that my issue was solved.

Just a sugestion, please add an officia procedure to migrate the rancher server to another host, because I tried it and all my host where messed up. Then Rancher is a terrific product and I want to say thank you for your hard work.