Tank permissions problems

When running docker compose up -d tank does not start. A quick look into the logs of the tank container shows that a log file is not writeable.

tank  | 2023/06/22 12:02:14 open /srv/logs/info.log: permission denied

A closer look at the log directory of tank shows /opt/aura/logs/tank belonging to root.I changed the ownership to aura:aura. The /opt/aura/logs/steering.log file also belongs to root. In my opinion this happens because steering and tank are started as the root user in docker.

Cause

docker compose up -d

Output

WARN[0000] The "ICECAST_RELAY_PASSWORD" variable is not set. Defaulting to a blank string. 
WARN[0000] The "ICECAST_SOURCE_PASSWORD" variable is not set. Defaulting to a blank string. 
WARN[0000] The "ICECAST_ADMIN_PASSWORD" variable is not set. Defaulting to a blank string. 
WARN[0000] The "ICECAST_PASSWORD" variable is not set. Defaulting to a blank string. 
WARN[0000] The "AURA_STEERING_AUTH_LDAP_ENABLE" variable is not set. Defaulting to a blank string. 
WARN[0000] The "AURA_ENGINE_API_EXTERNAL_URL" variable is not set. Defaulting to a blank string. 
WARN[0000] The "AURA_DASHBOARD_CLOCK_CSS" variable is not set. Defaulting to a blank string. 
WARN[0000] The "AURA_DASHBOARD_CLOCK_FALLBACK_TEXT" variable is not set. Defaulting to a blank string. 
[+] Running 28/28
 ✔ dashboard-clock 10 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                        5.7s 
   ✔ 31e352740f53 Pull complete                                                         0.9s 
   ✔ c017600940c6 Pull complete                                                         2.9s 
   ✔ c9f8586f07bd Pull complete                                                         3.0s 
   ✔ ee16df044bfc Pull complete                                                         3.0s 
   ✔ 7b28c87fde04 Pull complete                                                         3.1s 
   ✔ 0b9bf7f0b843 Pull complete                                                         3.1s 
   ✔ d4a7a3759779 Pull complete                                                         3.4s 
   ✔ 70312a87614b Pull complete                                                         3.7s 
   ✔ 3fc3d2a45449 Pull complete                                                         3.7s 
   ✔ 3b36673daa63 Pull complete                                                         3.8s 
 ✔ tank 5 layers [⣿⣿⣿⣿⣿]      0B/0B      Pulled                                        16.4s 
   ✔ 93c2d578e421 Pull complete                                                         7.7s 
   ✔ 48581512e0e5 Pull complete                                                        14.1s 
   ✔ 431439781c58 Pull complete                                                        14.2s 
   ✔ 3aec885e9423 Pull complete                                                        14.2s 
   ✔ a6dfef2cd2a6 Pull complete                                                        14.4s 
 ✔ dashboard 10 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                              8.9s 
   ✔ 4db1b89c0bd1 Pull complete                                                         3.4s 
   ✔ 6f8beccece3b Pull complete                                                         3.6s 
   ✔ efba416b8a87 Pull complete                                                         3.6s 
   ✔ 6e7bc8944b52 Pull complete                                                         3.9s 
   ✔ 72805f9582fb Pull complete                                                         4.0s 
   ✔ 4c6615db462e Pull complete                                                         4.0s 
   ✔ d799d200ba56 Pull complete                                                         5.2s 
   ✔ 487d215ecf97 Pull complete                                                         5.2s 
   ✔ 971c80126e51 Pull complete                                                         5.3s 
   ✔ 3256f6060f14 Pull complete                                                         6.9s 
[+] Building 0.0s (0/0)                                                                      
[+] Running 7/7
 ✔ Container dashboard          Healthy                                                32.6s 
 ✔ Container tank-postgres      Healthy                                                31.3s 
 ✔ Container dashboard-clock    Started                                                 0.9s 
 ✔ Container steering-postgres  Healthy                                                 0.9s 
 ✔ Container steering           Healthy                                                32.6s 
 ✘ Container tank               Error                                                  32.4s 
 ✔ Container aura-web-nginx-1   Created                                                 0.1s 
dependency failed to start: container tank exited (1)

Suggested solution

Don't run the tank container as the root user. A workaround would be to fix the file permissions after starting tank once.

sudo chown aura:aura /opt/aura/logs/tank
sudo chown aura:aura /opt/aura/logs/steering.log