invoke llm model failed: Post "http://host.docker.internal:5001/inner/api/invoke/llm\": dial tcp: lookup host.docker.internal on 127.0.0.11:53: no such host
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
1.0.1
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
Source deployed v1.0.1, encountered an error while using agent function call , seems like config err
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
To resolve the DNS resolution issue in a self-hosted Dify version 1.0.1 where 'host.docker.internal' could not be found, you can try the following solution:
This error typically occurs when Docker is not configured to recognize 'host.docker.internal'. For Mac and Windows, Docker should automatically resolve 'host.docker.internal'. However, if you are on Linux, you might need to manually set up the DNS resolution. You can do this by adding an entry to your /etc/hosts file or by configuring Docker to use a custom DNS server that resolves 'host.docker.internal'.
Alternatively, you can replace 'host.docker.internal' with the actual IP address of your Docker host. Update the service configuration to use the host's IP address directly instead of relying on DNS resolution:
http://<your-docker-host-ip>:5001
If you are using environment variables to configure the host, ensure that they are set correctly as per your operating system's instructions. For example, on macOS, you can use launchctl to set the environment variable:
launchctl setenv OLLAMA_HOST "0.0.0.0"
And on Linux, you can edit the systemd service:
[Service]
Environment="OLLAMA_HOST=0.0.0.0"
Then reload and restart the service:
systemctl daemon-reload
systemctl restart ollama
These steps should help resolve the DNS resolution issue by ensuring that the service can correctly access the Docker host [1].
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
Cant reproduce, seems like a network issue to me. There might be something wrong with your proxy settings.