[PANIC]failed to init dify plugin db: failed to connect to host=localhost user=postgres database=postgres: dial error (dial tcp [::1]:5432: connect: connection refused) #15

Closed
opened 2026-02-16 00:19:03 -05:00 by yindo · 7 comments
Owner

Originally created by @tongxm on GitHub (Feb 24, 2025).

plugin_daemon:
image: langgenius/dify-plugin-daemon:0.0.2-local
restart: always
environment:
# Use the shared environment variables.
DB_HOST: localhost
DB_PORT: 5432
DB_USERNAME: postgres
DB_PASSWORD: tongxm
DB_DATABASE: dify_plugin
REDIS_HOST: localhost
REDIS_PORT: 6379
REDIS_PASSWORD: tongxm
SERVER_PORT: 5002
SERVER_KEY: lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi
MAX_PLUGIN_PACKAGE_SIZE: 52428800
PPROF_ENABLED: false
DIFY_INNER_API_URL: http://host.docker.internal:5001}
DIFY_INNER_API_KEY: QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1
PLUGIN_REMOTE_INSTALLING_HOST: 0.0.0.0
PLUGIN_REMOTE_INSTALLING_PORT: 5003
PLUGIN_WORKING_PATH: /app/storage/cwd
FORCE_VERIFYING_SIGNATURE: true
ports:
- "${EXPOSE_PLUGIN_DAEMON_PORT:-5002}:${PLUGIN_DAEMON_PORT:-5002}"
- "${EXPOSE_PLUGIN_DEBUGGING_PORT:-5003}:${PLUGIN_DEBUGGING_PORT:-5003}"
volumes:
- ./volumes/plugin_daemon:/app/storage

The above is my Docker configuration information, but after Docker starts, an error message appears:

Image

How can I solve this problem

Originally created by @tongxm on GitHub (Feb 24, 2025). plugin_daemon: image: langgenius/dify-plugin-daemon:0.0.2-local restart: always environment: # Use the shared environment variables. DB_HOST: localhost DB_PORT: 5432 DB_USERNAME: postgres DB_PASSWORD: tongxm DB_DATABASE: dify_plugin REDIS_HOST: localhost REDIS_PORT: 6379 REDIS_PASSWORD: tongxm SERVER_PORT: 5002 SERVER_KEY: lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi MAX_PLUGIN_PACKAGE_SIZE: 52428800 PPROF_ENABLED: false DIFY_INNER_API_URL: http://host.docker.internal:5001} DIFY_INNER_API_KEY: QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1 PLUGIN_REMOTE_INSTALLING_HOST: 0.0.0.0 PLUGIN_REMOTE_INSTALLING_PORT: 5003 PLUGIN_WORKING_PATH: /app/storage/cwd FORCE_VERIFYING_SIGNATURE: true ports: - "${EXPOSE_PLUGIN_DAEMON_PORT:-5002}:${PLUGIN_DAEMON_PORT:-5002}" - "${EXPOSE_PLUGIN_DEBUGGING_PORT:-5003}:${PLUGIN_DEBUGGING_PORT:-5003}" volumes: - ./volumes/plugin_daemon:/app/storage The above is my Docker configuration information, but after Docker starts, an error message appears: ![Image](https://github.com/user-attachments/assets/c5ef51b0-441d-4398-9433-d789a0f6cdbd) How can I solve this problem
yindo closed this issue 2026-02-16 00:19:03 -05:00
Author
Owner

@Scenx commented on GitHub (Mar 3, 2025):

fuck me too

@Scenx commented on GitHub (Mar 3, 2025): fuck me too
Author
Owner

@Scenx commented on GitHub (Mar 3, 2025):

fuck me too im remote pg-rds

@Scenx commented on GitHub (Mar 3, 2025): fuck me too im remote pg-rds
Author
Owner

@liuxingar commented on GitHub (Mar 5, 2025):

I made these two changes, which resolved the issue.
Image
Image

@liuxingar commented on GitHub (Mar 5, 2025): I made these two changes, which resolved the issue. ![Image](https://github.com/user-attachments/assets/9e2fbef8-5814-430f-a189-8410cfc14d0a) ![Image](https://github.com/user-attachments/assets/7b99397b-0435-4770-95c1-63d03572ffd0)
Author
Owner

@perzeuss commented on GitHub (Mar 5, 2025):

Please pull from dify main branch and reset the docker compose if you modified it. Issue has been fixed.

@perzeuss commented on GitHub (Mar 5, 2025): Please pull from dify main branch and reset the docker compose if you modified it. Issue has been fixed.
Author
Owner

@ytjhai commented on GitHub (Apr 1, 2025):

I'm still getting this error. It's trying to connect to the Postgres database

@ytjhai commented on GitHub (Apr 1, 2025): I'm still getting this error. It's trying to connect to the Postgres database
Author
Owner

@avasquezkudaw commented on GitHub (May 15, 2025):

Hi guys,

Check this link: https://github.com/langgenius/dify-plugin-daemon/blob/main/.env.example

Here you will find the environment variable, and set:
DB_SSL_MODE: "require"

This worked for me.
Cheers.

@avasquezkudaw commented on GitHub (May 15, 2025): Hi guys, Check this link: https://github.com/langgenius/dify-plugin-daemon/blob/main/.env.example Here you will find the environment variable, and set: DB_SSL_MODE: "require" This worked for me. Cheers.
Author
Owner

@41tair commented on GitHub (Jun 11, 2025):

It looks like it has been fixed.

@41tair commented on GitHub (Jun 11, 2025): It looks like it has been fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#15