Failed to request plugin daemon (ConnectError) under concurrent browser load only — not reproducible via isolated requests — Dify 1.16.0 #39381
Replies: 1 comment 2 replies
|
Hi @fernanclok! I'm Dosu and I'm helping the Dify team. Your diagnosis is spot-on — this is a The core problem: Dify's plugin daemon client uses a synchronous Two compounding factors make this worse:
This explains exactly why your standalone test process (fresh Why increasing Possible workarounds to try:
This is a known architectural limitation — the plugin daemon client was designed with synchronous To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
Uh oh!
There was an error while loading. Please reload this page.
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
I upgraded a working self-hosted Dify install from 1.0.0 to 1.16.0 (full DB backup taken beforehand, official upgrade steps followed: git checkout 1.16.0, flask db upgrade ran successfully, Alembic head matches 7a1c2d9e4b60). Since then, the console shows a persistent toast:
"Failed to request plugin daemon, url: plugin/<tenant_id>/management/models"
Same error shape on management/tool, management/agent_strategies, and management/triggers — always the same tenant, and the underlying exception is always:
httpx.ConnectError: [Errno 111] Connection refused
raised from core/plugin/impl/base.py line 270 (_request_with_plugin_daemon_response)
It happens specifically on pages that fire a burst of 4-8 parallel XHR calls on load (e.g. Integrations -> Model Provider). The rest of the app (login, workflows, apps, knowledge base) works fine.
The most important thing I found: I could NOT reproduce this from a separate diagnostic process talking to the same running plugin_daemon container.
This points to something specific to the live gunicorn+gevent worker process handling real traffic (interaction between the persistent module-level pooled httpx.Client in core/plugin/impl/base.py — get_pooled_http_client("plugin_daemon", ...), max_keepalive_connections=50/max_connections=100 — and gevent's worker concurrency), not a general Docker networking/DNS/proxy issue.

2. Additional context or comments
Things I ruled out with evidence before posting:
Environment:
Related discussions with similar-looking error text but different confirmed root causes (proxy/VPN, crash-looping daemon from empty PLUGIN_S3_USE_AWS, SDK version mismatch) - none of which apply here:
#25822
#21330
#21396
#27666
Happy to provide more logs/traces or run further diagnostics.
All reactions