[openrouter] Error: req_id: 051b3113e5 PluginInvokeError: {"args":{},"error_type":"ChunkedEncodingError","message":"Response ended prematurely"} #579

Closed
opened 2026-02-16 10:19:48 -05:00 by yindo · 1 comment
Owner

Originally created by @Vampxgg on GitHub (Aug 22, 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.7.2

Plugin version

openrouter 0.0.17

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

[openrouter] Error: req_id: 051b3113e5 PluginInvokeError: {"args":{},"error_type":"ChunkedEncodingError","message":"Response ended prematurely"}

Image

✔️ Error log

No response

Originally created by @Vampxgg on GitHub (Aug 22, 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.7.2 ### Plugin version openrouter 0.0.17 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce [openrouter] Error: req_id: 051b3113e5 PluginInvokeError: {"args":{},"error_type":"ChunkedEncodingError","message":"Response ended prematurely"} <img width="827" height="508" alt="Image" src="https://github.com/user-attachments/assets/89c23710-c074-4b13-9d39-ad3091edf428" /> ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:19:48 -05:00
yindo closed this issue 2026-02-16 10:19:48 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 22, 2025):

This error is likely caused by an HTTP streaming issue—where the OpenRouter API response ends before all data is received. This can happen due to network instability, server-side timeouts, or resource constraints in Docker. The OpenRouter plugin itself delegates HTTP response handling to its dependencies and does not directly manage chunked encoding errors, so the root cause is often upstream or environmental1 .

Known issues with OpenRouter plugin versions (0.0.10+) include broken tool invocation and API compatibility problems, especially if deprecated parameters like functions or function_call are used instead of the updated tools and tool_choice fields required by OpenRouter's API2 3 . Make sure your requests follow the latest OpenRouter API documentation.

For Docker setups, plugin communication errors can sometimes be resolved by using host.docker.internal instead of localhost for service endpoints, and ensuring services listen on 0.0.0.04 . Also, check your Docker resource limits and network stability.

If the error persists, try testing with another plugin (like Gemini) to see if the issue is specific to OpenRouter. Some users have found that downgrading the OpenRouter plugin to version 0.0.8 temporarily resolves invocation issues3 5 .

Recent updates in Dify improved error reporting for plugin invocation errors, so you should see more informative error messages in your logs6 . There is ongoing work to improve chunked response handling and file size limits, but these changes are not yet released7 .

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 (Aug 22, 2025): <!-- Answer --> This error is likely caused by an HTTP streaming issue—where the OpenRouter API response ends before all data is received. This can happen due to network instability, server-side timeouts, or resource constraints in Docker. The OpenRouter plugin itself delegates HTTP response handling to its dependencies and does not directly manage chunked encoding errors, so the root cause is often upstream or environmental[^plugin_impl]. Known issues with OpenRouter plugin versions (0.0.10+) include broken tool invocation and API compatibility problems, especially if deprecated parameters like `functions` or `function_call` are used instead of the updated `tools` and `tool_choice` fields required by OpenRouter's API[^api_params][^tool_broken]. Make sure your requests follow the latest OpenRouter API documentation. For Docker setups, plugin communication errors can sometimes be resolved by using `host.docker.internal` instead of `localhost` for service endpoints, and ensuring services listen on `0.0.0.0`[^docker_network]. Also, check your Docker resource limits and network stability. If the error persists, try testing with another plugin (like Gemini) to see if the issue is specific to OpenRouter. Some users have found that downgrading the OpenRouter plugin to version 0.0.8 temporarily resolves invocation issues[^tool_broken][^tool_workaround]. Recent updates in Dify improved error reporting for plugin invocation errors, so you should see more informative error messages in your logs[^error_handling]. There is ongoing work to improve chunked response handling and file size limits, but these changes are not yet released[^chunk_pr]. [^plugin_impl]: https://github.com/langgenius/dify-official-plugins/blob/b120688c39bfddf8f68274c4698b7c0d52d9cf3e/models/openrouter/models/llm/llm.py [^api_params]: https://github.com/langgenius/dify-official-plugins/issues/971 [^tool_broken]: https://github.com/langgenius/dify-official-plugins/issues/1088 [^tool_workaround]: https://github.com/langgenius/dify/issues/21847 [^docker_network]: https://github.com/langgenius/dify-official-plugins/issues/918 [^error_handling]: https://github.com/langgenius/dify/pull/22908 [^chunk_pr]: https://github.com/langgenius/dify/pull/23692 <!-- 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/d4d50fd6-ac49-46d7-ab58-6f14e00df1c5?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d4d50fd6-ac49-46d7-ab58-6f14e00df1c5?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d4d50fd6-ac49-46d7-ab58-6f14e00df1c5?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d4d50fd6-ac49-46d7-ab58-6f14e00df1c5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d4d50fd6-ac49-46d7-ab58-6f14e00df1c5?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d4d50fd6-ac49-46d7-ab58-6f14e00df1c5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d4d50fd6-ac49-46d7-ab58-6f14e00df1c5?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/1552)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#579