Why does my container repeatedly restart on a raspberry pi?

Stuck with a misbehaving container, I tried adding a device variable DEBUG set to true
and ran this script

    uptime
    if [ -n "$DEBUG" ]; then
        echo "debug set."
        while : ; do
            echo "Idling..."
            sleep 600
        done
    fi

But I get a restart on the container every 20-30 seconds.

Started service 'camera sha256:e0f209599cd28e4e1d76d122bc6cc36b123160e30d51fa008209a17589647003'
 camera  [2019-09-25 02:57:34] Uptime: 02:57:33 up 28 min, 0 users, load average: 2.13, 1.47, 1.14
 camera  [2019-09-25 02:57:34] runCommand.bash idling...
 camera  [2019-09-25 02:57:34] Idling...
Service exited 'camera sha256:e0f209599cd28e4e1d76d122bc6cc36b123160e30d51fa008209a17589647003'
Restarting service 'camera sha256:e0f209599cd28e4e1d76d122bc6cc36b123160e30d51fa008209a17589647003'
 camera  [2019-09-25 02:58:02] Uptime: 02:58:02 up 29 min, 0 users, load average: 2.13, 1.52, 1.16
 camera  [2019-09-25 02:58:02] runCommand.bash idling...
 camera  [2019-09-25 02:58:02] Idling...
Service exited 'camera sha256:e0f209599cd28e4e1d76d122bc6cc36b123160e30d51fa008209a17589647003'

When I use the balena command on the Host OS, I see the container start, then quickly move to a state of Unhealthy, and then die, to be restarted.

What else should I look at?

Support access has been granted to:
https://dashboard.balena-cloud.com/devices/43b6de4f9a07b506ca52e18a71c91071

Hi @jason10
It looks like you reached out to us using the support chat as well.

As I mentioned there, it looks like the supervisor is failing to update the service state after fetching a recent release.
We would need to run some extra diagnostics to understand the root cause (SD card corruption could be the one, but we need to confirm), so it would be helpful if you made the device online (it currently seems to be shut down).

I suggest we continue this conversation in the support thread you created.