Hi, thanks for the tuto. I have gone through most of the steps, but synapse does not start:
synapse-docker-synapse-1 | Error during initialisation:
synapse-docker-synapse-1 | Traceback (most recent call last):
synapse-docker-synapse-1 | File “/usr/local/lib/python3.11/site-packages/synapse/app/homeserver.py”, line 353, in setup
synapse-docker-synapse-1 | hs.setup()
synapse-docker-synapse-1 | File “/usr/local/lib/python3.11/site-packages/synapse/server.py”, line 339, in setup
synapse-docker-synapse-1 | self.datastores = Databases(self.DATASTORE_CLASS, self)
synapse-docker-synapse-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
synapse-docker-synapse-1 | File “/usr/local/lib/python3.11/site-packages/synapse/storage/databases/init.py”, line 65, in init
synapse-docker-synapse-1 | with make_conn(database_config, engine, “startup”) as db_conn:
synapse-docker-synapse-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
synapse-docker-synapse-1 | File “/usr/local/lib/python3.11/site-packages/synapse/storage/database.py”, line 161, in make_conn
synapse-docker-synapse-1 | native_db_conn = engine.module.connect(**db_params)
synapse-docker-synapse-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
synapse-docker-synapse-1 | File “/usr/local/lib/python3.11/site-packages/psycopg2/init.py”, line 122, in connect
synapse-docker-synapse-1 | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
synapse-docker-synapse-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
synapse-docker-synapse-1 | psycopg2.OperationalError: could not connect to server: Connection refused
synapse-docker-synapse-1 | Is the server running on host “db” (172.28.0.2) and accepting
synapse-docker-synapse-1 | TCP/IP connections on port 5432?
Any idea on why and how to solve. It seems to be the access to the database.
Thanks
I have this:
PostgreSQL Database directory appears to contain a database; Skipping initialization
2023-08-19 20:06:07.170 UTC [1] LOG: starting PostgreSQL 15.4 (Debian 15.4-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2023-08-19 20:06:07.170 UTC [1] LOG: listening on IPv4 address “0.0.0.0”, port 5432
2023-08-19 20:06:07.170 UTC [1] LOG: listening on IPv6 address “::”, port 5432
2023-08-19 20:06:07.177 UTC [1] LOG: listening on Unix socket “/var/run/postgresql/.s.PGSQL.5432”
2023-08-19 20:06:07.185 UTC [29] LOG: database system was shut down at 2023-08-19 20:05:57 UTC
2023-08-19 20:06:07.219 UTC [1] LOG: database system is ready to accept connections
2023-08-19 20:11:07.287 UTC [27] LOG: checkpoint starting: time
2023-08-19 20:11:07.295 UTC [27] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.002 s, sync=0.002 s, total=0.008 s; sync files=2, longest=0.002 s, average=0.001 s; distance=0 kB, estimate=0 kB
The synapse container is not part of the aqua network.
To quickly add it (doesn’t work anymore after restart/reboot):
docker network connect aqua synapse-docker-synapse-1
To add it permanently you need to define aqua as default network in the /opt/synapse-docker/docker-compose.yml. Here’s my compose file to compare, at the bottom you can find the default networks set to aqua.
Hi Markus, Hi everyone,
Sorry to come back, but that was not the reason. I have reset the file and synapse keeps restarting. I have uninstalled and reinstalled the containers, and I have the same behavior. I have two questions to try to understand:
When I test the ports, I have nothing for db:
[root@srv synapse-docker]# docker port synapse-docker-synapse-1
8008/tcp → 127.0.0.1:8008
[root@srv synapse-docker]# docker port synapse-docker-db-1
[root@srv synapse-docker]#
The howto says to grant ownership to user 991:991. what is that user? I don’t have it
Thanks
I always get an access problem to the db container:
Error during initialisation:
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/synapse/app/homeserver.py”, line 353, in setup
hs.setup()
File “/usr/local/lib/python3.11/site-packages/synapse/server.py”, line 339, in setup
self.datastores = Databases(self.DATASTORE_CLASS, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/synapse/storage/databases/init.py”, line 65, in init
with make_conn(database_config, engine, “startup”) as db_conn:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/synapse/storage/database.py”, line 161, in make_conn
native_db_conn = engine.module.connect(**db_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/psycopg2/init.py”, line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host “db” (172.28.0.3) and accepting
TCP/IP connections on port 5432?
I couldn’t log into synapse because it is constantly restarting. Login into db container gives:
Nmap scan report for db (172.28.0.4)
Host is up (0.000050s latency).
rDNS record for 172.28.0.4: c873e01769e4
Not shown: 999 closed tcp ports (reset)
PORT STATE SERVICE
5432/tcp open postgresql
Nmap done: 1 IP address (1 host up) scanned in 0.37 seconds