Unable to connect with tool #12091

Closed
opened 2026-02-21 19:05:43 -05:00 by yindo · 2 comments
Owner

Originally created by @TDY-raedae on GitHub (Mar 25, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I have written a function to query the database and retrieve its contents. However, when the agent attempts to call the tool function, an error occurs.

Could you help me identify the cause of the issue or provide any suggestions for debugging?
Search code and the workflow are below :

Image

Image
here are Error message:

Image
the docker log of langgenius/dify-plugin-daemon:0.0.5-local

Image
the docker log of worker
Image

the docker log of api

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @TDY-raedae on GitHub (Mar 25, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I have written a function to query the database and retrieve its contents. However, when the agent attempts to call the tool function, an error occurs. Could you help me identify the cause of the issue or provide any suggestions for debugging? Search code and the workflow are below : ![Image](https://github.com/user-attachments/assets/206dd6db-3e3b-4e4e-87b4-aad921166100) ![Image](https://github.com/user-attachments/assets/7750e04d-e802-48f3-966c-bd1532c44af5) here are Error message: ![Image](https://github.com/user-attachments/assets/74926a3e-7538-45ee-9ce1-728b8048a6ad) the docker log of langgenius/dify-plugin-daemon:0.0.5-local ![Image](https://github.com/user-attachments/assets/f89ff916-b928-4d45-8534-7a1eb4d917ae) the docker log of worker ![Image](https://github.com/user-attachments/assets/bb5cc219-9c1f-4d83-b017-093576a3b2b1) the docker log of api ![Image](https://github.com/user-attachments/assets/5d66f19c-e596-49b2-942c-e69ce8ecbd24) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🔨 feat:tools label 2026-02-21 19:05:43 -05:00
yindo closed this issue 2026-02-21 19:05:43 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 25, 2025):

Hey @TDY-raedae! 👋 I'm here to help you with bug fixes, questions, and becoming a contributor. Let's squash those bugs together!

The error you're encountering seems to be related to a failure in connecting to the PostgreSQL database, as indicated by the logs from the langgenius/dify-plugin-daemon. The error message "connection refused" and "missing database 'dify_plugin'" suggest that the database service might not be running or is not properly configured.

Here are some steps you can take to troubleshoot and resolve the issue:

  1. Verify Database Configuration: Ensure that the PostgreSQL database is correctly configured and running. Check the environment variables related to the database connection, such as DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, and DB_PASSWORD. Make sure they match the actual database settings [1].

  2. Check Database Service: Confirm that the PostgreSQL service is up and running. You can do this by accessing the PostgreSQL container and using the psql command to connect to the database. If the database is not running, try restarting the Docker container.

  3. Database Initialization: The error log mentions a missing database "dify_plugin". Ensure that this database is created and accessible. You might need to manually create the database if it doesn't exist.

  4. Network Configuration: Check the network settings to ensure that the database is accessible from the dify-plugin-daemon service. The IP address and port should be reachable from within the Docker network.

  5. Review Docker Logs: Continue monitoring the Docker logs for any additional errors or warnings that might provide more context about the issue. Pay attention to any changes in the logs after making adjustments.

  6. Restart Services: After making any changes, restart the Docker services to apply the new configurations:

    docker compose stop
    docker compose up -d
    

By following these steps, you should be able to identify and resolve the connection issue with the PostgreSQL database.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 25, 2025): <!-- Greeting --> Hey @TDY-raedae! 👋 I'm here to help you with bug fixes, questions, and becoming a contributor. Let's squash those bugs together! <!-- Answer --> The error you're encountering seems to be related to a failure in connecting to the PostgreSQL database, as indicated by the logs from the `langgenius/dify-plugin-daemon`. The error message "connection refused" and "missing database 'dify_plugin'" suggest that the database service might not be running or is not properly configured. Here are some steps you can take to troubleshoot and resolve the issue: 1. **Verify Database Configuration**: Ensure that the PostgreSQL database is correctly configured and running. Check the environment variables related to the database connection, such as `DB_HOST`, `DB_PORT`, `DB_DATABASE`, `DB_USERNAME`, and `DB_PASSWORD`. Make sure they match the actual database settings <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/environments.md)</sup>. 2. **Check Database Service**: Confirm that the PostgreSQL service is up and running. You can do this by accessing the PostgreSQL container and using the `psql` command to connect to the database. If the database is not running, try restarting the Docker container. 3. **Database Initialization**: The error log mentions a missing database "dify_plugin". Ensure that this database is created and accessible. You might need to manually create the database if it doesn't exist. 4. **Network Configuration**: Check the network settings to ensure that the database is accessible from the `dify-plugin-daemon` service. The IP address and port should be reachable from within the Docker network. 5. **Review Docker Logs**: Continue monitoring the Docker logs for any additional errors or warnings that might provide more context about the issue. Pay attention to any changes in the logs after making adjustments. 6. **Restart Services**: After making any changes, restart the Docker services to apply the new configurations: ```bash docker compose stop docker compose up -d ``` By following these steps, you should be able to identify and resolve the connection issue with the PostgreSQL database. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/3ca5757c-575e-46c7-a137-4ff1f2b17466?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/3ca5757c-575e-46c7-a137-4ff1f2b17466?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/3ca5757c-575e-46c7-a137-4ff1f2b17466?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/3ca5757c-575e-46c7-a137-4ff1f2b17466?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3ca5757c-575e-46c7-a137-4ff1f2b17466?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/3ca5757c-575e-46c7-a137-4ff1f2b17466?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3ca5757c-575e-46c7-a137-4ff1f2b17466?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Mar 25, 2025):

Duplicated, for limitations on code node, please refer existing issue and issues in this repo. dify-sandbox

@crazywoola commented on GitHub (Mar 25, 2025): Duplicated, for limitations on code node, please refer existing issue and issues in this repo. [dify-sandbox](https://github.com/langgenius/dify-sandbox)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12091