Closed malinoff closed 6 years ago
From a plain reading of your stacktrace it seems to me that the PostgreSQL server is unavailable. Please note that django-dbconn-retry
will only retry connecting once. The purpose of this project is not to wait for an unavailable database server, but instead allow other tools to, for example, refresh database credentials without interrupting the current request. I use django-dbconn-retry
to grab new database credentials from a Hashicorp Vault when my project can't log into the database using the credentials it already knows.
You could patch ensure_connection_with_retries()
so that it retries more than once. However, you probably want to introduce some time between retries and this project has problems with threading as it is, so you're on your own there.
tl;dr: the line Reconnecting to the database didn't help could not connect to server: Connection refused
points to django-dbconn-retry
trying to connect to your PostgreSQL twice and failing both times.
Feel free to reopen this if I misunderstood your issue. Thanks.
Hi, thanks for the project. I'm trying to use it instead of
wait-for-it
script withdocker-compose
.runserver
doesn't fail because of an unavailable db - and that's right! However, when trying to apply migrations, the command fails:Here is the relevant
docker-compose.yml
part: