SearXNG query error #112

Closed
opened 2026-02-16 10:18:06 -05:00 by yindo · 15 comments
Owner

Originally created by @TalkIsCheapGiveMeMoney on GitHub (Mar 23, 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

1.1.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

已使用
searxng_search
请求
{"searxng_search": {"query": "合肥天气"}}
响应
{"searxng_search": "tool invoke error: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for SessionMessage\ndata\n Input should be a valid dictionary [type=dict_type, input_value=('type', \u003cMessageType.TEXT: 'text'\u003e), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.8/v/dict_type"}"}

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @TalkIsCheapGiveMeMoney on GitHub (Mar 23, 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 1.1.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 已使用 searxng_search 请求 {"searxng_search": {"query": "合肥天气"}} 响应 {"searxng_search": "tool invoke error: PluginInvokeError: {\"args\":{},\"error_type\":\"ValidationError\",\"message\":\"1 validation error for SessionMessage\\ndata\\n Input should be a valid dictionary [type=dict_type, input_value=('type', \\u003cMessageType.TEXT: 'text'\\u003e), input_type=tuple]\\n For further information visit https://errors.pydantic.dev/2.8/v/dict_type\"}"} ![Image](https://github.com/user-attachments/assets/ad78839c-60fc-4875-b4d9-a01b04af14c6) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:18:06 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 23, 2025):

@TalkIsCheapGiveMeMoney Hello there! I'm here to help you with any bugs, questions, or contributions you have for SearXNG. I'm an expert bot and can assist you while you wait for a human maintainer.

I found a similar closed issue related to the PluginInvokeError with a ValidationError in a searxng_search operation when using a self-hosted Dify version with Docker. The suggested solution is to modify the AgentModelConfig class in the __init__.py file to make the entity field optional. Here are the steps:

  1. Navigate to the plugin directory:

    volumes/plugin_daemon/cwd/langgenius/agent-0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13/.venv/lib64/python3.12/site-packages/dify_plugin/interfaces/agent
    
  2. Modify the __init__.py file by changing the AgentModelConfig class:

    # Change from:
    class AgentModelConfig(LLMModelConfig):
        entity: AIModelEntity
    
    # To:
    class AgentModelConfig(LLMModelConfig):
        entity: Optional[AIModelEntity] = Field(default=None)
    
  3. Restart the plugin daemon container:

    docker restart docker-plugin_daemon-1
    

This should address the validation error you're encountering [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

@dosubot[bot] commented on GitHub (Mar 23, 2025): <!-- Greeting --> @TalkIsCheapGiveMeMoney Hello there! I'm here to help you with any bugs, questions, or contributions you have for SearXNG. I'm an expert bot and can assist you while you wait for a human maintainer. <!-- Answer --> I found a similar closed issue related to the `PluginInvokeError` with a `ValidationError` in a `searxng_search` operation when using a self-hosted Dify version with Docker. The suggested solution is to modify the `AgentModelConfig` class in the `__init__.py` file to make the `entity` field optional. Here are the steps: 1. Navigate to the plugin directory: ``` volumes/plugin_daemon/cwd/langgenius/agent-0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13/.venv/lib64/python3.12/site-packages/dify_plugin/interfaces/agent ``` 2. Modify the `__init__.py` file by changing the `AgentModelConfig` class: ```python # Change from: class AgentModelConfig(LLMModelConfig): entity: AIModelEntity # To: class AgentModelConfig(LLMModelConfig): entity: Optional[AIModelEntity] = Field(default=None) ``` 3. Restart the plugin daemon container: ```shell docker restart docker-plugin_daemon-1 ``` This should address the validation error you're encountering <sup>[[1]](https://github.com/langgenius/dify/issues/15884)</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/5a0eb772-25f6-4dfb-b21d-72f6c45a206a?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/5a0eb772-25f6-4dfb-b21d-72f6c45a206a?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/5a0eb772-25f6-4dfb-b21d-72f6c45a206a?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/5a0eb772-25f6-4dfb-b21d-72f6c45a206a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5a0eb772-25f6-4dfb-b21d-72f6c45a206a?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/5a0eb772-25f6-4dfb-b21d-72f6c45a206a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5a0eb772-25f6-4dfb-b21d-72f6c45a206a?feedback_type=other)</sup>
Author
Owner

@mu-dan commented on GitHub (Mar 23, 2025):

你这dify还能接入searxng啊,我这自从searxng更新之后,dify就不能接入了,一接入就报错

Image

@mu-dan commented on GitHub (Mar 23, 2025): 你这dify还能接入searxng啊,我这自从searxng更新之后,dify就不能接入了,一接入就报错 ![Image](https://github.com/user-attachments/assets/e3506f01-46bf-4522-af87-d03d94bdf2c7)
Author
Owner

@TalkIsCheapGiveMeMoney commented on GitHub (Mar 23, 2025):

It has been changed ,but does not work

@TalkIsCheapGiveMeMoney commented on GitHub (Mar 23, 2025): It has been changed ,but does not work
Author
Owner

@TalkIsCheapGiveMeMoney commented on GitHub (Mar 23, 2025):

你这dify还能接入searxng啊,我这自从searxng更新之后,dify就不能接入了,一接入就报错

Image

修改 searxng配置文件 把 limiter 改为false

@TalkIsCheapGiveMeMoney commented on GitHub (Mar 23, 2025): > 你这dify还能接入searxng啊,我这自从searxng更新之后,dify就不能接入了,一接入就报错 > > ![Image](https://github.com/user-attachments/assets/e3506f01-46bf-4522-af87-d03d94bdf2c7) 修改 searxng配置文件 把 limiter 改为false
Author
Owner

@mu-dan commented on GitHub (Mar 24, 2025):

这个确实是,

你这dify还能接入searxng啊,我这自从searxng更新之后,dify就不能接入了,一接入就报错
Image

修改 searxng配置文件 把 limiter 改为false

感谢感谢

@mu-dan commented on GitHub (Mar 24, 2025): 这个确实是, > > 你这dify还能接入searxng啊,我这自从searxng更新之后,dify就不能接入了,一接入就报错 > > ![Image](https://github.com/user-attachments/assets/e3506f01-46bf-4522-af87-d03d94bdf2c7) > > 修改 searxng配置文件 把 limiter 改为false 感谢感谢
Author
Owner

@mu-dan commented on GitHub (Mar 24, 2025):

它已更改,但不起作用

1.0.0版本之前好像还可以正常使用的,主要现在不清楚是searxng的配置问题还是说dify的对接searxng插件的问题,有点毫无头绪

@mu-dan commented on GitHub (Mar 24, 2025): > 它已更改,但不起作用 1.0.0版本之前好像还可以正常使用的,主要现在不清楚是searxng的配置问题还是说dify的对接searxng插件的问题,有点毫无头绪
Author
Owner

@sjtuck commented on GitHub (Mar 24, 2025):

i met the same problem. everything works well on 0.15.3, but does not work on 1.1.2.

PluginInvokeError: {"args":{},"error_type":"ToolProviderCredentialValidationError","message":"HTTPConnectionPool(host='localhost', port=8081): Max retries exceeded with url: /?q=SearXNG\u0026format=json\u0026categories=general (Caused by NewConnectionError('\u003curllib3.connection.HTTPConnection object at 0x7f760a3581d0\u003e: Failed to establish a new connection: [Errno 111] Connection refused'))"}

@sjtuck commented on GitHub (Mar 24, 2025): i met the same problem. everything works well on 0.15.3, but does not work on 1.1.2. PluginInvokeError: {"args":{},"error_type":"ToolProviderCredentialValidationError","message":"HTTPConnectionPool(host='localhost', port=8081): Max retries exceeded with url: /?q=SearXNG\u0026format=json\u0026categories=general (Caused by NewConnectionError('\u003curllib3.connection.HTTPConnection object at 0x7f760a3581d0\u003e: Failed to establish a new connection: [Errno 111] Connection refused'))"}
Author
Owner

@felipechang commented on GitHub (Mar 27, 2025):

Try changing the server limiter to false on the SearXNG settings

@felipechang commented on GitHub (Mar 27, 2025): Try changing the server limiter to false on the SearXNG settings
Author
Owner

@mu-dan commented on GitHub (Mar 28, 2025):

Try changing the server limiter to false on the SearXNG settings

The landlord has already fed back this solution, through this solution, you can make dify connect to searxng, but it can't be used, and the main problem is the same as the landlord's feedback

@mu-dan commented on GitHub (Mar 28, 2025): > Try changing the server limiter to false on the SearXNG settings The landlord has already fed back this solution, through this solution, you can make dify connect to searxng, but it can't be used, and the main problem is the same as the landlord's feedback
Author
Owner

@sunkunkun commented on GitHub (Apr 1, 2025):

I encountered the same problem as the landlord's feedback

请求
{"searxng_search": {"query": "今日重要新闻"}}
响应
{"searxng_search": "tool invoke error: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for SessionMessage\ndata\n Input should be a valid dictionary [type=dict_type, input_value=('type', \u003cMessageType.TEXT: 'text'\u003e), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.8/v/dict_type"}"}

Image

@sunkunkun commented on GitHub (Apr 1, 2025): I encountered the same problem as the landlord's feedback 请求 {"searxng_search": {"query": "今日重要新闻"}} 响应 {"searxng_search": "tool invoke error: PluginInvokeError: {\"args\":{},\"error_type\":\"ValidationError\",\"message\":\"1 validation error for SessionMessage\\ndata\\n Input should be a valid dictionary [type=dict_type, input_value=('type', \\u003cMessageType.TEXT: 'text'\\u003e), input_type=tuple]\\n For further information visit https://errors.pydantic.dev/2.8/v/dict_type\"}"} ![Image](https://github.com/user-attachments/assets/9e3d67d5-4ae1-455a-896f-996d3da8f149)
Author
Owner

@JarBin24 commented on GitHub (Apr 1, 2025):

我这边发现这个错误是因为调用了google等国外的搜索引擎导致的,但是在SearXNG平台上配置的引擎设置对Dify上的SearXNG插件不适用,后面通过https://blog.csdn.net/kooo_kooo/article/details/146588644 这个文章中的settings.yml配置文件中禁用国外浏览器就可以了,希望对你有帮助

@JarBin24 commented on GitHub (Apr 1, 2025): 我这边发现这个错误是因为调用了google等国外的搜索引擎导致的,但是在SearXNG平台上配置的引擎设置对Dify上的SearXNG插件不适用,后面通过https://blog.csdn.net/kooo_kooo/article/details/146588644 这个文章中的settings.yml配置文件中禁用国外浏览器就可以了,希望对你有帮助
Author
Owner

@mu-dan commented on GitHub (Apr 1, 2025):

我这边发现这个错误是因为调用了google等国外的搜索引擎导致的,但是在SearXNG平台上配置的引擎设置对Dify上的SearXNG插件不适用,后面通过 https://blog.csdn.net/kooo_kooo/article/details/146588644 这个文章中的settings.yml配置文件中禁用国外浏览器就可以了,希望对你有帮助

原来要修改配置文件啊,感谢感谢,我去实验一下
It turned out that I was going to modify the configuration file.,Thank you.,I'm going to experiment.

@mu-dan commented on GitHub (Apr 1, 2025): > 我这边发现这个错误是因为调用了google等国外的搜索引擎导致的,但是在SearXNG平台上配置的引擎设置对Dify上的SearXNG插件不适用,后面通过 https://blog.csdn.net/kooo_kooo/article/details/146588644 这个文章中的settings.yml配置文件中禁用国外浏览器就可以了,希望对你有帮助 原来要修改配置文件啊,感谢感谢,我去实验一下 It turned out that I was going to modify the configuration file.,Thank you.,I'm going to experiment.
Author
Owner

@mu-dan commented on GitHub (Apr 1, 2025):

我这边发现这个错误是因为调用了google等国外的搜索引擎导致的,但是在SearXNG平台上配置的引擎设置对Dify上的SearXNG插件不适用,后面通过https://blog.csdn.net/kooo_kooo/article/details/146588644 这个文章中的settings.yml配置文件中禁用国外浏览器就可以了,希望对你有帮助

感谢感谢,已经可以了
Image

@mu-dan commented on GitHub (Apr 1, 2025): > 我这边发现这个错误是因为调用了google等国外的搜索引擎导致的,但是在SearXNG平台上配置的引擎设置对Dify上的SearXNG插件不适用,后面通过https://blog.csdn.net/kooo_kooo/article/details/146588644 这个文章中的settings.yml配置文件中禁用国外浏览器就可以了,希望对你有帮助 感谢感谢,已经可以了 ![Image](https://github.com/user-attachments/assets/786e3703-c7b4-46b5-852a-d264e14ec4b3)
Author
Owner

@capsshift commented on GitHub (Apr 2, 2025):

解决这个问题的关键就是docker中的settings.yaml文件中的配置,这个折腾了我好久。终于在https://blog.csdn.net/kooo_kooo/article/details/146588644得到解决
其实不用那么可麻烦。只需要docker中的searxng能正常运行,直接把settings.yaml文件替换了,就解决问题。

@capsshift commented on GitHub (Apr 2, 2025): 解决这个问题的关键就是docker中的settings.yaml文件中的配置,这个折腾了我好久。终于在https://blog.csdn.net/kooo_kooo/article/details/146588644得到解决。 其实不用那么可麻烦。只需要docker中的searxng能正常运行,直接把settings.yaml文件替换了,就解决问题。
Author
Owner

@creaplus commented on GitHub (Apr 6, 2025):

It's fine if I make SEARXNG_BASE_URL and the host I actually use consistent. Do not use localhost

Image

After configuring the same host in the dify, the authorization can be successfully completed.

@creaplus commented on GitHub (Apr 6, 2025): It's fine if I make SEARXNG_BASE_URL and the host I actually use consistent. Do not use localhost ![Image](https://github.com/user-attachments/assets/06964569-9d4a-44fd-9426-32e87e2e1645) After configuring the same host in the dify, the authorization can be successfully completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#112