# Infinite container restarts

**URL:** <https://forums.balena.io/t/infinite-container-restarts/6182>\
**Category:** Product support\
**Tags:** balenadash\
**Created:** [April 22, 2019, 7:50pm UTC](https://forums.balena.io/t/infinite-container-restarts/6182 "2019-04-22T19:50:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpark](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mpark](https://forums.balena.io/u/mpark)\
**Post date:** [April 22, 2019, 7:50pm UTC](https://forums.balena.io/t/infinite-container-restarts/6182/1 "2019-04-22T19:50:21Z")

</div>

I have tried installing [https://github.com/balena-io-projects/balena-wpe](https://github.com/balena-io-projects/balena-wpe). But the container just keeps restarting.

On the host os:  
`root@9dd686d:~# balena ps

```
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    2ea2a4dfc46e 5b76174cbce2 "/wpe-init" 4 minutes ago Restarting (0) 45 seconds ago main_1097429_891290
    62752de47cd5 balena/armv7hf-supervisor:v9.11.3 "./entry.sh" 3 weeks ago Up 18 minutes (healthy) resin_supervisor`

```

And the logs on the dashboard:  
`22.04.19 19:45:29 (+0000) Restarting service 'main sha256:5b76174cbce2b5fbf50b888c31f1199945985ff6b4b45138176b27aea66186ad' 22.04.19 19:45:30 (+0000) Service exited 'main sha256:5b76174cbce2b5fbf50b888c31f1199945985ff6b4b45138176b27aea66186ad' 22.04.19 19:46:31 (+0000) Restarting service 'main sha256:5b76174cbce2b5fbf50b888c31f1199945985ff6b4b45138176b27aea66186ad' 22.04.19 19:46:32 (+0000) Service exited 'main sha256:5b76174cbce2b5fbf50b888c31f1199945985ff6b4b45138176b27aea66186ad' 22.04.19 19:47:37 (+0000) Restarting service 'main sha256:5b76174cbce2b5fbf50b888c31f1199945985ff6b4b45138176b27aea66186ad' 22.04.19 19:47:37 (+0000) Service exited 'main sha256:5b76174cbce2b5fbf50b888c31f1199945985ff6b4b45138176b27aea66186ad' 22.04.19 19:48:39 (+0000) Restarting service 'main sha256:5b76174cbce2b5fbf50b888c31f1199945985ff6b4b45138176b27aea66186ad' 22.04.19 19:48:41 (+0000) Service exited 'main sha256:5b76174cbce2b5fbf50b888c31f1199945985ff6b4b45138176b27aea66186ad' 22.04.19 19:49:45 (+0000) Restarting service 'main sha256:5b76174cbce2b5fbf50b888c31f1199945985ff6b4b45138176b27aea66186ad' 22.04.19 19:49:48 (+0000) Service exited 'main sha256:5b76174cbce2b5fbf50b888c31f1199945985ff6b4b45138176b27aea66186ad'`

(and so forth)

How can I debug this? The container stops when I try to start it, no logs printed. Not sure how to get into the container and see what’s going on.

Thanks  
Michael

---

<div class="post-metadata">

**Author:** ![tacLog](https://avatars.discourse-cdn.com/v4/letter/t/ecae2f/32.png) [@tacLog](https://forums.balena.io/u/tacLog)\
**Post date:** [April 22, 2019, 8:32pm UTC](https://forums.balena.io/t/infinite-container-restarts/6182/3 "2019-04-22T20:32:33Z")

</div>

Well, I am not sure how much this will help you.

But if you want it to pause long enough to ssh into the container, maybe add a:

```
sleep(600)

```

on the second line of /wpe-init  
This would give you time to get into the container to poke around a bit.

I have no experience with that project so I can’t really recommend anything further.  
-Thomas

---

<div class="post-metadata">

**Author:** ![dt-rush](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dt-rush/32/1405_2.png) [@dt-rush](https://forums.balena.io/u/dt-rush)\
**Post date:** [April 22, 2019, 10:12pm UTC](https://forums.balena.io/t/infinite-container-restarts/6182/4 "2019-04-22T22:12:31Z")

</div>

> [@mpark](#):
>
> 2ea2a4dfc46e

Even if the container is crash-looping, you should be able to run:  
`balena logs 2ea2a4dfc46e`  
from the host OS and possibly get some output.

---

<div class="post-metadata">

**Author:** ![mpark](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mpark](https://forums.balena.io/u/mpark)\
**Post date:** [April 23, 2019, 7:29am UTC](https://forums.balena.io/t/infinite-container-restarts/6182/5 "2019-04-23T07:29:47Z")

</div>

I can, but there is no logging at all.

---

<div class="post-metadata">

**Author:** ![mpark](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mpark](https://forums.balena.io/u/mpark)\
**Post date:** [April 23, 2019, 7:30am UTC](https://forums.balena.io/t/infinite-container-restarts/6182/6 "2019-04-23T07:30:29Z")

</div>

Good idea, I will try that and investigate. Thanks.

---

<div class="post-metadata">

**Author:** ![mpark](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mpark](https://forums.balena.io/u/mpark)\
**Post date:** [April 23, 2019, 7:55am UTC](https://forums.balena.io/t/infinite-container-restarts/6182/7 "2019-04-23T07:55:45Z")

</div>

Solved the problem. Turns out there was a rogue `&` at the end of the `wpe-init.sh` which caused the container to believe everything was finished. 🤥
