Postgres app not running in Scale Electric Eel

Hello, I’m pretty new on Truenas. However I need to run a Posgres database in my home lab. In electric eel there’s a docker image for posgres. It installs but doesn’t deploy.
Postgres app runs as non root user but uid and group are both 999. I believe it is not running because it conflicts with the truenas builtin Docker uid which is 999.
Anyone who can help me?

No, as long as the UID is consistent it will not care whether the user name differs in the container and on Truenas.

Are you using a host path or ixVolume for data storage? I’m guessing a host path and this is just a permissions issue on the dataset.

Edit: Ok I also had the same issue at first using host path, but was able to get it to run. So postgres containers are a little strange with how they expect permissions. We ran into a similar problem with Nextcloud setup, which includes a postgres container. I tried two other ways of setting permissions, which resulted in the app stopping, but this method (which is the same we used for Nextcloud) was successful.

When you create your postgres dataset, do it with POSIX permissions. Click Edit on the Permissions widget then Set ACL. Set the owner to netdata and the group to docker (these correspond to 999:999). Tick the Apply Owner and Apply Group checkboxes and save the ACL. Then deploy the app as normal, using that dataset in your host path for postgres data storage.

Edit 2: Note for future reference, our team is in the process of working on an automatic permissions checkbox that can be applied to postgres db host paths, which should make this process much easier in the near future.

2 Likes

Thanks so much! It worked just perfect!
Alessio

I’m now having another problem. I’ve installed pgAdmin in order to manage postgres databases. However it stucks in deploying. The log of pgamdin container says:

Blockquote
4-11-25 09:22:39.601468+00:00email config is {‘CHECK_EMAIL_DELIVERABILITY’: False, ‘ALLOW_SPECIAL_EMAIL_DOMAINS’: }
2024-11-25 09:22:44.712357+00:00ERROR : Failed to create the directory /var/lib/pgadmin/sessions:
2024-11-25 09:22:44.712396+00:00[Errno 13] Permission denied: ‘/var/lib/pgadmin/sessions’
2024-11-25 09:22:44.712405+00:00HINT : Create the directory /var/lib/pgadmin/sessions, ensure it is writeable by
2024-11-25 09:22:44.712424+00:00’pgadmin’, and try again, or, create a config_local.py file
2024-11-25 09:22:44.712433+00:00and override the SESSION_DB_PATH setting per
2024-11-25 09:22:44.712440+00:00https://www.pgadmin.org/docs/pgadmin4/8.13/config_py.html
2024-11-25 09:22:44.856218+00:00sudo: The “no new privileges” flag is set, which prevents sudo from running as root.
2024-11-25 09:22:44.856303+00:00sudo: If sudo is running in a container, you may need to adjust the container configuration to disable the flag.
2024-11-25 09:22:49.781608+00:00[2024-11-25 09:22:49 +0000] [1] [INFO] Starting gunicorn 22.0.0
2024-11-25 09:22:49.781819+00:00[2024-11-25 09:22:49 +0000] [1] [INFO] Listening at: http://[::]:30056 (1)
2024-11-25 09:22:49.781863+00:00[2024-11-25 09:22:49 +0000] [1] [INFO] Using worker: gthread
2024-11-25 09:22:49.785170+00:00[2024-11-25 09:22:49 +0000] [34] [INFO] Booting worker with pid: 34

Blockquote

OK, I created user e group 5050, applied them to the pgAdmin dataset and everything worked. I’ve also been able to connect it to postgres database.
As I’m using the database as a davinci resolve database, is there any chance to use the same postgres container to run the nextcloud database as well or it will run its oun postgres instance?

1 Like

I don’t believe there is any support for doing this currently

Hi man, thanks again for replying and sorry for this late message due to working duties.
I tried and I can point the postgres service of nextcloud to the existing postgres database, however as it is a different version it doesn’t work.
I’m also trying to understand if there is any chance to assign to the services (like adguard) a different IP than the server’s one but it looks like this is not possible in official apps. I keep studying to better understand how it works. Thanks again