Has anybody out there ever have a message like this and if so how was it resolved?
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at “0.0.0.0”, port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
I guess, In windows python or other will not connect to ‘0.0.0.0’ it will connect to ‘127.0.0.1’ or ‘localhost’ that is for all listners. Also you have make docker postgress to listen global not inside docker only.
It should have something like
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f99bcfb75de5 postgres:latest “docker-entrypoint.s…” 22 minutes ago Up 22 minutes 0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp postgress
Note: Notice PORT is 0.0.0.0:5432->5432/tcp and it is not just 5432, this means it will listen to any connection in window not only inside docker. [It write 0.0.0.0 but is it for localhost in WINDOWS]
My suggestion is to remove the postgress and re pull and re run with under process
If you see postgres container → check PORTS column