SOLVED: Home-Assistant - new App install - Scale 24.10 - service "postgres_upgrade" fails

New install of Home-Assistant App on Scale 24.10.
When specifying a pre-created dataset for postgres database: /mnt/SSD/Data/HomeAssistant/HomeAssistant-postgres

App install fails with - /var/log/app_lifecycle.log:

Container ix-home-assistant-postgres_upgrade-1 service “postgres_upgrade” didn’t complete successfully: exit 1
service “postgres_upgrade” didn’t complete successfully: exit 1

Solution:
The pre-created postgres dataset/directory is not writable by the App postgres user.
During App install, Postgres user = UID-999/GID-999
(from Truenas SSH):
root@truenas# ls -l /mnt/SSD/Data/HomeAssistant/HomeAssistant-postgres
total 17
drwxr-xr-x 2 root root 2 Dec 12 18:54 .
drwxr-xr-x 4 root root 4 Dec 12 18:54 …

root@truenas# chown 999:999 /mnt/SSD/Data/HomeAssistant/HomeAssistant-postgres

root@truenas# ls -l /mnt/SSD/Data/HomeAssistant/HomeAssistant-postgres
total 17
drwxr-xr-x 2 netdata docker 2 Dec 12 18:54 .
drwxr-xr-x 4 root root 4 Dec 12 18:54 …

2 Likes

Thank you. I have the same problem with Gitea container. Gitea needs to use 1000:1000 and built-in Postgres needs to use 999:999.

:+1: Hoped it would help someone, or at least nudge them in the right direction… or for me to find again when I encounter it next time :yum:

Thank you, helped me with my setup of Nextcloud in Scale since i got the same error when installing.

Only after that i found the Automatic Permissions checkbox under the Postgres Section, which essentially does the job for you, if you know it has to be checked. :wink:

1 Like

Solved this issue for me as well, thanks for the time saver!