matrix-org / rust-synapse-compress-state

A tool to compress some state in a Synapse instance's database
https://pypi.org/project/synapse-auto-compressor/
Apache License 2.0
147 stars 33 forks source link

How to run on postgres in docker container? #119

Closed ccgauvin94 closed 1 year ago

ccgauvin94 commented 1 year ago

I'm running my Postgres in a docker container on the same network as synapse, but not exposed to the web. I've tried running a variety of commands to connect, but it always fails:

./synapse_auto_compressor -p postgresql://user:password@docker_container -c 500 -n 100

./synapse_auto_compressor -p postgresql://user:password@web_address_of_synapse -c 500 -n 100

Any suggestions? Sorry, super newb with Postgres.

MadLittleMods commented 1 year ago

This doesn't sound like a problem with Synapse state compressor and more just a support request on how to run this with how you have Postgres configured in Docker and how to access it. This kind of thing should be asked in the #synapse:matrix.org room instead of an issue in this repo.

The first thing to check is if you can connect outside of trying to use the state compressor:

psql --host localhost --user postgres --password xxx synapse

If you don't have a username or password, then it's simply the following command:

psql --host localhost synapse

In order to better give a more accurate guess, we would need to know this sort of info:

$ docker ps --all | grep postgres

Perhaps you just need this (replace user/password with your actual credentials):

./synapse_auto_compressor -p postgresql://user:password@localhost/synapse  -c 500 -n 100