# Rancher server restart loop

**URL:** <https://forums.suse.com/t/rancher-server-restart-loop/12896>\
**Category:** SUSE Rancher Prime\
**Created:** [January 6, 2019, 6:15pm UTC](https://forums.suse.com/t/rancher-server-restart-loop/12896 "2019-01-06T18:15:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crackerjam](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/crackerjam/32/2149_2.png) [@Crackerjam](https://forums.suse.com/u/Crackerjam)\
**Post date:** [January 6, 2019, 6:15pm UTC](https://forums.suse.com/t/rancher-server-restart-loop/12896/1 "2019-01-06T18:15:26Z")

</div>

I’m trying to evaluate Rancher 2.1.5 and I’ve hit a snag. I’m using ESXi 6.7 as a platform, and I’ve created a server running RancherOS. After that, I SSH in and run `sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:latest -v /opt/rancher:/var/lib/rancher`

That appears to work okay, however, a `docker ps` shows this:

`CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES`  
`f7076c909706 rancher/rancher:latest "entrypoint.sh -v /o…" 35 seconds ago Restarting (0) 1 second ago awesome_wright`

And looking at the logs for the container shows this:

rancher version v2.1.5  
rancher version v2.1.5  
rancher version v2.1.5  
rancher version v2.1.5  
rancher version v2.1.5  
rancher version v2.1.5  
rancher version v2.1.5  
rancher version v2.1.5  
rancher version v2.1.5  
rancher version v2.1.5

Running without the -v argument works properly. How can I fix this and get the server to start properly while keeping the data persistent?

---

<div class="post-metadata">

**Author:** ![Sarge](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@Sarge](https://forums.suse.com/u/Sarge)\
**Post date:** [January 11, 2019, 6:37pm UTC](https://forums.suse.com/t/rancher-server-restart-loop/12896/2 "2019-01-11T18:37:51Z")

</div>

My guess is that /opt/rancher does not exist? You may need to manually create the rancher directory in opt

---

<div class="post-metadata">

**Author:** ![Xample](https://avatars.discourse-cdn.com/v4/letter/x/d9b06d/32.png) [@Xample](https://forums.suse.com/u/Xample)\
**Post date:** [March 4, 2019, 8:16pm UTC](https://forums.suse.com/t/rancher-server-restart-loop/12896/3 "2019-03-04T20:16:23Z")

</div>

I am in the same case, started using:

```bash
sudo docker run -p 80:80 -p 443:443 rancher/rancher:latest -v /opt/rancher:/var/lib/rancher

```

```bash
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4e196451d962 rancher/rancher:latest "entrypoint.sh -v /o…" 39 minutes ago Restarting (0) 18 seconds ago xenodochial_northcutt

```

Docker

```auto
root@debian-2gb-nbg1-1 /opt # docker version
Client:
 Version: 18.09.3
 API version: 1.39
 Go version: go1.10.8
 Git commit: 774a1f4
 Built: Thu Feb 28 06:34:04 2019
 OS/Arch: linux/amd64
 Experimental: false

Server: Docker Engine - Community
 Engine:
  Version: 18.09.3
  API version: 1.39 (minimum version 1.12)
  Go version: go1.10.8
  Git commit: 774a1f4
  Built: Thu Feb 28 05:59:55 2019
  OS/Arch: linux/amd64
  Experimental: false

```

#1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07)

```bash
root@debian-2gb-nbg1-1 /opt/rancher # ls -al
total 8
drwxr-xr-x 2 root root 4096 Mar 4 20:38 .
drwxr-xr-x 4 root root 4096 Mar 4 21:10 ..

```

---

<div class="post-metadata">

**Author:** ![Xample](https://avatars.discourse-cdn.com/v4/letter/x/d9b06d/32.png) [@Xample](https://forums.suse.com/u/Xample)\
**Post date:** [March 4, 2019, 8:48pm UTC](https://forums.suse.com/t/rancher-server-restart-loop/12896/4 "2019-03-04T20:48:21Z")

</div>

I suspect my machine to be [running already in a docker.](https://stackoverflow.com/questions/31381322/docker-in-docker-cannot-mount-volume)  
[edit] … after checking, it seems it is not the case. Any idea?

---

<div class="post-metadata">

**Author:** ![Xample](https://avatars.discourse-cdn.com/v4/letter/x/d9b06d/32.png) [@Xample](https://forums.suse.com/u/Xample)\
**Post date:** [March 6, 2019, 7:17pm UTC](https://forums.suse.com/t/rancher-server-restart-loop/12896/5 "2019-03-06T19:17:10Z")

</div>

@Crackerjam did you find a solution?

Here is my logs  
**root**  **@**  **debian-2gb-nbg1-1**  **~**  **#** docker run -p 80:80 -p 443:443 rancher/rancher:latest -v /opt/rancher:/var/lib/rancher

```
Unable to find image 'rancher/rancher:latest' locally

latest: Pulling from rancher/rancher

6cf436f81810: Pull complete 

987088a85b96: Pull complete 

b4624b3efe06: Pull complete 

d42beb8ded59: Pull complete 

20428076f45c: Pull complete 

aa5f6ec4068f: Pull complete 

fa0b81e2aefe: Pull complete 

174adca119fa: Pull complete 

b36e95625791: Pull complete 

3b4599da8bc5: Pull complete 

7c3eae4ec924: Pull complete 

821c0eae95fd: Pull complete 

Digest: sha256:1943e9b7d802992d3c61184af7ae2ca5d414c15152bc40ec995e71e28cb80844

Status: Downloaded newer image for rancher/rancher:latest

2019-03-06T22:04:15.579582150+01:00 image pull rancher/rancher:latest (name=rancher/rancher, org.label-schema.build-date=2019-03-06T18:22:27Z, org.label-schema.schema-version=1.0, org.label-schema.vcs-ref=6472ba0c03ff7a222f5891ce5272e2e4261d8f58, org.label-schema.vcs-url=https://github.com/rancher/rancher.git)

2019-03-06T22:04:15.618612804+01:00 volume create e060d957c24b8690cf2fa49934d06c361190fed8d2a495a38dd896e6b83d5fb8 (driver=local)

2019-03-06T22:04:15.620513442+01:00 volume create a0934fe71a154a4ed955a9bda0fbc0045218034517b7214dfcc058e074480c5c (driver=local)

2019-03-06T22:04:15.631067770+01:00 container create 8a2e6d83c324d5c81919756b1e64bf5874e8923bb575acc0216f2d46fedd8c98 (image=rancher/rancher:latest, name=admiring_chaum, org.label-schema.build-date=2019-03-06T18:22:27Z, org.label-schema.schema-version=1.0, org.label-schema.vcs-ref=6472ba0c03ff7a222f5891ce5272e2e4261d8f58, org.label-schema.vcs-url=https://github.com/rancher/rancher.git)

2019-03-06T22:04:15.635846949+01:00 container attach 8a2e6d83c324d5c81919756b1e64bf5874e8923bb575acc0216f2d46fedd8c98 (image=rancher/rancher:latest, name=admiring_chaum, org.label-schema.build-date=2019-03-06T18:22:27Z, org.label-schema.schema-version=1.0, org.label-schema.vcs-ref=6472ba0c03ff7a222f5891ce5272e2e4261d8f58, org.label-schema.vcs-url=https://github.com/rancher/rancher.git)

2019-03-06T22:04:15.717222937+01:00 network connect 80a31acde66e6d0ce8df82ece0fb718dff6f708fd7d7251efab142e857b6a30c (container=8a2e6d83c324d5c81919756b1e64bf5874e8923bb575acc0216f2d46fedd8c98, name=bridge, type=bridge)

2019-03-06T22:04:15.730415517+01:00 volume mount e060d957c24b8690cf2fa49934d06c361190fed8d2a495a38dd896e6b83d5fb8 (container=8a2e6d83c324d5c81919756b1e64bf5874e8923bb575acc0216f2d46fedd8c98, destination=/var/lib/rancher, driver=local, propagation=, read/write=true)

2019-03-06T22:04:15.730482959+01:00 volume mount a0934fe71a154a4ed955a9bda0fbc0045218034517b7214dfcc058e074480c5c (container=8a2e6d83c324d5c81919756b1e64bf5874e8923bb575acc0216f2d46fedd8c98, destination=/var/log/auditlog, driver=local, propagation=, read/write=true)

2019-03-06T22:04:16.267125226+01:00 container start 8a2e6d83c324d5c81919756b1e64bf5874e8923bb575acc0216f2d46fedd8c98 (image=rancher/rancher:latest, name=admiring_chaum, org.label-schema.build-date=2019-03-06T18:22:27Z, org.label-schema.schema-version=1.0, org.label-schema.vcs-ref=6472ba0c03ff7a222f5891ce5272e2e4261d8f58, org.label-schema.vcs-url=https://github.com/rancher/rancher.git)

rancher version v2.1.7

2019-03-06T22:04:16.705434718+01:00 container die 8a2e6d83c324d5c81919756b1e64bf5874e8923bb575acc0216f2d46fedd8c98 (exitCode=0, image=rancher/rancher:latest, name=admiring_chaum, org.label-schema.build-date=2019-03-06T18:22:27Z, org.label-schema.schema-version=1.0, org.label-schema.vcs-ref=6472ba0c03ff7a222f5891ce5272e2e4261d8f58, org.label-schema.vcs-url=https://github.com/rancher/rancher.git)

2019-03-06T22:04:16.808166391+01:00 network disconnect 80a31acde66e6d0ce8df82ece0fb718dff6f708fd7d7251efab142e857b6a30c (container=8a2e6d83c324d5c81919756b1e64bf5874e8923bb575acc0216f2d46fedd8c98, name=bridge, type=bridge)

2019-03-06T22:04:16.817567469+01:00 volume unmount e060d957c24b8690cf2fa49934d06c361190fed8d2a495a38dd896e6b83d5fb8 (container=8a2e6d83c324d5c81919756b1e64bf5874e8923bb575acc0216f2d46fedd8c98, driver=local)

2019-03-06T22:04:16.817624109+01:00 volume unmount a0934fe71a154a4ed955a9bda0fbc0045218034517b7214dfcc058e074480c5c (container=8a2e6d83c324d5c81919756b1e64bf5874e8923bb575acc0216f2d46fedd8c98, driver=local)
```

---

<div class="post-metadata">

**Author:** ![Tamerz](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@Tamerz](https://forums.suse.com/u/Tamerz)\
**Post date:** [March 11, 2019, 7:44pm UTC](https://forums.suse.com/t/rancher-server-restart-loop/12896/6 "2019-03-11T19:44:07Z")

</div>

I’m having the same problem. I have tried creating the “/opt/rancher” directory first, turning off SELinux, and changing the directory to 777. It made no difference, it still just goes into a restart loop.

Running without the volume works fine.

---

<div class="post-metadata">

**Author:** ![superseb](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/superseb/32/2424_2.png) [@superseb](https://forums.suse.com/u/superseb)\
**Post date:** [March 11, 2019, 8:31pm UTC](https://forums.suse.com/t/rancher-server-restart-loop/12896/7 "2019-03-11T20:31:30Z")

</div>

The command is as it is shown in the docs, the `-v` is a docker run parameter, not a Rancher parameter.

```auto
docker run -d --restart=unless-stopped \
  -p 80:80 -p 443:443 \
  -v /opt/rancher:/var/lib/rancher \
  rancher/rancher:latest

```

---

<div class="post-metadata">

**Author:** ![Tamerz](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@Tamerz](https://forums.suse.com/u/Tamerz)\
**Post date:** [March 12, 2019, 3:48pm UTC](https://forums.suse.com/t/rancher-server-restart-loop/12896/8 "2019-03-12T15:48:33Z")

</div>

Thanks, that was my problem. I was just appending the -v parameter to the end.
