Synapse fail to install

Details:

  • Date | 2025-08-07 08:39:33
  • Program name | DietPi-Software
  • Command | runuser -u postgres -- psql -c CREATE ROLE synapse WITH LOGIN PASSWORD 'anyPWhere';
  • Exit code | 2
  • DietPi version | v9.15.2 (MichaIng/master)
  • Distro version | bookworm (ID=7,RASPBIAN=0)
  • Kernel version | Linux DietPi 6.12.34+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.34-1+rpt1~bookworm (2025-06-26) aarch64 GNU/Linux
  • Architecture | arm64
  • Hardware model | RPi 5 Model B (aarch64) (ID=5)
  • Power supply | (EG: RAVPower 5V 1A)
  • SD card | (EG: SanDisk Ultra 16 GB)

Steps to reproduce:

  1. Install synapse from dietpi-software

Expected behaviour:

  • synapse should be successfully installed

Actual behaviour:

  • cannot connect to postgres instance

Extra details:

  • when the script is calling the command “runuser -u postgres – psql -c CREATE ROLE synapse WITH LOGIN PASSWORD ‘’;“

Additional logs:

psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?

just checked on my demo RPI5 and installation is working without issues.

[  OK  ] DietPi-Software | pip3 install -U matrix-synapse psycopg2
[  OK  ] DietPi-Software | useradd -rMU -d /mnt/dietpi_userdata/synapse -s /usr/sbin/nologin synapse
[  OK  ] DietPi-Software | systemctl start postgresql
[  OK  ] DietPi-Software | runuser -u postgres -- psql -c CREATE ROLE synapse WITH LOGIN PASSWORD 'password';
[  OK  ] DietPi-Software | runuser -u postgres -- createdb --encoding=UTF8 --locale=C --template=template0 --owner=synapse synapse

Can you check PostgreSQL database running?

journalctl -u postgresql
systemctl status postgresql

I just tried it again and this are the logs of the postgresql:

root@DietPi:/tmp/DietPi-Software# journalctl -u postgresql
Aug 07 12:14:24 DietPi systemd\[1\]: Starting postgresql.service - PostgreSQL RDBMS…
Aug 07 12:14:24 DietPi systemd\[1\]: Finished postgresql.service - PostgreSQL RDBMS.
Aug 07 12:14:25 DietPi systemd\[1\]: postgresql.service: Deactivated successfully.
Aug 07 12:14:25 DietPi systemd\[1\]: Stopped postgresql.service - PostgreSQL RDBMS.
Aug 07 12:15:18 DietPi systemd\[1\]: Starting postgresql.service - PostgreSQL RDBMS…
Aug 07 12:15:18 DietPi systemd\[1\]: Finished postgresql.service - PostgreSQL RDBMS.
root@DietPi:/tmp/DietPi-Software# systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; preset: enabled)
Active: active (exited) since Thu 2025-08-07 12:15:18 CEST; 3min 21s ago
Process: 106919 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 106919 (code=exited, status=0/SUCCESS)
CPU: 1ms

Aug 07 12:15:18 DietPi systemd\[1\]: Starting postgresql.service - PostgreSQL RDBMS…
Aug 07 12:15:18 DietPi systemd\[1\]: Finished postgresql.service - PostgreSQL RDBMS.

Postgre seems to be running. Can you check following

ls -la /var/run/postgresql
root@DietPi:/tmp/DietPi-Software# ls -la /var/run/postgresql
total 0
drwxrwsr-x  2 postgres postgres  40 Aug  7 12:14 .
drwxr-xr-x 23 root     root     660 Aug  7 12:14 ..

can you try to restart postgre and check again

systemctl restart postgresql
ls -la /var/run/postgresql

I tried it… still the same log:

root@DietPi:/tmp/DietPi-Software# ls -la /var/run/postgresql
total 0
drwxrwsr-x  2 postgres postgres  40 Aug  7 12:14 .
drwxr-xr-x 23 root     root     660 Aug  7 12:14 ..

do you have a DietPi configuration for postgre? Can you check?

ls -la /etc/postgresql/15/main/conf.d

Usually this should create the socket

There is a folder /etc/postgresql but nothing in it

?? you mean you don’t have anything inside? No version 15 folder?

No, there is nothing in this folder. I have tried to reinstall the postgresql with the dietpi-software but no, there is nothing in the /etc/postgresql folder

But i have a postgresql folder in my dietpi data directory. there i have this 15/main folder, but no conf.d in there.

As for information: the logs of “systemctl status postgresql” above said it is active but exited

this is ok. Same for my demo system

root@DietPi5:/etc/postgresql/15/main/conf.d# systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; preset: enabled)
     Active: active (exited) since Thu 2025-08-07 12:00:27 CEST; 2h 6min ago
    Process: 4747 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 4747 (code=exited, status=0/SUCCESS)
        CPU: 982us

Aug 07 12:00:27 DietPi5 systemd[1]: Starting postgresql.service - PostgreSQL RDBMS...
Aug 07 12:00:27 DietPi5 systemd[1]: Finished postgresql.service - PostgreSQL RDBMS.
root@DietPi5:/etc/postgresql/15/main/conf.d#

Problem is the missing configuration. Therefore no socket is created.

I have a folder 15 (Postgre version) within /etc/postgresql/. This is the configuration directory as describe on our online docs Databases and Data Store Software Options - DietPi.com Docs

root@DietPi5:~# ls -la /etc/postgresql/
total 12
drwxr-xr-x  3 postgres postgres 4096 Aug  7 11:58 .
drwxr-xr-x 64 root     root     4096 Aug  7 11:59 ..
drwxr-xr-x  3 postgres postgres 4096 Aug  7 11:58 15
root@DietPi5:~#

And there are a couple of config files inside.

root@DietPi5:~# ls -la /etc/postgresql/15/main/
total 68
drwxr-xr-x 3 postgres postgres  4096 Aug  7 11:58 .
drwxr-xr-x 3 postgres postgres  4096 Aug  7 11:58 ..
drwxr-xr-x 2 postgres postgres  4096 Aug  7 11:58 conf.d
-rw-r--r-- 1 postgres postgres   315 Aug  7 11:58 environment
-rw-r--r-- 1 postgres postgres   143 Aug  7 11:58 pg_ctl.conf
-rw-r----- 1 postgres postgres  5002 Aug  7 11:58 pg_hba.conf
-rw-r----- 1 postgres postgres  1636 Aug  7 11:58 pg_ident.conf
-rw-r--r-- 1 postgres postgres 29699 Aug  7 11:58 postgresql.conf
-rw-r--r-- 1 postgres postgres   317 Aug  7 11:58 start.conf
root@DietPi5:~#

Can you remove postgre completely, reboot and try again to install Postgre only?

Ok, i uninstalled it, reboot and reinstalled postgresql. Now it works. I don’t know, what’s changed, because i already did a uninstall/reinstall before - but without a reboot.

So i think we can close this issue now. Thank you!!! :slight_smile:

1 Like