PluginInvokeError with error code 500 internal server error while using Gemini in agent node #644

Closed
opened 2026-02-16 10:20:02 -05:00 by yindo · 10 comments
Owner

Originally created by @Egoistsoul on GitHub (Sep 12, 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 Dify issues & Dify Official Plugins, 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.8.1

Plugin version

0.5.4

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I use Gemini 2.5 Pro in the loop with some tools, and the workflow shutdown and prompt this error:

Run failed: Failed to transform agent message: req_id: 3873f0d022 PluginInvokeError: {"args":{},"error_type":"Exception","message":"invoke llm model failed: request failed with status code: 500 and respond with: {"message":"Internal Server Error","code":"unknown","status":500}\n"}

Image

You can check this yml for details build:

B-学习内容生成-test.yml

✔️ Error log

The agent runs properly.

Originally created by @Egoistsoul on GitHub (Sep 12, 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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.8.1 ### Plugin version 0.5.4 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I use Gemini 2.5 Pro in the loop with some tools, and the workflow shutdown and prompt this error: `Run failed: Failed to transform agent message: req_id: 3873f0d022 PluginInvokeError: {"args":{},"error_type":"Exception","message":"invoke llm model failed: request failed with status code: 500 and respond with: {"message":"Internal Server Error","code":"unknown","status":500}\n"}` <img width="1808" height="512" alt="Image" src="https://github.com/user-attachments/assets/4ab075ff-a277-46b4-8369-46312c458c23" /> You can check this yml for details build: [B-学习内容生成-test.yml](https://github.com/user-attachments/files/22292816/B-.-test.yml) ### ✔️ Error log The agent runs properly.
yindo added the bug label 2026-02-16 10:20:02 -05:00
yindo closed this issue 2026-02-16 10:20:02 -05:00
Author
Owner

@Egoistsoul commented on GitHub (Sep 12, 2025):

BTW, I already pull the latest code this morning.

@Egoistsoul commented on GitHub (Sep 12, 2025): BTW, I already pull the latest code this morning.
Author
Owner

@dosubot[bot] commented on GitHub (Sep 12, 2025):

There are still known issues with PluginInvokeError 500 when using Gemini 2.5 Pro in agent nodes, even after recent updates. This error often happens if the agent workflow expects certain keys (like 'search') in the tool/plugin output, but sometimes the Gemini or search tool response is missing them. This causes the workflow to halt with a 500 error, and it's not always fixed by just pulling the latest code—sometimes the plugin or model config needs to be checked, or the containers need a full rebuild/restart for changes to take effect.

Recent plugin updates (>=0.5.1) have improved error handling, file type filtering, and message formatting for Gemini, but intermittent 500 errors can still occur if the workflow logic doesn't defensively check for missing keys in plugin responses. Immediate workarounds include adding retry logic, verifying your tool/plugin configuration, and using fallback/default values for expected keys in your workflow logic. If the error persists, check the plugin daemon logs for more details, as the root cause may be in the plugin or Gemini API response, not Dify core itself. More details and workarounds are discussed here and here.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Sep 12, 2025): <!-- Answer --> There are still known issues with PluginInvokeError 500 when using Gemini 2.5 Pro in agent nodes, even after recent updates. This error often happens if the agent workflow expects certain keys (like 'search') in the tool/plugin output, but sometimes the Gemini or search tool response is missing them. This causes the workflow to halt with a 500 error, and it's not always fixed by just pulling the latest code—sometimes the plugin or model config needs to be checked, or the containers need a full rebuild/restart for changes to take effect. Recent plugin updates (>=0.5.1) have improved error handling, file type filtering, and message formatting for Gemini, but intermittent 500 errors can still occur if the workflow logic doesn't defensively check for missing keys in plugin responses. Immediate workarounds include adding retry logic, verifying your tool/plugin configuration, and using fallback/default values for expected keys in your workflow logic. If the error persists, check the plugin daemon logs for more details, as the root cause may be in the plugin or Gemini API response, not Dify core itself. More details and workarounds are discussed [here](https://github.com/langgenius/dify-official-plugins/issues/1704) and [here](https://github.com/langgenius/dify/issues/25587). <!-- 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/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=other)</sup>&nbsp;&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-official-plugins/issues/1706)
Author
Owner

@Egoistsoul commented on GitHub (Sep 12, 2025):

There are still known issues with PluginInvokeError 500 when using Gemini 2.5 Pro in agent nodes, even after recent updates. This error often happens if the agent workflow expects certain keys (like 'search') in the tool/plugin output, but sometimes the Gemini or search tool response is missing them. This causes the workflow to halt with a 500 error, and it's not always fixed by just pulling the latest code—sometimes the plugin or model config needs to be checked, or the containers need a full rebuild/restart for changes to take effect.在使用 Gemini 2.5 Pro 的代理节点中,PluginInvokeError 500 的问题仍然存在,即使进行了最近的更新。如果代理工作流期望工具/插件输出中包含某些键(如'search'),但 Gemini 或搜索工具的响应有时会缺少这些键,这种错误就会发生。这会导致工作流因 500 错误而中断,并且仅仅拉取最新代码并不总是能解决问题——有时需要检查插件或模型配置,或者需要完全重建/重启容器才能使更改生效。

Recent plugin updates (>=0.5.1) have improved error handling, file type filtering, and message formatting for Gemini, but intermittent 500 errors can still occur if the workflow logic doesn't defensively check for missing keys in plugin responses. Immediate workarounds include adding retry logic, verifying your tool/plugin configuration, and using fallback/default values for expected keys in your workflow logic. If the error persists, check the plugin daemon logs for more details, as the root cause may be in the plugin or Gemini API response, not Dify core itself. More details and workarounds are discussed here and here.最近的插件更新(>=0.5.1)改进了 Gemini 的错误处理、文件类型过滤和消息格式化,但如果工作流逻辑没有防御性地检查插件响应中缺少的键,仍然可能出现间歇性的 500 错误。立即的解决方法包括添加重试逻辑、验证工具/插件配置,并在工作流逻辑中使用预期键的备用/默认值。如果错误仍然存在,请检查插件守护进程日志以获取更多详细信息,因为根本原因可能在于插件或 Gemini API 响应,而不是 Dify 核心本身。更多详细信息和解决方法讨论在这里和这里。

To reply, just mention @dosu.回复时只需提及@dosu。

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

I believe it has no relevance to the keyword "search".

@Egoistsoul commented on GitHub (Sep 12, 2025): > There are still known issues with PluginInvokeError 500 when using Gemini 2.5 Pro in agent nodes, even after recent updates. This error often happens if the agent workflow expects certain keys (like 'search') in the tool/plugin output, but sometimes the Gemini or search tool response is missing them. This causes the workflow to halt with a 500 error, and it's not always fixed by just pulling the latest code—sometimes the plugin or model config needs to be checked, or the containers need a full rebuild/restart for changes to take effect.在使用 Gemini 2.5 Pro 的代理节点中,PluginInvokeError 500 的问题仍然存在,即使进行了最近的更新。如果代理工作流期望工具/插件输出中包含某些键(如'search'),但 Gemini 或搜索工具的响应有时会缺少这些键,这种错误就会发生。这会导致工作流因 500 错误而中断,并且仅仅拉取最新代码并不总是能解决问题——有时需要检查插件或模型配置,或者需要完全重建/重启容器才能使更改生效。 > > Recent plugin updates (>=0.5.1) have improved error handling, file type filtering, and message formatting for Gemini, but intermittent 500 errors can still occur if the workflow logic doesn't defensively check for missing keys in plugin responses. Immediate workarounds include adding retry logic, verifying your tool/plugin configuration, and using fallback/default values for expected keys in your workflow logic. If the error persists, check the plugin daemon logs for more details, as the root cause may be in the plugin or Gemini API response, not Dify core itself. More details and workarounds are discussed [here](https://github.com/langgenius/dify-official-plugins/issues/1704) and [here](https://github.com/langgenius/dify/issues/25587).最近的插件更新(>=0.5.1)改进了 Gemini 的错误处理、文件类型过滤和消息格式化,但如果工作流逻辑没有防御性地检查插件响应中缺少的键,仍然可能出现间歇性的 500 错误。立即的解决方法包括添加重试逻辑、验证工具/插件配置,并在工作流逻辑中使用预期键的备用/默认值。如果错误仍然存在,请检查插件守护进程日志以获取更多详细信息,因为根本原因可能在于插件或 Gemini API 响应,而不是 Dify 核心本身。更多详细信息和解决方法讨论在这里和这里。 > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot).回复时只需提及@dosu。_ > > How did I do? [Good](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d048489f-9210-45a8-a4d0-2f651cecadc5?feedback_type=other)  [<img alt="Join Discord" width="49" height="20" src="https://camo.githubusercontent.com/d562c2df5e4567ea41d37f1d91a4da0839d8341037045b103b2da268998de17f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d">](https://go.dosu.dev/discord-bot) [<img alt="Share on X" width="58" height="20" src="https://camo.githubusercontent.com/4649f705e2396d6f328dbc8e800a0509c9c17b3b20253b36706c393df124b93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b">](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1706) I believe it has no relevance to the keyword "search".
Author
Owner

@dosubot[bot] commented on GitHub (Sep 12, 2025):

The keyword "search" is relevant here only because the agent workflow expects certain keys (like "search") in the tool/plugin output—when these are missing, it triggers a PluginInvokeError 500. This isn't about the literal keyword, but about missing expected fields in the plugin/tool response. The root cause is that the agent node code doesn't defensively check for the existence of these keys before accessing them, so if Gemini or a search tool returns a response without the expected key, you get a KeyError and a 500 error. This is a known issue and is discussed in detail here.

Recent plugin updates have improved error handling and message formatting, but they can't fully prevent this if the upstream API or plugin returns incomplete data. Immediate workarounds are: add retry logic, verify your tool/plugin configuration, and use fallback/default values for expected keys in your workflow logic. If the error persists, check the plugin daemon logs for more details, as the root cause may be in the plugin or Gemini API response, not Dify core itself.

There are ongoing requests for maintainers to add defensive key checks and retry mechanisms in future versions to make agent nodes more robust, especially for multi-tool workflows. For more context and troubleshooting, see this issue.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Sep 12, 2025): <!-- Answer --> The keyword "search" is relevant here only because the agent workflow expects certain keys (like "search") in the tool/plugin output—when these are missing, it triggers a PluginInvokeError 500. This isn't about the literal keyword, but about missing expected fields in the plugin/tool response. The root cause is that the agent node code doesn't defensively check for the existence of these keys before accessing them, so if Gemini or a search tool returns a response without the expected key, you get a KeyError and a 500 error. This is a known issue and is discussed in detail [here](https://github.com/langgenius/dify-official-plugins/issues/1704). Recent plugin updates have improved error handling and message formatting, but they can't fully prevent this if the upstream API or plugin returns incomplete data. Immediate workarounds are: add retry logic, verify your tool/plugin configuration, and use fallback/default values for expected keys in your workflow logic. If the error persists, check the plugin daemon logs for more details, as the root cause may be in the plugin or Gemini API response, not Dify core itself. There are ongoing requests for maintainers to add defensive key checks and retry mechanisms in future versions to make agent nodes more robust, especially for multi-tool workflows. For more context and troubleshooting, see [this issue](https://github.com/langgenius/dify-official-plugins/issues/1704). <!-- 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/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=other)</sup>&nbsp;&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-official-plugins/issues/1706)
Author
Owner

@Egoistsoul commented on GitHub (Sep 12, 2025):

The keyword "search" is relevant here only because the agent workflow expects certain keys (like "search") in the tool/plugin output—when these are missing, it triggers a PluginInvokeError 500. This isn't about the literal keyword, but about missing expected fields in the plugin/tool response. The root cause is that the agent node code doesn't defensively check for the existence of these keys before accessing them, so if Gemini or a search tool returns a response without the expected key, you get a KeyError and a 500 error. This is a known issue and is discussed in detail here.关键词"search"在这里的相关性仅是因为代理工作流期望工具/插件输出中包含某些键(如"search")—当这些键缺失时,会触发 PluginInvokeError 500。这并非关于字面上的关键词,而是关于插件/工具响应中缺失的预期字段。根本原因是代理节点代码在访问这些键之前没有进行防御性检查,因此如果 Gemini 或搜索工具返回的响应中不包含预期键,就会得到 KeyError 和 500 错误。这是一个已知问题,详细讨论请见此处。

Recent plugin updates have improved error handling and message formatting, but they can't fully prevent this if the upstream API or plugin returns incomplete data. Immediate workarounds are: add retry logic, verify your tool/plugin configuration, and use fallback/default values for expected keys in your workflow logic. If the error persists, check the plugin daemon logs for more details, as the root cause may be in the plugin or Gemini API response, not Dify core itself.最近的插件更新改进了错误处理和消息格式,但如果上游 API 或插件返回不完整数据,它们仍无法完全防止这个问题。立即的解决方法是:添加重试逻辑、验证您的工具/插件配置,并在工作流逻辑中为预期的键使用备用/默认值。如果错误仍然存在,请检查插件守护进程日志以获取更多详细信息,因为根本原因可能在于插件或 Gemini API 响应,而不是 Dify 核心本身。

There are ongoing requests for maintainers to add defensive key checks and retry mechanisms in future versions to make agent nodes more robust, especially for multi-tool workflows. For more context and troubleshooting, see this issue.目前有持续的要求,希望维护者在未来的版本中添加防御性密钥检查和重试机制,以使代理节点更加健壮,特别是对于多工具工作流程。有关更多背景信息和故障排除,请查看此问题。

To reply, just mention @dosu.回复时只需提及@dosu。

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

If the issue truly stems from the key "search," shouldn't it trigger an error message like "args":{},"error_type":"KeyError","message":"'search'"?
However, instead, I received "args":{},"error_type":"Exception","message":"invoke llm model failed: request failed with status code: 500 and respond with: {"message":"Internal Server Error","code":"unknown","status":500}\n".

@Egoistsoul commented on GitHub (Sep 12, 2025): > The keyword "search" is relevant here only because the agent workflow expects certain keys (like "search") in the tool/plugin output—when these are missing, it triggers a PluginInvokeError 500. This isn't about the literal keyword, but about missing expected fields in the plugin/tool response. The root cause is that the agent node code doesn't defensively check for the existence of these keys before accessing them, so if Gemini or a search tool returns a response without the expected key, you get a KeyError and a 500 error. This is a known issue and is discussed in detail [here](https://github.com/langgenius/dify-official-plugins/issues/1704).关键词"search"在这里的相关性仅是因为代理工作流期望工具/插件输出中包含某些键(如"search")—当这些键缺失时,会触发 PluginInvokeError 500。这并非关于字面上的关键词,而是关于插件/工具响应中缺失的预期字段。根本原因是代理节点代码在访问这些键之前没有进行防御性检查,因此如果 Gemini 或搜索工具返回的响应中不包含预期键,就会得到 KeyError 和 500 错误。这是一个已知问题,详细讨论请见此处。 > > Recent plugin updates have improved error handling and message formatting, but they can't fully prevent this if the upstream API or plugin returns incomplete data. Immediate workarounds are: add retry logic, verify your tool/plugin configuration, and use fallback/default values for expected keys in your workflow logic. If the error persists, check the plugin daemon logs for more details, as the root cause may be in the plugin or Gemini API response, not Dify core itself.最近的插件更新改进了错误处理和消息格式,但如果上游 API 或插件返回不完整数据,它们仍无法完全防止这个问题。立即的解决方法是:添加重试逻辑、验证您的工具/插件配置,并在工作流逻辑中为预期的键使用备用/默认值。如果错误仍然存在,请检查插件守护进程日志以获取更多详细信息,因为根本原因可能在于插件或 Gemini API 响应,而不是 Dify 核心本身。 > > There are ongoing requests for maintainers to add defensive key checks and retry mechanisms in future versions to make agent nodes more robust, especially for multi-tool workflows. For more context and troubleshooting, see [this issue](https://github.com/langgenius/dify-official-plugins/issues/1704).目前有持续的要求,希望维护者在未来的版本中添加防御性密钥检查和重试机制,以使代理节点更加健壮,特别是对于多工具工作流程。有关更多背景信息和故障排除,请查看此问题。 > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot).回复时只需提及@dosu。_ > > How did I do? [Good](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4e98420f-c033-4bd0-9f2e-d986164b6e8b?feedback_type=other)  [<img alt="Join Discord" width="49" height="20" src="https://camo.githubusercontent.com/d562c2df5e4567ea41d37f1d91a4da0839d8341037045b103b2da268998de17f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d">](https://go.dosu.dev/discord-bot) [<img alt="Share on X" width="58" height="20" src="https://camo.githubusercontent.com/4649f705e2396d6f328dbc8e800a0509c9c17b3b20253b36706c393df124b93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b">](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1706) If the issue truly stems from the key "search," shouldn't it trigger an error message like `"args":{},"error_type":"KeyError","message":"'search'"`? However, instead, I received `"args":{},"error_type":"Exception","message":"invoke llm model failed: request failed with status code: 500 and respond with: {"message":"Internal Server Error","code":"unknown","status":500}\n"`.
Author
Owner

@dosubot[bot] commented on GitHub (Sep 28, 2025):

Hi, @Egoistsoul. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a PluginInvokeError 500 Internal Server Error when using Gemini 2.5 Pro in an agent node on Dify 1.8.1.
  • The error is caused by missing expected keys (like "search") in plugin/tool responses during workflow loops.
  • The underlying problem is a lack of defensive key checks in the agent node code, leading to KeyErrors.
  • You noted the error message shows a generic 500 error instead of a more specific KeyError for the missing key.
  • There have been requests for improved error handling and robustness in future versions, but no resolution yet.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of dify-official-plugins by commenting here.
  • If no further activity occurs, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Sep 28, 2025): Hi, @Egoistsoul. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a PluginInvokeError 500 Internal Server Error when using Gemini 2.5 Pro in an agent node on Dify 1.8.1. - The error is caused by missing expected keys (like "search") in plugin/tool responses during workflow loops. - The underlying problem is a lack of defensive key checks in the agent node code, leading to KeyErrors. - You noted the error message shows a generic 500 error instead of a more specific KeyError for the missing key. - There have been requests for improved error handling and robustness in future versions, but no resolution yet. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of dify-official-plugins by commenting here. - If no further activity occurs, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Author
Owner

@Egoistsoul commented on GitHub (Oct 19, 2025):

Hi, @Egoistsoul. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a PluginInvokeError 500 Internal Server Error when using Gemini 2.5 Pro in an agent node on Dify 1.8.1.
  • The error is caused by missing expected keys (like "search") in plugin/tool responses during workflow loops.
  • The underlying problem is a lack of defensive key checks in the agent node code, leading to KeyErrors.
  • You noted the error message shows a generic 500 error instead of a more specific KeyError for the missing key.
  • There have been requests for improved error handling and robustness in future versions, but no resolution yet.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of dify-official-plugins by commenting here.
  • If no further activity occurs, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

I already update to the latest plugins and these error still occurs:

The error with Openrouter
Failed to transform agent message: req_id: 770e5d7dd5 PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: read tcp 172.30.0.7:33078-\u003e172.30.0.8:5001: use of closed network connection\nfailed to read system header"}

The error with providers Openrouter、OpenAI、 Gemini
Failed to transform agent message: req_id: 38749c1462 PluginInvokeError: {"args":{},"error_type":"Exception","message":"invoke llm model failed: request failed with status code: 500 and respond with: {"message":"Internal Server Error","code":"unknown","status":500}\n"}

@Egoistsoul commented on GitHub (Oct 19, 2025): > Hi, [@Egoistsoul](https://github.com/Egoistsoul). I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. > > **Issue Summary:** > > * You reported a PluginInvokeError 500 Internal Server Error when using Gemini 2.5 Pro in an agent node on Dify 1.8.1. > * The error is caused by missing expected keys (like "search") in plugin/tool responses during workflow loops. > * The underlying problem is a lack of defensive key checks in the agent node code, leading to KeyErrors. > * You noted the error message shows a generic 500 error instead of a more specific KeyError for the missing key. > * There have been requests for improved error handling and robustness in future versions, but no resolution yet. > > **Next Steps:** > > * Please confirm if this issue is still relevant with the latest version of dify-official-plugins by commenting here. > * If no further activity occurs, I will automatically close this issue in 5 days. > > Thank you for your understanding and contribution! I already update to the latest plugins and these error still occurs: The error with Openrouter Failed to transform agent message: req_id: 770e5d7dd5 PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: read tcp 172.30.0.7:33078-\u003e172.30.0.8:5001: use of closed network connection\nfailed to read system header"} The error with providers Openrouter、OpenAI、 Gemini Failed to transform agent message: req_id: 38749c1462 PluginInvokeError: {"args":{},"error_type":"Exception","message":"invoke llm model failed: request failed with status code: 500 and respond with: {\"message\":\"Internal Server Error\",\"code\":\"unknown\",\"status\":500}\n"}
Author
Owner

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

@crazywoola The user reports that after updating to the latest plugins, they still encounter PluginInvokeError 500 Internal Server Errors with Openrouter, OpenAI, and Gemini providers, indicating the issue remains unresolved and needs attention. Could you please assist?

@dosubot[bot] commented on GitHub (Oct 19, 2025): @crazywoola The user reports that after updating to the latest plugins, they still encounter PluginInvokeError 500 Internal Server Errors with Openrouter, OpenAI, and Gemini providers, indicating the issue remains unresolved and needs attention. Could you please assist?
Author
Owner

@fengwk commented on GitHub (Oct 22, 2025):

Image

I have a similar problem?

@fengwk commented on GitHub (Oct 22, 2025): <img width="1269" height="1019" alt="Image" src="https://github.com/user-attachments/assets/9f05b94a-b03a-43ca-8215-d4091bb39d2b" /> I have a similar problem?
Author
Owner

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

Hi, @Egoistsoul. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a persistent PluginInvokeError 500 Internal Server Error with Gemini 2.5 Pro on Dify 1.8.1.
  • The error is caused by missing expected keys (like "search") in plugin/tool responses, leading to workflow failures.
  • This is a known issue due to lack of defensive key checks in the agent node code.
  • Similar errors occur with Openrouter and OpenAI providers, indicating a broader problem with multiple LLM integrations.
  • No fix has been implemented yet, though requests for improved error handling and retry mechanisms are ongoing.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of dify-official-plugins by commenting here to keep the discussion open.
  • Otherwise, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Nov 7, 2025): Hi, @Egoistsoul. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a persistent PluginInvokeError 500 Internal Server Error with Gemini 2.5 Pro on Dify 1.8.1. - The error is caused by missing expected keys (like "search") in plugin/tool responses, leading to workflow failures. - This is a known issue due to lack of defensive key checks in the agent node code. - Similar errors occur with Openrouter and OpenAI providers, indicating a broader problem with multiple LLM integrations. - No fix has been implemented yet, though requests for improved error handling and retry mechanisms are ongoing. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of dify-official-plugins by commenting here to keep the discussion open. - Otherwise, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#644