mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Occasional ChunkedEncodingError: Response ended prematurely when calling Nano Banana Pro (OpenAI-compatible) #843
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wbext on GitHub (Dec 1, 2025).
Self Checks
Dify version
1.9.1
Plugin version
0.0.24
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I'm using this plugin to call the Nano Banana Pro model, which is compatible with the OpenAI Chat format. However, an error occasionally occurs:[openai_api_compatible] Error: req_id: 4c7139a7a3 PluginInvokeError: {"args":{},"error_type":"ChunkedEncodingError","message":"Response ended prematurely"}
This error is not 100% reproducible and has no fixed trigger conditions, so I'm unsure of its root cause. When this error occurs, the Nano Banana Pro model's invocation logs show no record of the model being called. Therefore, the issue should originate from the requester side.
✔️ Error log
@dosubot[bot] commented on GitHub (Dec 1, 2025):
This error is a known intermittent issue in self-hosted Docker setups with OpenAI-compatible plugins. It happens when the HTTP streaming response is interrupted—often due to network hiccups, proxy buffering, or timeout settings—before the model is actually invoked, which is why you see no logs on the Nano Banana Pro side. The error is raised inside the HTTP client (openai/httpx) and surfaces as a PluginInvokeError when the stream ends prematurely (details, details).
Troubleshooting steps:
.envanddocker-compose.yaml:GUNICORN_TIMEOUT,NGINX_PROXY_READ_TIMEOUT,NGINX_PROXY_SEND_TIMEOUT,PLUGIN_MAX_EXECUTION_TIMEOUT, andDIFY_BACKWARDS_INVOCATION_READ_TIMEOUTto higher values (e.g., 600s or more). Restart your Docker stack after changes (reference).docker/nginx/proxy.conf.template), ensure you have:--timeout-keep-alive 120or higher.LOG_LEVEL=DEBUGand (optionally)LOG_FILEin your.envto capture detailed logs. Logs are usually at/app/logs/server.loginside the container (reference).curl --no-bufferor browser dev tools to check if chunks are arriving or if responses are buffered."stream": falsein the plugin code can avoid this error, but this requires a code change since it's not exposed in the UI (reference).Most often, the root cause is proxy buffering or a timeout closing the stream before the model is called. Adjusting these settings usually resolves the issue. If you need step-by-step help with any config, let me know!
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other