docker-api-1 network error #8072

Closed
opened 2026-02-21 18:23:45 -05:00 by yindo · 1 comment
Owner

Originally created by @thymol-zzw on GitHub (Feb 8, 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.14.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Dify is deployed on machine A (ip_a), and there is a service (port 12345) on machine B (ip_b). It enters the docker-api-1 container on machine A and executes "curl -I http://ip_b:12345" The display shows that the connection is not working.
Confirmed content:

  1. The network between machine A and machine B is connected, and within a local area network, telnet shows that they are connected.
  2. If the 12345 service is deployed on machine A and execute in the docker-api-1 container "curl -I http://ip_a:12345", The connection was successful.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @thymol-zzw on GitHub (Feb 8, 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.14.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Dify is deployed on machine A (ip_a), and there is a service (port 12345) on machine B (ip_b). It enters the docker-api-1 container on machine A and executes "curl -I http://ip_b:12345" The display shows that the connection is not working. Confirmed content: 1. The network between machine A and machine B is connected, and within a local area network, telnet shows that they are connected. 2. If the 12345 service is deployed on machine A and execute in the docker-api-1 container "curl -I http://ip_a:12345", The connection was successful. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 18:23:45 -05:00
yindo closed this issue 2026-02-21 18:23:45 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 8, 2025):

I found a similar closed issue that might help with your network error. The suggested solution is to replace localhost with host.docker.internal in the service URL. This change allows the Docker container to access the host machine's network services, which might resolve the "no route to host" error you're experiencing. You can try using the following format for your service URL:

http://host.docker.internal:12345

This should enable the Docker container to connect to the service running on your local network [1].

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Feb 8, 2025): <!-- Answer --> I found a similar closed issue that might help with your network error. The suggested solution is to replace `localhost` with `host.docker.internal` in the service URL. This change allows the Docker container to access the host machine's network services, which might resolve the "no route to host" error you're experiencing. You can try using the following format for your service URL: ```bash http://host.docker.internal:12345 ``` This should enable the Docker container to connect to the service running on your local network <sup>[[1]](https://github.com/langgenius/dify/issues/9353)</sup>. <!-- 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/e6292f11-6d9e-43f7-8c10-440f5c334ebd?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/e6292f11-6d9e-43f7-8c10-440f5c334ebd?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/e6292f11-6d9e-43f7-8c10-440f5c334ebd?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/e6292f11-6d9e-43f7-8c10-440f5c334ebd?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e6292f11-6d9e-43f7-8c10-440f5c334ebd?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/e6292f11-6d9e-43f7-8c10-440f5c334ebd?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8072