Postgresql is dead + more

Hardware: VPS bought online ( Contabo )
YunoHost version: 11.0.9.14 (stable)
I have access to my server : Through SSH and browser
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

one of the errors that’s coming up non-stop after the migration is service postgresql being dead.

i try to follow the troubleshooting directions given by the diagnosis, but the issue is still there.

$ sudo yunohost service restart postgresql
/bin/systemd-tty-ask-password-agent: error while loading shared libraries: /lib/systemd/libsystemd-shared-247.so: invalid ELF header
Success! Service 'postgresql' restarted
$ sudo yunohost service log postgresql
/var/log/postgresql/postgresql-13-main.log: 
  - 2022-09-19 23:15:47.343 CEST [1748] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-19 23:15:47.345 CEST [1741] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-19 23:15:47.348 CEST [1744] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-19 23:15:47.349 CEST [1749] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-19 23:15:47.355 CEST [1017] LOG:  shutting down
  - 2022-09-19 23:15:47.476 CEST [911] LOG:  database system is shut down
  - 2022-09-19 23:15:47.786 CEST [9740] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-09-19 23:15:47.787 CEST [9740] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-09-19 23:15:47.787 CEST [9740] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-09-19 23:15:47.788 CEST [9740] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-09-19 23:15:47.827 CEST [9741] LOG:  database system was shut down at 2022-09-19 23:15:47 CEST
  - 2022-09-19 23:15:47.914 CEST [9740] LOG:  database system is ready to accept connections
  - 2022-09-21 01:12:32.921 CEST [9740] LOG:  received fast shutdown request
  - 2022-09-21 01:12:32.992 CEST [9740] LOG:  aborting any active transactions
  - 2022-09-21 01:12:32.997 CEST [9740] LOG:  background worker "logical replication launcher" (PID 9747) exited with exit code 1
  - 2022-09-21 01:12:33.015 CEST [28102] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:12:33.017 CEST [9767] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:12:33.019 CEST [9764] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:12:33.020 CEST [9759] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:12:33.021 CEST [9765] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:12:33.025 CEST [10221] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:12:33.025 CEST [9766] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:12:33.028 CEST [9786] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:12:33.029 CEST [10220] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:12:33.052 CEST [9742] LOG:  shutting down
  - 2022-09-21 01:12:33.200 CEST [9740] LOG:  database system is shut down
  - 2022-09-21 01:12:33.602 CEST [33866] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-09-21 01:12:33.603 CEST [33866] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-09-21 01:12:33.603 CEST [33866] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-09-21 01:12:33.626 CEST [33866] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-09-21 01:12:33.689 CEST [33867] LOG:  database system was shut down at 2022-09-21 01:12:33 CEST
  - 2022-09-21 01:12:33.760 CEST [33866] LOG:  database system is ready to accept connections
  - 2022-09-21 01:16:11.640 CEST [33866] LOG:  received fast shutdown request
  - 2022-09-21 01:16:11.654 CEST [33866] LOG:  aborting any active transactions
  - 2022-09-21 01:16:11.654 CEST [33925] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:16:11.654 CEST [33891] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:16:11.655 CEST [33892] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:16:11.657 CEST [33889] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:16:11.659 CEST [33888] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:16:11.659 CEST [33886] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:16:11.660 CEST [33866] LOG:  background worker "logical replication launcher" (PID 33873) exited with exit code 1
  - 2022-09-21 01:16:11.661 CEST [33890] matrix_synapse@matrix_synapse FATAL:  terminating connection due to administrator command
  - 2022-09-21 01:16:11.667 CEST [33868] LOG:  shutting down
  - 2022-09-21 01:16:12.153 CEST [33866] LOG:  database system is shut down
  - 2022-09-21 01:16:12.428 CEST [33952] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-09-21 01:16:12.429 CEST [33952] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-09-21 01:16:12.429 CEST [33952] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-09-21 01:16:12.430 CEST [33952] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-09-21 01:16:12.524 CEST [33953] LOG:  database system was shut down at 2022-09-21 01:16:12 CEST
  - 2022-09-21 01:16:12.558 CEST [33952] LOG:  database system is ready to accept connections
journalctl: 
  - error while get services logs from journalctl:
  - Traceback (most recent call last):
  -   File "/usr/lib/python3/dist-packages/yunohost/service.py", line 849, in _get_journalctl_logs
  -     return check_output(
  -   File "/usr/lib/python3/dist-packages/moulinette/utils/process.py", line 29, in check_output
  -     subprocess.check_output(args, stderr=stderr, shell=shell, **kwargs)
  -   File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
  -     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  -   File "/usr/lib/python3.9/subprocess.py", line 528, in run
  -     raise CalledProcessError(retcode, process.args,
  - subprocess.CalledProcessError: Command 'journalctl --no-hostname --no-pager -u postgresql@11-main -n50' returned non-zero exit status 127.

anyone can help?

well, there is also another problem that popped up after the migration:

Configuration file /usr/share/yunohost/yunohost-config/ssl/yunoCA/openssl.cnf appears to have been manually modified.

tbf, i dont think ive personally modified this file, not even sure what it is.

but then this came up when i checked

sudo yunohost tools regen-conf ssl --dry-run --with-diff
Success! The configuration would have been updated for category 'ssl'
ssl: 
  applied: 
    /usr/share/yunohost/yunohost-config/ssl/yunoCA/openssl.cnf: 
      diff: 
      status: forget-about-it
  pending:

so, lol? is that a message from the developers?
or is something actually going on?

i still have the original issue of the post unresolved btw. :sweat_smile:

Ah yeah that’s definitely confusing :stuck_out_tongue:

I think you can manually

sudo rm /usr/share/yunohost/yunohost-config/ssl/yunoCA/openssl.cnf

or maybe the file got deleted already ? Do you still get the same message when re-running the command ?

oh, i solved that, should’ve updated the thread i guess. :sweat_smile:

im still having problem with postgresql though. :face_holding_back_tears:

updated log after having solved this issue.

:~$ sudo yunohost service log postgresql
/var/log/postgresql/postgresql-13-main.log: 
  - 2022-10-01 08:55:27.343 CEST [135943] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(semi.social, HVykjHcfdtlQfBcqfMimMlIp) already exists.
  - 2022-10-01 08:55:27.343 CEST [135943] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('semi.social', 'HVykjHcfdtlQfBcqfMimMlIp', 'image/png', 1411740, 1664607327342, 'Pixel Oliver - Medusa.png', 'pALKLczonRWiJzKXQXJDEbXE', 1664607327342)
  - 2022-10-01 08:55:27.392 CEST [135943] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.392 CEST [135943] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, PMWEwHRbOpwllkWcCmpuyxpz) already exists.
  - 2022-10-01 08:55:27.392 CEST [135943] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'PMWEwHRbOpwllkWcCmpuyxpz', 'image/jpeg', 20355, 1664607327391, 'IMG_20210416_084346_e_1618555512898.jpg', 'EfatNrIvwplpvECJjdRazOkD', 1664607327391)
  - 2022-10-01 08:55:27.462 CEST [135945] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.462 CEST [135945] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, PMWEwHRbOpwllkWcCmpuyxpz) already exists.
  - 2022-10-01 08:55:27.462 CEST [135945] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'PMWEwHRbOpwllkWcCmpuyxpz', 'image/jpeg', 20355, 1664607327460, 'IMG_20210416_084346_e_1618555512898.jpg', 'NDqgXMNRdYSTuMGifoiAYzkB', 1664607327460)
  - 2022-10-01 08:55:27.616 CEST [135974] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.616 CEST [135974] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(autonomic.zone, BihZxEafuxzwMOPptsQrINkn) already exists.
  - 2022-10-01 08:55:27.616 CEST [135974] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('autonomic.zone', 'BihZxEafuxzwMOPptsQrINkn', 'image/jpeg', 44976, 1664607327615, 'socialsalior.jpg', 'MpdKNBvkQcErMXJorreJAyZf', 1664607327615)
  - 2022-10-01 08:55:27.672 CEST [135945] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.672 CEST [135945] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, uMwYEJCrzFZbDpmFgUdHDnvw) already exists.
  - 2022-10-01 08:55:27.672 CEST [135945] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'uMwYEJCrzFZbDpmFgUdHDnvw', 'image/png', 311416, 1664607327671, 'puffinux_psychadelic_simple.png', 'rMjAPsMRPJlkMjchiWAIpSTG', 1664607327671)
  - 2022-10-01 08:55:27.755 CEST [135974] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.755 CEST [135974] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, tdFWvVBvBFOCvmrzcFmnlZqW) already exists.
  - 2022-10-01 08:55:27.755 CEST [135974] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'tdFWvVBvBFOCvmrzcFmnlZqW', 'image/png', 6039, 1664607327754, '280f27c808db6f39.png', 'tzrHcArabNKskQkloXhwpzlh', 1664607327754)
  - 2022-10-01 08:55:27.935 CEST [135976] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.935 CEST [135976] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, PMWEwHRbOpwllkWcCmpuyxpz) already exists.
  - 2022-10-01 08:55:27.935 CEST [135976] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'PMWEwHRbOpwllkWcCmpuyxpz', 'image/jpeg', 20355, 1664607327934, 'IMG_20210416_084346_e_1618555512898.jpg', 'ejpvswMgrRaDvzaXrPMxscAQ', 1664607327934)
  - 2022-10-03 13:06:02.866 CEST [135910] LOG:  received fast shutdown request
  - 2022-10-03 13:06:02.902 CEST [135910] LOG:  aborting any active transactions
  - 2022-10-03 13:06:02.907 CEST [135910] LOG:  background worker "logical replication launcher" (PID 135917) exited with exit code 1
  - 2022-10-03 13:06:02.947 CEST [155405] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 13:06:02.947 CEST [155546] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 13:06:02.947 CEST [165989] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 13:06:02.991 CEST [135912] LOG:  shutting down
  - 2022-10-03 13:06:03.108 CEST [135910] LOG:  database system is shut down
  - 2022-10-03 13:06:03.416 CEST [211884] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-10-03 13:06:03.417 CEST [211884] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-10-03 13:06:03.417 CEST [211884] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-10-03 13:06:03.418 CEST [211884] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-10-03 13:06:03.433 CEST [211885] LOG:  database system was shut down at 2022-10-03 13:06:03 CEST
  - 2022-10-03 13:06:03.523 CEST [211884] LOG:  database system is ready to accept connections
  - 2022-10-03 19:05:44.230 CEST [211884] LOG:  received SIGHUP, reloading configuration files
  - 2022-10-03 19:05:48.751 CEST [222313] postgres@postgres ERROR:  database "dendrite" already exists
  - 2022-10-03 19:05:48.751 CEST [222313] postgres@postgres STATEMENT:  CREATE DATABASE dendrite ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER dendrite;
  - 2022-10-03 21:46:29.045 CEST [211884] LOG:  received fast shutdown request
  - 2022-10-03 21:46:29.127 CEST [211884] LOG:  aborting any active transactions
  - 2022-10-03 21:46:29.133 CEST [211884] LOG:  background worker "logical replication launcher" (PID 211891) exited with exit code 1
  - 2022-10-03 21:46:29.142 CEST [237196] dendrite@dendrite FATAL:  terminating connection due to administrator command
  - 2022-10-03 21:46:29.142 CEST [212273] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 21:46:29.146 CEST [211886] LOG:  shutting down
  - 2022-10-03 21:46:29.298 CEST [211884] LOG:  database system is shut down
  - 2022-10-03 21:46:29.654 CEST [240539] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-10-03 21:46:29.655 CEST [240539] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-10-03 21:46:29.655 CEST [240539] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-10-03 21:46:29.665 CEST [240539] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-10-03 21:46:29.719 CEST [240540] LOG:  database system was shut down at 2022-10-03 21:46:29 CEST
  - 2022-10-03 21:46:29.796 CEST [240539] LOG:  database system is ready to accept connections
journalctl: 
  - -- Journal begins at Thu 2022-09-15 00:26:29 CEST, ends at Mon 2022-10-03 21:46:39 CEST. --
  - Sep 18 18:56:59 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 18:57:02 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 18:57:02 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 18:57:02 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 18:57:10 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:06:13 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 19:06:13 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 19:06:13 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 19:06:13 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 19:06:16 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:37:10 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 19:37:11 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 19:37:11 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 19:37:11 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 19:37:15 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:51:41 systemd[1]: Reloading PostgreSQL Cluster 11-main.
  - Sep 18 19:51:41 systemd[1]: Reloaded PostgreSQL Cluster 11-main.
  - -- Boot 09c6bc504c524e05bdc65fd6bd7462e3 --
  - Sep 19 18:19:12 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 19 18:19:14 postgresql@11-main[686]: Removed stale pid file.
  - Sep 19 18:19:26 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 19 18:31:26 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 19 18:31:26 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 19 18:31:26 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 19 18:31:26 systemd[1]: postgresql@11-main.service: Consumed 1.937s CPU time.
  - -- Boot ee0e86dc619042259065dc271e150806 --
  - Sep 19 18:32:11 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 19 18:32:20 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 19 18:41:56 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 19 18:41:57 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 19 18:41:57 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 19 18:41:57 systemd[1]: postgresql@11-main.service: Consumed 1.559s CPU time.

now that i swapped synapse with dendrite, the issue also swapped between the two lol.
here for the updated log:

:~$ sudo yunohost service log postgresql
/var/log/postgresql/postgresql-13-main.log: 
  - 2022-10-01 08:55:27.935 CEST [135976] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.935 CEST [135976] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, PMWEwHRbOpwllkWcCmpuyxpz) already exists.
  - 2022-10-01 08:55:27.935 CEST [135976] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'PMWEwHRbOpwllkWcCmpuyxpz', 'image/jpeg', 20355, 1664607327934, 'IMG_20210416_084346_e_1618555512898.jpg', 'ejpvswMgrRaDvzaXrPMxscAQ', 1664607327934)
  - 2022-10-03 13:06:02.866 CEST [135910] LOG:  received fast shutdown request
  - 2022-10-03 13:06:02.902 CEST [135910] LOG:  aborting any active transactions
  - 2022-10-03 13:06:02.907 CEST [135910] LOG:  background worker "logical replication launcher" (PID 135917) exited with exit code 1
  - 2022-10-03 13:06:02.947 CEST [155405] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 13:06:02.947 CEST [155546] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 13:06:02.947 CEST [165989] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 13:06:02.991 CEST [135912] LOG:  shutting down
  - 2022-10-03 13:06:03.108 CEST [135910] LOG:  database system is shut down
  - 2022-10-03 13:06:03.416 CEST [211884] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-10-03 13:06:03.417 CEST [211884] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-10-03 13:06:03.417 CEST [211884] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-10-03 13:06:03.418 CEST [211884] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-10-03 13:06:03.433 CEST [211885] LOG:  database system was shut down at 2022-10-03 13:06:03 CEST
  - 2022-10-03 13:06:03.523 CEST [211884] LOG:  database system is ready to accept connections
  - 2022-10-03 19:05:44.230 CEST [211884] LOG:  received SIGHUP, reloading configuration files
  - 2022-10-03 19:05:48.751 CEST [222313] postgres@postgres ERROR:  database "dendrite" already exists
  - 2022-10-03 19:05:48.751 CEST [222313] postgres@postgres STATEMENT:  CREATE DATABASE dendrite ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER dendrite;
  - 2022-10-03 21:46:29.045 CEST [211884] LOG:  received fast shutdown request
  - 2022-10-03 21:46:29.127 CEST [211884] LOG:  aborting any active transactions
  - 2022-10-03 21:46:29.133 CEST [211884] LOG:  background worker "logical replication launcher" (PID 211891) exited with exit code 1
  - 2022-10-03 21:46:29.142 CEST [237196] dendrite@dendrite FATAL:  terminating connection due to administrator command
  - 2022-10-03 21:46:29.142 CEST [212273] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 21:46:29.146 CEST [211886] LOG:  shutting down
  - 2022-10-03 21:46:29.298 CEST [211884] LOG:  database system is shut down
  - 2022-10-03 21:46:29.654 CEST [240539] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-10-03 21:46:29.655 CEST [240539] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-10-03 21:46:29.655 CEST [240539] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-10-03 21:46:29.665 CEST [240539] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-10-03 21:46:29.719 CEST [240540] LOG:  database system was shut down at 2022-10-03 21:46:29 CEST
  - 2022-10-03 21:46:29.796 CEST [240539] LOG:  database system is ready to accept connections
  - 2022-10-05 23:44:35.102 CEST [240539] LOG:  received fast shutdown request
  - 2022-10-05 23:44:35.135 CEST [240539] LOG:  aborting any active transactions
  - 2022-10-05 23:44:35.141 CEST [240539] LOG:  background worker "logical replication launcher" (PID 240546) exited with exit code 1
  - 2022-10-05 23:44:35.145 CEST [261743] dendrite@dendrite FATAL:  terminating connection due to administrator command
  - 2022-10-05 23:44:35.145 CEST [241452] dendrite@dendrite FATAL:  terminating connection due to administrator command
  - 2022-10-05 23:44:35.145 CEST [240589] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-05 23:44:35.145 CEST [241453] dendrite@dendrite FATAL:  terminating connection due to administrator command
  - 2022-10-05 23:44:35.148 CEST [243083] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-05 23:44:35.148 CEST [243084] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-05 23:44:35.155 CEST [240541] LOG:  shutting down
  - 2022-10-05 23:44:35.296 CEST [240539] LOG:  database system is shut down
  - 2022-10-05 23:44:35.620 CEST [288426] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-10-05 23:44:35.621 CEST [288426] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-10-05 23:44:35.621 CEST [288426] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-10-05 23:44:35.622 CEST [288426] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-10-05 23:44:35.673 CEST [288427] LOG:  database system was shut down at 2022-10-05 23:44:35 CEST
  - 2022-10-05 23:44:35.730 CEST [288426] LOG:  database system is ready to accept connections
journalctl: 
  - -- Journal begins at Thu 2022-09-15 00:26:29 CEST, ends at Wed 2022-10-05 23:44:43 CEST. --
  - Sep 18 18:56:59 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 18:57:02 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 18:57:02 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 18:57:02 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 18:57:10 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:06:13 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 19:06:13 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 19:06:13 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 19:06:13 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 19:06:16 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:37:10 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 19:37:11 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 19:37:11 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 19:37:11 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 19:37:15 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:51:41 systemd[1]: Reloading PostgreSQL Cluster 11-main.
  - Sep 18 19:51:41 systemd[1]: Reloaded PostgreSQL Cluster 11-main.
  - -- Boot 09c6bc504c524e05bdc65fd6bd7462e3 --
  - Sep 19 18:19:12 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 19 18:19:14 postgresql@11-main[686]: Removed stale pid file.
  - Sep 19 18:19:26 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 19 18:31:26 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 19 18:31:26 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 19 18:31:26 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 19 18:31:26 systemd[1]: postgresql@11-main.service: Consumed 1.937s CPU time.
  - -- Boot ee0e86dc619042259065dc271e150806 --
  - Sep 19 18:32:11 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 19 18:32:20 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 19 18:41:56 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 19 18:41:57 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 19 18:41:57 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 19 18:41:57 systemd[1]: postgresql@11-main.service: Consumed 1.559s CPU time.

still dead and, don’t know if the two things are related, but i’ve been also receiving this error at least 5 times per day every day in my email inbox:

Failed to resolve A for mms.nohost.me

Issue raised on postgresql is dead after installing dendrite · Issue #64 · YunoHost-Apps/dendrite_ynh · GitHub

I have no idea what is the matter here.

1 Like

im losing it.
ive uninstalled both dendrite and gotosocial and the problem is still there…

sudo yunohost service log postgresql
/var/log/postgresql/postgresql-13-main.log: 
  - b'2022-10-03 13:06:02.866 CEST [135910] LOG:  received fast shutdown request'
  - b'2022-10-03 13:06:02.902 CEST [135910] LOG:  aborting any active transactions'
  - b'2022-10-03 13:06:02.907 CEST [135910] LOG:  background worker "logical replication launcher" (PID 135917) exited with exit code 1'
  - b'2022-10-03 13:06:02.947 CEST [155405] gotosocial@gotosocial FATAL:  terminating connection due to administrator command'
  - b'2022-10-03 13:06:02.947 CEST [155546] gotosocial@gotosocial FATAL:  terminating connection due to administrator command'
  - b'2022-10-03 13:06:02.947 CEST [165989] gotosocial@gotosocial FATAL:  terminating connection due to administrator command'
  - b'2022-10-03 13:06:02.991 CEST [135912] LOG:  shutting down'
  - b'2022-10-03 13:06:03.108 CEST [135910] LOG:  database system is shut down'
  - b'2022-10-03 13:06:03.416 CEST [211884] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit'
  - b'2022-10-03 13:06:03.417 CEST [211884] LOG:  listening on IPv6 address "::1", port 5432'
  - b'2022-10-03 13:06:03.417 CEST [211884] LOG:  listening on IPv4 address "127.0.0.1", port 5432'
  - b'2022-10-03 13:06:03.418 CEST [211884] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"'
  - b'2022-10-03 13:06:03.433 CEST [211885] LOG:  database system was shut down at 2022-10-03 13:06:03 CEST'
  - b'2022-10-03 13:06:03.523 CEST [211884] LOG:  database system is ready to accept connections'
  - b'2022-10-03 19:05:44.230 CEST [211884] LOG:  received SIGHUP, reloading configuration files'
  - b'2022-10-03 19:05:48.751 CEST [222313] postgres@postgres ERROR:  database "dendrite" already exists'
  - b"2022-10-03 19:05:48.751 CEST [222313] postgres@postgres STATEMENT:  CREATE DATABASE dendrite ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER dendrite;"
  - b'2022-10-03 21:46:29.045 CEST [211884] LOG:  received fast shutdown request'
  - b'2022-10-03 21:46:29.127 CEST [211884] LOG:  aborting any active transactions'
  - b'2022-10-03 21:46:29.133 CEST [211884] LOG:  background worker "logical replication launcher" (PID 211891) exited with exit code 1'
  - b'2022-10-03 21:46:29.142 CEST [237196] dendrite@dendrite FATAL:  terminating connection due to administrator command'
  - b'2022-10-03 21:46:29.142 CEST [212273] gotosocial@gotosocial FATAL:  terminating connection due to administrator command'
  - b'2022-10-03 21:46:29.146 CEST [211886] LOG:  shutting down'
  - b'2022-10-03 21:46:29.298 CEST [211884] LOG:  database system is shut down'
  - b'2022-10-03 21:46:29.654 CEST [240539] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit'
  - b'2022-10-03 21:46:29.655 CEST [240539] LOG:  listening on IPv6 address "::1", port 5432'
  - b'2022-10-03 21:46:29.655 CEST [240539] LOG:  listening on IPv4 address "127.0.0.1", port 5432'
  - b'2022-10-03 21:46:29.665 CEST [240539] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"'
  - b'2022-10-03 21:46:29.719 CEST [240540] LOG:  database system was shut down at 2022-10-03 21:46:29 CEST'
  - b'2022-10-03 21:46:29.796 CEST [240539] LOG:  database system is ready to accept connections'
  - b'2022-10-05 23:44:35.102 CEST [240539] LOG:  received fast shutdown request'
  - b'2022-10-05 23:44:35.135 CEST [240539] LOG:  aborting any active transactions'
  - b'2022-10-05 23:44:35.141 CEST [240539] LOG:  background worker "logical replication launcher" (PID 240546) exited with exit code 1'
  - b'2022-10-05 23:44:35.145 CEST [261743] dendrite@dendrite FATAL:  terminating connection due to administrator command'
  - b'2022-10-05 23:44:35.145 CEST [241452] dendrite@dendrite FATAL:  terminating connection due to administrator command'
  - b'2022-10-05 23:44:35.145 CEST [240589] gotosocial@gotosocial FATAL:  terminating connection due to administrator command'
  - b'2022-10-05 23:44:35.145 CEST [241453] dendrite@dendrite FATAL:  terminating connection due to administrator command'
  - b'2022-10-05 23:44:35.148 CEST [243083] gotosocial@gotosocial FATAL:  terminating connection due to administrator command'
  - b'2022-10-05 23:44:35.148 CEST [243084] gotosocial@gotosocial FATAL:  terminating connection due to administrator command'
  - b'2022-10-05 23:44:35.155 CEST [240541] LOG:  shutting down'
  - b'2022-10-05 23:44:35.296 CEST [240539] LOG:  database system is shut down'
  - b'2022-10-05 23:44:35.620 CEST [288426] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit'
  - b'2022-10-05 23:44:35.621 CEST [288426] LOG:  listening on IPv6 address "::1", port 5432'
  - b'2022-10-05 23:44:35.621 CEST [288426] LOG:  listening on IPv4 address "127.0.0.1", port 5432'
  - b'2022-10-05 23:44:35.622 CEST [288426] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"'
  - b'2022-10-05 23:44:35.673 CEST [288427] LOG:  database system was shut down at 2022-10-05 23:44:35 CEST'
  - b'2022-10-05 23:44:35.730 CEST [288426] LOG:  database system is ready to accept connections'
  - b'2022-10-25 13:40:27.148 CEST [288426] LOG:  received SIGHUP, reloading configuration files'
  - 2022-10-31 11:47:33.225 CET [288426] LOG:  received SIGHUP, reloading configuration files
  - 2022-10-31 12:03:13.381 CET [288426] LOG:  received fast shutdown request
  - 2022-10-31 12:03:13.405 CET [288426] LOG:  aborting any active transactions
  - 2022-10-31 12:03:13.415 CET [288426] LOG:  background worker "logical replication launcher" (PID 288433) exited with exit code 1
  - 2022-10-31 12:03:13.433 CET [338851] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-31 12:03:13.434 CET [338850] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-31 12:03:13.439 CET [333274] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-31 12:03:13.455 CET [288428] LOG:  shutting down
  - 2022-10-31 12:03:13.550 CET [288426] LOG:  database system is shut down
  - 2022-10-31 12:03:14.810 CET [904144] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-10-31 12:03:14.810 CET [904144] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-10-31 12:03:14.810 CET [904144] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-10-31 12:03:14.840 CET [904144] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-10-31 12:03:14.914 CET [904145] LOG:  database system was shut down at 2022-10-31 12:03:13 CET
  - 2022-10-31 12:03:15.640 CET [904144] LOG:  database system is ready to accept connections
  - 2022-11-04 21:10:35.641 CET [904144] LOG:  received fast shutdown request
  - 2022-11-04 21:10:35.704 CET [904144] LOG:  aborting any active transactions
  - 2022-11-04 21:10:35.711 CET [904144] LOG:  background worker "logical replication launcher" (PID 904151) exited with exit code 1
  - 2022-11-04 21:10:35.714 CET [904146] LOG:  shutting down
  - 2022-11-04 21:10:35.873 CET [904144] LOG:  database system is shut down
  - 2022-11-04 21:10:36.384 CET [999578] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-11-04 21:10:36.385 CET [999578] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-11-04 21:10:36.385 CET [999578] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-11-04 21:10:36.386 CET [999578] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-11-04 21:10:36.454 CET [999579] LOG:  database system was shut down at 2022-11-04 21:10:35 CET
  - 2022-11-04 21:10:36.542 CET [999578] LOG:  database system is ready to accept connections
journalctl: 
  - -- Journal begins at Thu 2022-09-15 00:26:29 CEST, ends at Fri 2022-11-04 21:10:44 CET. --
  - Sep 18 18:56:59 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 18:57:02 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 18:57:02 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 18:57:02 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 18:57:10 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:06:13 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 19:06:13 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 19:06:13 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 19:06:13 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 19:06:16 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:37:10 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 19:37:11 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 19:37:11 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 19:37:11 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 19:37:15 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:51:41 systemd[1]: Reloading PostgreSQL Cluster 11-main.
  - Sep 18 19:51:41 systemd[1]: Reloaded PostgreSQL Cluster 11-main.
  - -- Boot 09c6bc504c524e05bdc65fd6bd7462e3 --
  - Sep 19 18:19:12 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 19 18:19:14 postgresql@11-main[686]: Removed stale pid file.
  - Sep 19 18:19:26 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 19 18:31:26 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 19 18:31:26 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 19 18:31:26 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 19 18:31:26 systemd[1]: postgresql@11-main.service: Consumed 1.937s CPU time.
  - -- Boot ee0e86dc619042259065dc271e150806 --
  - Sep 19 18:32:11 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 19 18:32:20 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 19 18:41:56 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 19 18:41:57 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 19 18:41:57 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 19 18:41:57 systemd[1]: postgresql@11-main.service: Consumed 1.559s CPU time.

still hoping for a solution to this too if anyone understands what’s going on.

Hello @unmy
It seems to be problems with bad requests :

  - 2022-10-01 08:55:27.343 CEST [135943] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('semi.social', 'HVykjHcfdtlQfBcqfMimMlIp', 'image/png', 1411740, 1664607327342, 'Pixel Oliver - Medusa.png', 'pALKLczonRWiJzKXQXJDEbXE', 1664607327342)
  - 2022-10-01 08:55:27.392 CEST [135943] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.392 CEST [135943] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, PMWEwHRbOpwllkWcCmpuyxpz) already exists.

That says a program wants to write a line that already exists in database, and must be unique.

And about this line :slight_smile:

Have you search it and try some ideas of the web on it ?
Maybe something like that : [Solved] PostgreSQL: background worker "logical | 9to5Answer
or that : PostgreSQL: Why does logical replication launcher exit with exit code 1?