Recovering my Matrix Synapse db
Yesterday, I woke up to my Element desktop being down. After ruling out a firewall issue and replicating on multiple clients and IPs, I discovered that Synapse could not connect to its database.
journalctl logs:
Jan 08 17:28:52 justmatrix matrix-synapse[343655]: File "/opt/venvs/matrix-synapse/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
Jan 08 17:28:52 justmatrix matrix-synapse[343655]: conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
Jan 08 17:28:52 justmatrix matrix-synapse[343655]: psycopg2.OperationalError: connection to server at "X.X.X.X", port 5432 failed: Connection refused
Jan 08 17:28:52 justmatrix matrix-synapse[343655]: Is the server running on that host and accepting TCP/IP connections?