How to troubleshoot permission issues on containers (Apps)

o0Bull0o

Cadet
Joined
Dec 31, 2023
Messages
3
Hi All,

I have zoneminder docker container that after an upgrade to truenas gives me;

2023-12-31 21:27:46.505558+00:00* Starting MariaDB database server mysqld
2023-12-31 21:28:16.875167+00:00...fail!
2023-12-31 21:28:16.875870+00:00MySQL failed to start. ZoneMinder and Apache2 will not be started.

I try to connect to the shell to figure out what is going wrong (i believe its a permission issue) But the thing keeps restarting and i cant get into the shell to figure out what happened.

I guess my questions are;
1. How do I identify the name of the container in the command line ("docker ps -a" doesn't show it, when the container is stopped)
2. How do I stop the container from restarting, so I can troubleshoot it? Want to access the logs of mysql to see what is going wrong....

Not really asking here how to solve the problem, just want to know how to troubleshoot it.
 

LarsR

Guru
Joined
Oct 23, 2020
Messages
719
your first problem is, truenas doesn't use docker (it's using k3s kubernetes), and with cobia docker was completely removed from the base os since k3s switched from docker to containerd as container runtime.
you can list your apps by using k3s kubectl get pods -A
 

o0Bull0o

Cadet
Joined
Dec 31, 2023
Messages
3
Thats a good start. So how do i stop it rebooting continuously when it fails to load so i have time to troubleshoot?
 

o0Bull0o

Cadet
Joined
Dec 31, 2023
Messages
3
Okay, I got to the bottom of this.
the dlandon\zoneminder container runs a script (in my case userscript.sh) in the script if it had an issue, it would break out with an "exit 1", forcing the container to restart.
I initially thought it was Kubernetes that was rebooting it, but it wasn't. (I did try changing the restartPolicy from Always to Never on the container, but it didn't want to accept "Never" as a supported option. and to be honest that wouldn't have helped as it was the script causing the reboot anyway...)
The actual issue came down to permissions changing once I upgraded my TrueNas.

Thanks LarsR for your assistance.
 
Top