Mistakenly deleted ticket about PgAdmin
I mistakenly deleted the ticket related to the PgAdmin. I am sorry, I clicked on the wrong button, and I don't know how to undo it (if it is ever possible...)
I am very sorry, hope you can recover it
#1 Updated by Philippe May 5 months ago
Oops... I don't think there's really an option to recover a deleted ticket without digging in the backups of the DB.
For this PGadmin issue in particular, i vaguely remember that there was an operation to do at the end of the setup in order to deal with our environment, so it's a bit annoying.
Will continue from here on this ticket and see how it goes.
I'm in CSR office and could just reboot the GisDB VM: it was stuck at the reboot. Now the Gisaf web services seem to be running correctly.
#4 Updated by Philippe May 5 months ago
Installation of pgadmin4 from:
root@gisdb:/etc/systemd/system# cat /etc/apt/sources.list.d/pgadmin4.list deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bullseye pgadmin4 main
Identification of the failure¶
The packages (from the above mentioned origin) cannot work with the current installation.
That includes pgadmin4 in a Python virtual environment - i don't think it was the case with the previous versions.
Moreover, looking at
/etc/systemd/system/pgadmin.service, the root of pgadmin4 installation seems to have changed from
The main issue now is then that gunicorn isn't provided in the pgadmin4 virtual environment.
Install the missing package manually:
/usr/pgadmin4/venv/bin/pip install gunicorn
Fix the pgadmin4 service:
root@gisdb:/etc/systemd/system# cat pgadmin.service [Unit] Description=Gunicorn daemon (pgadmin) Requires=pgadmin.socket After=network.target [Service] Type=notify # the specific user that our service will run as User=www-data Group=www-data # another option for an even more restricted service is # DynamicUser=yes # see http://0pointer.net/blog/dynamic-users-with-systemd.html RuntimeDirectory=gunicorn WorkingDirectory=/usr/pgadmin4/web ExecStart=/usr/pgadmin4/venv/bin/gunicorn --bind=unix:/run/pgadmin.sock --workers=1 --threads=5 pgAdmin4:app ExecReload=/bin/kill -s HUP $MAINPID KillMode=mixed TimeoutStopSec=5 PrivateTmp=true [Install] WantedBy=multi-user.target
For the record, here's another important piece:
root@gisdb:/etc/systemd/system# cat pgadmin.socket [Unit] Description=gunicorn socket (pgadmin) [Socket] ListenStream=/run/pgadmin.sock # Our service won't need permissions for the socket, since it # inherits the file descriptor by socket activation # only the nginx daemon will need access to the socket User=www-data # Optionally restrict the socket permissions even more. # Mode=600 [Install] WantedBy=sockets.target
@Guilio: the interesting bits were in the comments/logs, which aren't copied in the subsequent mails. Hopefully it won't be needed anymore as a quick check shows success after the fixes mentioned above. The thing is that i don't remember exactly the reason for the tweaks (jargon note: maybe something about CSRF token?).