Replies: 1 comment
-
|
The error means Postgres is rejecting connections from your Docker network IP because pg_hba.conf doesn't allow it. The latest Dify docker-compose.yaml doesn't provide an environment variable or built-in config for this—you need to manually update pg_hba.conf to permit connections from your Docker subnet (like 172.18.0.0/16). Here's how you can fix it:
This will persist across restarts since the data directory is mounted as a Docker volume. There’s currently no automated way to do this in Dify’s compose setup, so you’ll need to repeat if you reset volumes or migrate again. For future-proofing, consider mounting a custom pg_hba.conf or using an init script if you rebuild often. References:
To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
Content
Hi Dify Team, I'm trying to run Dify via Docker Compose on a new machine. The api container is constantly throwing an OperationalError: FATAL: no pg_hba.conf entry for host "172.18.0.x".
I noticed that in the latest version, the docker-compose.yaml is auto-generated and the DB configuration has changed. Even after running docker-compose down -v, the connection is still being refused by the Postgres container.
Could you please advise on the correct way to reset the DB permissions or if there's a specific environment variable in the new template to allow these internal connections?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions