PluginDaemonInternalServerError
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
Inizia riproducendo POST /plugin/<tenant_id>/dispatch/agent_strategy/invoke con il timeout di 120 secondi riportato, quindi leggi internal/service/base_sse.go e internal/service/invoke_agent.go insieme allo stack trace. Traccia la risposta finale e il ciclo di vita della sessione; il lavoro è completato quando la richiesta si chiude normalmente dopo la risposta finale invece di terminare con "killed by timeout".
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.14.2
Plugin version
0.0.39 (Dify Agent Strategies)
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
## PluginDaemonInternalServerError: killed by timeout on agent_strategy/invoke despite successful LLM/tool execution
### Problem
I intermittently get the following error from `dify-plugin-daemon` when invoking an Agent Strategy:
```text
req_id: 9095f1ca5e
PluginDaemonInternalServerError: killed by timeout
The timeout occurs after approximately 120 seconds, which matches the current plugin timeout configuration:
PLUGIN_DAEMON_TIMEOUT=120.0
PLUGIN_MAX_EXECUTION_TIMEOUT=120
The problematic endpoint is:
POST /plugin/<tenant_id>/dispatch/agent_strategy/invoke
Relevant plugin_daemon log
2026-06-10T11:40:11.849682907Z ERROR dify-plugin-daemon factory.go:28 PluginDaemonInternalServerError error="killed by timeout"
github.com/langgenius/dify-plugin-daemon/internal/types/exception.InternalServerError
/app/internal/types/exception/factory.go:28
github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEService[...]
/app/internal/service/base_sse.go:103
github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEWithSession[...]
/app/internal/service/base_sse.go:142
github.com/langgenius/dify-plugin-daemon/internal/service.InvokeAgentStrategy
/app/internal/service/invoke_agent.go:19
2026-06-10T11:40:11.850575176Z INFO dify-plugin-daemon middleware.go:83
trace_id=ceb3a5a74a815f077aed88eafbb509dd
tenant_id=<redacted>
HTTP request status=200 latency_ms=120004
client_ip=172.22.0.12
method=POST
path=/plugin/<tenant_id>/dispatch/agent_strategy/invoke
Important observation
The lower-level LLM and tool calls seem to complete successfully before the global agent_strategy/invoke request times out.
From the API container logs, around the same period:
[on_llm_after_invoke]
Model: gpt-4o-mini-2024-07-18
Usage: prompt_tokens=6902 completion_tokens=79 total_tokens=6981
latency=1.9661424160003662
Then the tool call is executed successfully:
[on_tool_start] ToolCall:post_query_v1_query_post
{'query': 'PREFIX bot: <https://w3id.org/bot#>
SELECT DISTINCT (COUNT(?space) AS ?count)
WHERE {
GRAPH <http://zaventem/graph/iot/> {
?space a bot:Space .
}
}'}
Tool response:
{
"head": {
"vars": ["count"]
},
"results": {
"bindings": [
{
"count": {
"datatype": "http://www.w3.org/2001/XMLSchema#integer",
"type": "literal",
"value": "63"
}
}
]
}
}
Tool invocation completed successfully:
2026-06-10 12:34:35.506 INFO [MainThread] [handler.py:242]
881dbde8c62a5955bb4a9c7faaebd59b
"POST /inner/api/invoke/tool HTTP/1.1" 200 717 0.082712
A second LLM call then also completed successfully:
[on_llm_after_invoke]
Content: "Le nombre total de pièces est de **63**."
Model: gpt-4o-mini-2024-07-18
Usage: prompt_tokens=7086 completion_tokens=13 total_tokens=7099
latency=1.079631193075329
API response:
2026-06-10 12:34:36.858 INFO [MainThread] [handler.py:242]
01a7da653a5e578c9ff6e7521472b66e
"POST /inner/api/invoke/llm HTTP/1.1" 200 3931 1.301323
Additional diagnostics
I inspected plugin processes inside the plugin_daemon container.
The agent plugin process looked idle and healthy:
PID 1104
/app/storage/cwd/langgenius/agent-0.0.39.../.venv/bin/python -m main
State: S (sleeping)
Threads: 2
WCHAN: ep_poll
CPU: 0.0%
TCP: no direct connection
FD:
0 -> pipe
1 -> pipe
2 -> pipe
3 -> eventpoll
4 -> eventfd
The azure_openai plugin process was occasionally active via stdio/pipe, but no direct TCP connection was observed from that process:
PID 805
/app/storage/cwd/langgenius/azure_openai-0.0.56.../.venv/bin/python -m main
State: S (sleeping)
Threads: 2
WCHAN: ep_poll
FD:
0 -> pipe
1 -> pipe
2 -> pipe
5 -> socket
6 -> socket
During execution, some I/O activity was observed:
azure_openai:
rchar: 19966418 -> 20216326 -> 20251312
wchar: 392792 -> 423374 -> 424748
However, no TCP connection was visible from the plugin container during the monitored period.
What seems suspicious
The useful work appears to complete successfully:
- First LLM call succeeds.
- Tool call succeeds.
- Final LLM answer succeeds.
- The final answer is produced.
But the global request:
/dispatch/agent_strategy/invoke
still remains open until it is killed by the plugin daemon timeout after ~120 seconds.
This looks like the Agent Strategy SSE/session may not be finalized correctly after the final answer is produced.
### Questions
Could this be related to:
* Agent Strategy SSE stream not being closed correctly?
* `baseSSEService` / `baseSSEWithSession` waiting for a final event?
* Plugin daemon session lifecycle issue?
* A mismatch between successful `/inner/api/invoke/llm` completion and global `/dispatch/agent_strategy/invoke` completion?
Any guidance on additional logs or diagnostics to collect would be appreciated.
✔️ Expected Behavior
Once the agent has completed the final response, the agent_strategy/invoke SSE/session should close normally and the request should not remain pending until PLUGIN_DAEMON_TIMEOUT.
Actual behavior
The useful work completes, but the global plugin daemon request remains pending and is killed after 120 seconds:
PluginDaemonInternalServerError error="killed by timeout"
latency_ms=120004
❌ Actual Behavior
No response
✔️ Error log
No response
- Lingua principale
- Go
- Stelle
- 462
- Fork
- 326
- Merge medio
- 22h 15m
- PR unite (30g)
- 8
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di langgenius/dify-plugin-daemon
-
Agent strategy run cut by PLUGIN_MAX_EXECUTION_TIMEOUT is reported only as "Internal Server Error"Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
langgenius/dify-plugin-daemon#863 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
langgenius/dify-plugin-daemon#862 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(install): prevent mirror settings from changing dependency resolution inputsForse già presa @WH-2099 l’ha presa 5 giorni fa. Apertaproject#dify-plugin-daemon
langgenius/dify-plugin-daemon#860 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
READONLY error when using Redis 6.2.2 Sentinel cluster on Kubernetes with dify-plugin-daemon 0.6.10-localForse già presa @Souravrajvi0 l’ha presa 60 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
langgenius/dify-plugin-daemon#826 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
uninstall the plugin, but the plugin package is not removedForse già presa @fatelei l’ha presa 111 giorni fa. Apertabug plugin-daemon
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
langgenius/dify-plugin-daemon#797 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di langgenius/dify-plugin-daemon
Issue simili
-
test_archive_is_downloaded_after_logout_login doesn't wait for the storage client after loginAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
list_issues and search_issues: inconsistent `fields` allow-lists (`html_url` rejected by list)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
github/github-mcp-server#3960 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
JuliusBrussee/caveman#1594 ·
I maintainer di solito rispondono entro 1 giorno
-
C-bug O-community X-blathers-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
cockroachdb/cockroach#176264 · 1 commento ·