The configuration of Ollama is throwing an error. #8590

Closed
opened 2026-02-21 18:26:29 -05:00 by yindo · 2 comments
Owner

Originally created by @1932513663 on GitHub (Feb 24, 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.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image Image Only supports POST, does not support GET.

✔️ Expected Behavior

Expecting to save successfully without errors.

Actual Behavior

No response

Originally created by @1932513663 on GitHub (Feb 24, 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.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce <img width="1231" alt="Image" src="https://github.com/user-attachments/assets/48199471-c6f7-476d-9fc8-ff2f711f76ce" /> <img width="989" alt="Image" src="https://github.com/user-attachments/assets/5f5eae06-888a-4777-be89-bc080af0a21e" /> Only supports POST, does not support GET. ### ✔️ Expected Behavior Expecting to save successfully without errors. ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:26:29 -05:00
yindo closed this issue 2026-02-21 18:26:29 -05:00
Author
Owner

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

Hello, @1932513663! I'm here to help you with any bugs, questions, or issues you might have. Let's work together to solve this problem!

The issues you're experiencing with the Ollama model configuration in Dify version 0.15.2, self-hosted on Docker, are likely due to network connectivity problems. Specifically, the ConnectTimeoutError and the 404 error for a GET request to "/api/chat" suggest that the Ollama service is not accessible from within the Docker container.

To resolve this, you should replace localhost with host.docker.internal in the service configuration. This allows the Docker container to access the host machine's network, which is necessary for connecting to the Ollama service running on the host.

http://host.docker.internal:11434

Additionally, ensure that the Ollama service is configured to be accessible from all IP addresses by setting the OLLAMA_HOST environment variable to 0.0.0.0. Depending on your operating system, you may need to set this environment variable differently:

  • Mac: Use launchctl setenv OLLAMA_HOST "0.0.0.0" and restart the Ollama application.
  • Linux: Edit the ollama.service file to include Environment="OLLAMA_HOST=0.0.0.0" under the [Service] section, then reload and restart the service.
  • Windows: Set the OLLAMA_HOST environment variable through the system environment variables settings, then restart Ollama.

These steps should help ensure that the Ollama service is properly exposed and accessible from your Docker setup [1][2].

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 (Feb 24, 2025): <!-- Greeting --> Hello, @1932513663! I'm here to help you with any bugs, questions, or issues you might have. Let's work together to solve this problem! <!-- Answer --> The issues you're experiencing with the Ollama model configuration in Dify version 0.15.2, self-hosted on Docker, are likely due to network connectivity problems. Specifically, the `ConnectTimeoutError` and the 404 error for a GET request to "/api/chat" suggest that the Ollama service is not accessible from within the Docker container. To resolve this, you should replace `localhost` with `host.docker.internal` in the service configuration. This allows the Docker container to access the host machine's network, which is necessary for connecting to the Ollama service running on the host. ```bash http://host.docker.internal:11434 ``` Additionally, ensure that the Ollama service is configured to be accessible from all IP addresses by setting the `OLLAMA_HOST` environment variable to `0.0.0.0`. Depending on your operating system, you may need to set this environment variable differently: - **Mac**: Use `launchctl setenv OLLAMA_HOST "0.0.0.0"` and restart the Ollama application. - **Linux**: Edit the `ollama.service` file to include `Environment="OLLAMA_HOST=0.0.0.0"` under the `[Service]` section, then reload and restart the service. - **Windows**: Set the `OLLAMA_HOST` environment variable through the system environment variables settings, then restart Ollama. These steps should help ensure that the Ollama service is properly exposed and accessible from your Docker setup <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/learn-more/use-cases/private-ai-ollama-deepseek-dify.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/development/models-integration/ollama.md)</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/09cee5d5-39f7-4255-966d-eabef6709f8c?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/09cee5d5-39f7-4255-966d-eabef6709f8c?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/09cee5d5-39f7-4255-966d-eabef6709f8c?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/09cee5d5-39f7-4255-966d-eabef6709f8c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/09cee5d5-39f7-4255-966d-eabef6709f8c?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/09cee5d5-39f7-4255-966d-eabef6709f8c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/09cee5d5-39f7-4255-966d-eabef6709f8c?feedback_type=other)</sup>
Author
Owner

@1932513663 commented on GitHub (Feb 25, 2025):

Thank you! After replacing localhost with host.docker.internal, the communication is working fine.

@1932513663 commented on GitHub (Feb 25, 2025): Thank you! After replacing localhost with host.docker.internal, the communication is working fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8590