Mon serveur YunoHost
Matériel: VPS acheté en ligne
Version de YunoHost: 4.3.6.2
J’ai accès à mon serveur : En SSH | Par la webadmin | En direct avec un clavier/écran | …
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : non
Description du problème
J’ai reçu ce message dans le diagnostique : Le service postgresql est failed
J’ai donc essayé les deux commandes proposées :
yunohost service restart postgresql
// qui me répond
Success! Service 'postgresql' restarted
puis pour avoir une confirmation que ça fonctionne :
service postgresql status
// Qui me répond
●[vert] postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Fri 2022-02-18 12:37:31 UTC; 41s ago
Process: 31303 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 31303 (code=exited, status=0/SUCCESS)
Feb 18 12:37:31 mon.serveur.fr systemd[1]: Starting PostgreSQL RDBMS...
Feb 18 12:37:31 mon.serveur.fr systemd[1]: Started PostgreSQL RDBMS.
Pourtant, si je fait un coup de logs :
yunohost service log postgresql
// Qui me répond
/var/log/postgresql/postgresql-11-main.log:
- b'2021-12-08 14:01:40.417 UTC [22394] LOG: listening on IPv6 address "::1", port 5432'
- b'2021-12-08 14:01:40.418 UTC [22394] LOG: listening on IPv4 address "127.0.0.1", port 5432'
- b'2021-12-08 14:01:40.418 UTC [22394] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"'
- b'2021-12-08 14:01:40.434 UTC [22395] LOG: database system was shut down at 2021-12-08 14:01:39 UTC'
- b'2021-12-08 14:01:40.439 UTC [22394] LOG: database system is ready to accept connections'
- b'2021-12-08 14:01:41.004 UTC [22402] [unknown]@[unknown] LOG: incomplete startup packet'
- b'2021-12-08 14:01:50.193 UTC [22394] LOG: received SIGHUP, reloading configuration files'
- 2022-02-17 22:45:14.706 UTC [22394] LOG: received fast shutdown request
- 2022-02-17 22:45:14.709 UTC [22394] LOG: aborting any active transactions
- 2022-02-17 22:45:14.714 UTC [22394] LOG: background worker "logical replication launcher" (PID 22401) exited with exit code 1
- 2022-02-17 22:45:14.714 UTC [22396] LOG: shutting down
- 2022-02-17 22:45:14.723 UTC [22394] LOG: database system is shut down
- 2022-02-17 22:45:35.274 UTC [873] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- 2022-02-17 22:45:35.274 UTC [873] LOG: database system is shut down
- pg_ctl: could not start server
- Examine the log output.
- 2022-02-18 00:10:06.679 UTC [20324] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- 2022-02-18 00:10:06.680 UTC [20324] LOG: database system is shut down
- pg_ctl: could not start server
- Examine the log output.
- 2022-02-18 00:15:38.177 UTC [21274] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- 2022-02-18 00:15:38.177 UTC [21274] LOG: database system is shut down
- pg_ctl: could not start server
- Examine the log output.
- 2022-02-18 00:16:35.612 UTC [21627] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- 2022-02-18 00:16:35.612 UTC [21627] LOG: database system is shut down
- pg_ctl: could not start server
- Examine the log output.
- 2022-02-18 09:42:31.342 UTC [942] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- 2022-02-18 09:42:31.342 UTC [942] LOG: database system is shut down
- pg_ctl: could not start server
- Examine the log output.
- 2022-02-18 09:57:32.723 UTC [4490] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- 2022-02-18 09:57:32.723 UTC [4490] LOG: database system is shut down
- pg_ctl: could not start server
- Examine the log output.
- 2022-02-18 09:59:50.380 UTC [4783] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- 2022-02-18 09:59:50.380 UTC [4783] LOG: database system is shut down
- pg_ctl: could not start server
- Examine the log output.
- 2022-02-18 10:00:56.148 UTC [4952] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- 2022-02-18 10:00:56.148 UTC [4952] LOG: database system is shut down
- pg_ctl: could not start server
- Examine the log output.
- 2022-02-18 10:04:07.272 UTC [5530] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- 2022-02-18 10:04:07.272 UTC [5530] LOG: database system is shut down
- pg_ctl: could not start server
- Examine the log output.
- 2022-02-18 12:37:31.005 UTC [31302] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- 2022-02-18 12:37:31.005 UTC [31302] LOG: database system is shut down
- pg_ctl: could not start server
- Examine the log output.
journalctl:
- -- Logs begin at Fri 2022-02-18 09:42:26 UTC, end at Fri 2022-02-18 12:41:01 UTC. --
- Feb 18 09:42:31 postgresql@11-main[758]: pg_ctl: could not start server
- Feb 18 09:42:31 postgresql@11-main[758]: Examine the log output.
- Feb 18 09:42:31 systemd[1]: postgresql@11-main.service: Can't open PID file /run/postgresql/11-main.pid (yet?) after start: No such file or directory
- Feb 18 09:42:31 systemd[1]: postgresql@11-main.service: Failed with result 'protocol'.
- Feb 18 09:42:31 systemd[1]: Failed to start PostgreSQL Cluster 11-main.
- Feb 18 09:57:32 systemd[1]: Starting PostgreSQL Cluster 11-main...
- Feb 18 09:57:32 postgresql@11-main[4482]: Error: /usr/lib/postgresql/11/bin/pg_ctl /usr/lib/postgresql/11/bin/pg_ctl start -D /var/lib/postgresql/11/main -l /var/log/postgresql/postgresql-11-main.log -s -o -c config_file="/etc/postgresql/11/main/postgresql.conf" exited with status 1:
- Feb 18 09:57:32 postgresql@11-main[4482]: 2022-02-18 09:57:32.723 UTC [4490] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- Feb 18 09:57:32 postgresql@11-main[4482]: 2022-02-18 09:57:32.723 UTC [4490] LOG: database system is shut down
- Feb 18 09:57:32 postgresql@11-main[4482]: pg_ctl: could not start server
- Feb 18 09:57:32 postgresql@11-main[4482]: Examine the log output.
- Feb 18 09:57:32 systemd[1]: postgresql@11-main.service: Can't open PID file /run/postgresql/11-main.pid (yet?) after start: No such file or directory
- Feb 18 09:57:32 systemd[1]: postgresql@11-main.service: Failed with result 'protocol'.
- Feb 18 09:57:32 systemd[1]: Failed to start PostgreSQL Cluster 11-main.
- Feb 18 09:59:50 systemd[1]: Starting PostgreSQL Cluster 11-main...
- Feb 18 09:59:50 postgresql@11-main[4774]: Error: /usr/lib/postgresql/11/bin/pg_ctl /usr/lib/postgresql/11/bin/pg_ctl start -D /var/lib/postgresql/11/main -l /var/log/postgresql/postgresql-11-main.log -s -o -c config_file="/etc/postgresql/11/main/postgresql.conf" exited with status 1:
- Feb 18 09:59:50 postgresql@11-main[4774]: 2022-02-18 09:59:50.380 UTC [4783] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- Feb 18 09:59:50 postgresql@11-main[4774]: 2022-02-18 09:59:50.380 UTC [4783] LOG: database system is shut down
- Feb 18 09:59:50 postgresql@11-main[4774]: pg_ctl: could not start server
- Feb 18 09:59:50 postgresql@11-main[4774]: Examine the log output.
- Feb 18 09:59:50 systemd[1]: postgresql@11-main.service: Can't open PID file /run/postgresql/11-main.pid (yet?) after start: No such file or directory
- Feb 18 09:59:50 systemd[1]: postgresql@11-main.service: Failed with result 'protocol'.
- Feb 18 09:59:50 systemd[1]: Failed to start PostgreSQL Cluster 11-main.
- Feb 18 10:00:56 systemd[1]: Starting PostgreSQL Cluster 11-main...
- Feb 18 10:00:56 postgresql@11-main[4947]: Error: /usr/lib/postgresql/11/bin/pg_ctl /usr/lib/postgresql/11/bin/pg_ctl start -D /var/lib/postgresql/11/main -l /var/log/postgresql/postgresql-11-main.log -s -o -c config_file="/etc/postgresql/11/main/postgresql.conf" exited with status 1:
- Feb 18 10:00:56 postgresql@11-main[4947]: 2022-02-18 10:00:56.148 UTC [4952] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- Feb 18 10:00:56 postgresql@11-main[4947]: 2022-02-18 10:00:56.148 UTC [4952] LOG: database system is shut down
- Feb 18 10:00:56 postgresql@11-main[4947]: pg_ctl: could not start server
- Feb 18 10:00:56 postgresql@11-main[4947]: Examine the log output.
- Feb 18 10:00:56 systemd[1]: postgresql@11-main.service: Can't open PID file /run/postgresql/11-main.pid (yet?) after start: No such file or directory
- Feb 18 10:00:56 systemd[1]: postgresql@11-main.service: Failed with result 'protocol'.
- Feb 18 10:00:56 systemd[1]: Failed to start PostgreSQL Cluster 11-main.
- Feb 18 10:04:07 systemd[1]: Starting PostgreSQL Cluster 11-main...
- Feb 18 10:04:07 postgresql@11-main[5525]: Error: /usr/lib/postgresql/11/bin/pg_ctl /usr/lib/postgresql/11/bin/pg_ctl start -D /var/lib/postgresql/11/main -l /var/log/postgresql/postgresql-11-main.log -s -o -c config_file="/etc/postgresql/11/main/postgresql.conf" exited with status 1:
- Feb 18 10:04:07 postgresql@11-main[5525]: 2022-02-18 10:04:07.272 UTC [5530] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- Feb 18 10:04:07 postgresql@11-main[5525]: 2022-02-18 10:04:07.272 UTC [5530] LOG: database system is shut down
- Feb 18 10:04:07 postgresql@11-main[5525]: pg_ctl: could not start server
- Feb 18 10:04:07 postgresql@11-main[5525]: Examine the log output.
- Feb 18 10:04:07 systemd[1]: postgresql@11-main.service: Can't open PID file /run/postgresql/11-main.pid (yet?) after start: No such file or directory
- Feb 18 10:04:07 systemd[1]: postgresql@11-main.service: Failed with result 'protocol'.
- Feb 18 10:04:07 systemd[1]: Failed to start PostgreSQL Cluster 11-main.
- Feb 18 12:37:30 systemd[1]: Starting PostgreSQL Cluster 11-main...
- Feb 18 12:37:31 postgresql@11-main[31293]: Error: /usr/lib/postgresql/11/bin/pg_ctl /usr/lib/postgresql/11/bin/pg_ctl start -D /var/lib/postgresql/11/main -l /var/log/postgresql/postgresql-11-main.log -s -o -c config_file="/etc/postgresql/11/main/postgresql.conf" exited with status 1:
- Feb 18 12:37:31 postgresql@11-main[31293]: 2022-02-18 12:37:31.005 UTC [31302] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
- Feb 18 12:37:31 postgresql@11-main[31293]: 2022-02-18 12:37:31.005 UTC [31302] LOG: database system is shut down
- Feb 18 12:37:31 postgresql@11-main[31293]: pg_ctl: could not start server
- Feb 18 12:37:31 postgresql@11-main[31293]: Examine the log output.
- Feb 18 12:37:31 systemd[1]: postgresql@11-main.service: Can't open PID file /run/postgresql/11-main.pid (yet?) after start: No such file or directory
- Feb 18 12:37:31 systemd[1]: postgresql@11-main.service: Failed with result 'protocol'.
- Feb 18 12:37:31 systemd[1]: Failed to start PostgreSQL Cluster 11-main.
On voit bien qu’à mon dernier essai; le 18 février à 12h37, ça fail, alors que quand je fais les status, ça me dit ok.
C’est comme si postrgresql n’avait pas les droits pour ouvrir private key file "/etc/ssl/private/ssl-cert-snakeoil.key"
. Alors je fais :
// ajouter l'utilisateur postgres au groupe ssl-cert
sudo gpasswd -a postgres ssl-cert
// vérifier les droits d'accès au fichier :
sudo chown root:ssl-cert /etc/ssl/private/ssl-cert-snakeoil.key
sudo chmod 740 /etc/ssl/private/ssl-cert-snakeoil.key
// redémarrer le service
sudo /etc/init.d/postgresql start
mais ça ne marche pas, je me retrouve toujours avec le même problème. Du coup dans le diagnostique, j’ai une erreur, alors que quand je faire service postgresql status
c’est censé être actif… Je n’y comprends rien !