failed to connect to the endpoint: #20428

Closed
opened 2026-02-21 20:07:25 -05:00 by yindo · 2 comments
Owner

Originally created by @yangliupu on GitHub (Nov 19, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.10.0

Cloud or Self Hosted

Cloud

Steps to reproduce

When i use dify to connect exteral knowledge base, one error happens, the following is screenshot;

Image

Here is my steps:
git clone dify
cd dify/docker
cp .env.example .env
cp middleware.env.example middleware.env
sudo docker compose up -d

so dify installation successfully
in the plugin fuction, i add Vikingdb Knowledge Base plugin, and copy the api endpoint url
then back to knowledge; and add exteral knowledge API, so the error happen,
please help me

✔️ Expected Behavior

please help me
how to slove this question

Actual Behavior

No response

Originally created by @yangliupu on GitHub (Nov 19, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.10.0 ### Cloud or Self Hosted Cloud ### Steps to reproduce When i use dify to connect exteral knowledge base, one error happens, the following is screenshot; <img width="865" height="473" alt="Image" src="https://github.com/user-attachments/assets/9f59dfd5-06c9-4538-8794-fb8fa2b6a16b" /> Here is my steps: git clone dify cd dify/docker cp .env.example .env cp middleware.env.example middleware.env sudo docker compose up -d so dify installation successfully in the plugin fuction, i add Vikingdb Knowledge Base plugin, and copy the api endpoint url then back to knowledge; and add exteral knowledge API, so the error happen, please help me ### ✔️ Expected Behavior please help me how to slove this question ### ❌ Actual Behavior _No response_
yindo added the 👻 feat:rag label 2026-02-21 20:07:25 -05:00
yindo closed this issue 2026-02-21 20:07:25 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 19, 2025):

The error happens because the API endpoint is set to localhost, which refers to the Docker container itself—not your host machine or the Vikingdb service. Dify tries to validate the endpoint by making a POST request to {endpoint}/retrieval through its internal SSRF proxy, and if it can't reach the service, you'll see "failed to connect to the endpoint" source.

To fix this:

  • Change the API endpoint from localhost to either host.docker.internal (if Vikingdb runs on your host) or use the actual LAN IP address of the machine running Vikingdb. This makes the endpoint accessible from inside the Docker container source.
  • Make sure the endpoint URL starts with http:// or https:// and is reachable from the container.
  • Double-check your API key and credentials.
  • If Vikingdb runs in another container, use the Docker network name as the hostname.
  • Ensure any required ports are exposed in your docker-compose.yaml (for example, 5001:5001 if your service uses port 5001) source.
  • If you use a proxy (like SSRF proxy), confirm the proxy config allows traffic to the Vikingdb endpoint and port.

You can test connectivity by running curl <endpoint>/retrieval from inside the Dify container. If it fails, the endpoint is not accessible.

Let me know if you need help with a specific endpoint or Docker setup!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 19, 2025): <!-- Answer --> The error happens because the API endpoint is set to `localhost`, which refers to the Docker container itself—not your host machine or the Vikingdb service. Dify tries to validate the endpoint by making a POST request to `{endpoint}/retrieval` through its internal SSRF proxy, and if it can't reach the service, you'll see "failed to connect to the endpoint" [source](https://github.com/langgenius/dify/blob/a1b735a4c09974ff25920c975ade19eb3d5a2d42/api/services/external_knowledge_service.py#L10-L99). To fix this: - Change the API endpoint from `localhost` to either `host.docker.internal` (if Vikingdb runs on your host) or use the actual LAN IP address of the machine running Vikingdb. This makes the endpoint accessible from inside the Docker container [source](https://github.com/langgenius/dify-official-plugins/issues/1542). - Make sure the endpoint URL starts with `http://` or `https://` and is reachable from the container. - Double-check your API key and credentials. - If Vikingdb runs in another container, use the Docker network name as the hostname. - Ensure any required ports are exposed in your `docker-compose.yaml` (for example, `5001:5001` if your service uses port 5001) [source](https://github.com/langgenius/dify-official-plugins/issues/1816). - If you use a proxy (like SSRF proxy), confirm the proxy config allows traffic to the Vikingdb endpoint and port. You can test connectivity by running `curl <endpoint>/retrieval` from inside the Dify container. If it fails, the endpoint is not accessible. Let me know if you need help with a specific endpoint or Docker setup! <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/9c642898-516a-4dff-ab4c-a98f0246db79?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/9c642898-516a-4dff-ab4c-a98f0246db79?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/9c642898-516a-4dff-ab4c-a98f0246db79?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/9c642898-516a-4dff-ab4c-a98f0246db79?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9c642898-516a-4dff-ab4c-a98f0246db79?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/9c642898-516a-4dff-ab4c-a98f0246db79?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9c642898-516a-4dff-ab4c-a98f0246db79?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/28426)
Author
Owner

@yangliupu commented on GitHub (Nov 19, 2025):

If I am using vikingdb's cloud service and the base_url is https://api-knowledgebase.mlp.cn-beijing.volces.com, how should I set the endpoint and api key.

i set the endpoint is : https://api-knowledgebase.mlp.cn-beijing.volces.com/e/8ez12u2v1ylhqhts/vikingdb/knowledge_base
and api key is my vikingdb's api key,but one error happen:

Image
@yangliupu commented on GitHub (Nov 19, 2025): If I am using vikingdb's cloud service and the base_url is https://api-knowledgebase.mlp.cn-beijing.volces.com, how should I set the endpoint and api key. i set the endpoint is : https://api-knowledgebase.mlp.cn-beijing.volces.com/e/8ez12u2v1ylhqhts/vikingdb/knowledge_base and api key is my vikingdb's api key,but one error happen: <img width="1910" height="1043" alt="Image" src="https://github.com/user-attachments/assets/296dd21a-0d0d-4a7c-8728-5e5466908be2" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20428