Connection reset by peer when setting up SearXNG extention #8293

Closed
opened 2026-02-21 18:24:55 -05:00 by yindo · 4 comments
Owner

Originally created by @ettzzz on GitHub (Feb 15, 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

Hi, dify community,

Just managed to deploy a self hosted Dify by using docker compose up -d command and it works fine. However when setting up SearXNG extension with my self hosted SearXNG service, it's raising an error shown in screenshot image below.

Image

My deployment environment:
machine A - a local machine which hosts Dify related containters
machine B - a remote VPS which hosts SearXNG service

The SearXNG searchings on machine B is working as expected both on html and json(api) side, where the requests are sent from machine A directly through domain.

How to reproduce?

  1. deploy Dify by docker compose up -d
  2. register an admin account and sign in.
  3. Setting up SearXNG extension as my first step and it failed.

✔️ Expected Behavior

to use my self-hosted SearXNG service on machine B.

Actual Behavior

when clicking Save button, it popped up an error telling:
Connction Aborted. ConnectionResetError(104, 'Connection reset by peer'))
I believe this is raised by some python request-sending packages but I didn't manage to find which container this error comes from. Please help. Thanks in advance.

Originally created by @ettzzz on GitHub (Feb 15, 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 Hi, dify community, Just managed to deploy a self hosted Dify by using `docker compose up -d` command and it works fine. However when setting up SearXNG extension with my self hosted SearXNG service, it's raising an error shown in screenshot image below. ![Image](https://github.com/user-attachments/assets/826d3706-a865-48b2-8ac3-f2f459b53cb4) My deployment environment: machine A - a local machine which hosts Dify related containters machine B - a remote VPS which hosts SearXNG service The SearXNG searchings on machine B is working as expected both on `html` and `json(api)` side, where the requests are sent from machine A directly through domain. How to reproduce? 1. deploy Dify by `docker compose up -d` 2. register an admin account and sign in. 3. Setting up SearXNG extension as my first step and it failed. ### ✔️ Expected Behavior to use my self-hosted SearXNG service on machine B. ### ❌ Actual Behavior when clicking `Save` button, it popped up an error telling: `Connction Aborted. ConnectionResetError(104, 'Connection reset by peer'))` I believe this is raised by some python request-sending packages but I didn't manage to find which container this error comes from. Please help. Thanks in advance.
yindo added the 🐞 bug label 2026-02-21 18:24:55 -05:00
yindo closed this issue 2026-02-21 18:24:55 -05:00
Author
Owner

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

Hello, @ettzzz! I'm here to assist you with any bugs, questions, or contributions you have regarding Dify. Let's work together to resolve your issue.

A similar issue was previously reported and resolved. The solution was to set the base URL for SearXNG to http://host.docker.internal:8080 instead of 127.0.0.1. This change allows the dify container to access the searxng container via the host's port [1].

Try updating the SearXNG base URL in your Dify setup to see if this resolves the "Connection reset by peer" error.

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 15, 2025): <!-- Greeting --> Hello, @ettzzz! I'm here to assist you with any bugs, questions, or contributions you have regarding Dify. Let's work together to resolve your issue. <!-- Answer --> A similar issue was previously reported and resolved. The solution was to set the base URL for SearXNG to `http://host.docker.internal:8080` instead of `127.0.0.1`. This change allows the `dify` container to access the `searxng` container via the host's port <sup>[[1]](https://github.com/langgenius/dify/issues/3616)</sup>. Try updating the SearXNG base URL in your Dify setup to see if this resolves the "Connection reset by peer" error. <!-- 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/2171f308-1deb-49a0-b5fa-f0d11228cd27?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/2171f308-1deb-49a0-b5fa-f0d11228cd27?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/2171f308-1deb-49a0-b5fa-f0d11228cd27?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/2171f308-1deb-49a0-b5fa-f0d11228cd27?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2171f308-1deb-49a0-b5fa-f0d11228cd27?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/2171f308-1deb-49a0-b5fa-f0d11228cd27?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/2171f308-1deb-49a0-b5fa-f0d11228cd27?feedback_type=other)</sup>
Author
Owner

@ettzzz commented on GitHub (Feb 15, 2025):

@dosu
To be clarify, the Dify and SearXNG are not hosted in the same instance.
Or is it mandatory that they have to be in the same machine?

@ettzzz commented on GitHub (Feb 15, 2025): @dosu To be clarify, the Dify and SearXNG are not hosted in the same instance. Or is it mandatory that they have to be in the same machine?
Author
Owner

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

It's not mandatory for Dify and SearXNG to be on the same machine. However, the connection issue might be due to network configurations or firewall settings between the two machines. Ensure that the network allows traffic between the Dify host and the SearXNG service on the necessary ports. You might also want to check if there are any specific security settings on the VPS that could be blocking the connection. Additionally, verify that the SearXNG base URL is correctly set to the public IP or domain of the VPS hosting SearXNG, and that it's accessible from the Dify host.

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 15, 2025): <!-- Answer --> It's not mandatory for Dify and SearXNG to be on the same machine. However, the connection issue might be due to network configurations or firewall settings between the two machines. Ensure that the network allows traffic between the Dify host and the SearXNG service on the necessary ports. You might also want to check if there are any specific security settings on the VPS that could be blocking the connection. Additionally, verify that the SearXNG base URL is correctly set to the public IP or domain of the VPS hosting SearXNG, and that it's accessible from the Dify host. <!-- 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/6a43f2ed-fbf0-4dac-b2eb-fd7f5df5c21d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/6a43f2ed-fbf0-4dac-b2eb-fd7f5df5c21d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/6a43f2ed-fbf0-4dac-b2eb-fd7f5df5c21d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/6a43f2ed-fbf0-4dac-b2eb-fd7f5df5c21d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6a43f2ed-fbf0-4dac-b2eb-fd7f5df5c21d?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/6a43f2ed-fbf0-4dac-b2eb-fd7f5df5c21d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6a43f2ed-fbf0-4dac-b2eb-fd7f5df5c21d?feedback_type=other)</sup>
Author
Owner

@ettzzz commented on GitHub (Feb 16, 2025):

Found a workaround to solve my problem but not the problem.

To those who are hosting their domains on cloudflare.com, you can try changing the ip-host pair in your docker-api-1 container's /etc/hosts. The error triggered in this issue can be solved by this way. The ip resolved by the container's default DNS setting cannot be connected. Use some other tool like CloudflareSpeedTest to get the optimal ip.

This issue will be then closed.

@ettzzz commented on GitHub (Feb 16, 2025): Found a workaround to solve `my` problem but not `the` problem. To those who are hosting their domains on cloudflare.com, you can try changing the ip-host pair in your `docker-api-1` container's `/etc/hosts`. The error triggered in this issue can be solved by this way. The ip resolved by the container's default DNS setting cannot be connected. Use some other tool like [CloudflareSpeedTest](https://github.com/XIU2/CloudflareSpeedTest) to get the optimal ip. This issue will be then closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8293