Agent - PluginDaemonInternalServerError: killed by timeout #20070

Closed
opened 2026-02-21 20:05:43 -05:00 by yindo · 3 comments
Owner

Originally created by @pr-maia on GitHub (Oct 31, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.9.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Can't really reproduce this as it happens out of nowhere.

✔️ Expected Behavior

The agent plugin should answer in a timely manner without being killed by timeout.

Actual Behavior

From the logs/UI it seems the agent ran for 10m and got killed by a timeout:

The first log indicates something like an token too long

**2025/10/31 19:08:51 stdio.go:179: [ERROR]plugin langgenius/agent:0.0.25 has an error on stdout: bufio.Scanner: token too long**
2025/10/31 19:08:51 run.go:135: [ERROR]plugin langgenius/agent:0.0.25 exited with error: signal: killed
2025/10/31 19:08:51 run.go:190: [INFO]plugin langgenius/agent:0.0.25 stopped
[GIN] 2025/10/31 - 19:08:51 | 200 |    3.307909ms |      172.20.0.8 | GET      "/plugin/65ceaef2-beb5-4237-8a6e-02223304d6bd/management/tools?page=1&page_size=256"
2025/10/31 19:08:56 run.go:147: [INFO]plugin langgenius/agent:0.0.25 started
2025/10/31 19:08:57 stdio.go:173: [INFO]plugin langgenius/agent:0.0.25: Installed agent: agent
2025/10/31 19:13:50 factory.go:28: [ERROR]PluginDaemonInternalServerError: killed by timeout
goroutine 71086 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:26 +0x5e
github.com/langgenius/dify-plugin-daemon/internal/types/exception.InternalServerError({0x299c120, 0xc00146ac70})
        /app/internal/types/exception/factory.go:27 +0x27
github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEService[...](0xc0020c1200, 0x267728c, 0x258?)
        /app/internal/service/base_sse.go:84 +0x4c6
github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEWithSession[...](0xc0020c1290, {0x267728c, 0xe}, {0x268829c, 0x15}, 0xc0016fe510, 0xc00294b300, 0x258)
        /app/internal/service/base_sse.go:114 +0x1c5
github.com/langgenius/dify-plugin-daemon/internal/service.InvokeAgentStrategy(0x100000048aaca?, 0x23d2cc0?, 0xc000c900e0?)
        /app/internal/service/invoke_agent.go:19 +0x52
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.InvokeAgentStrategy.func5.1({{{0xc00162e60d, 0x24}, {0xc000eb8150, 0x24}}, {{0x0, 0x0}}, {0xc00162e6c0, 0x58}, 0xc000c90240, 0x0, ...}) 
        /app/internal/server/controllers/agent_strategy.gen.go:20 +0x89
github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...].func1()
        /app/internal/server/controllers/base.go:53 +0x9b
github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindRequest[...](0xc00294b300, 0xc0020c14e8)
        /app/internal/server/controllers/base.go:31 +0x262
github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...](0x266faff?, 0xa?)
        /app/internal/server/controllers/base.go:37 +0x36
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.InvokeAgentStrategy.func5(0xc00294b300)
        /app/internal/server/controllers/agent_strategy.gen.go:17 +0x74
github.com/gin-gonic/gin.(*Context).Next(0xc00294b300)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).InitClusterID.func4(0xc00294b300)
        /app/internal/server/middleware.go:182 +0x54
github.com/gin-gonic/gin.(*Context).Next(0xc00294b300)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).RedirectPluginInvoke.func3(0xc00294b300)
        /app/internal/server/middleware.go:109 +0x74
github.com/gin-gonic/gin.(*Context).Next(0xc00294b300)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).FetchPluginInstallation.func2(0xc00294b300)
        /app/internal/server/middleware.go:78 +0x235
github.com/gin-gonic/gin.(*Context).Next(0xc00294b300)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.CollectActiveDispatchRequests.func1(0x266ddab?)
        /app/internal/server/controllers/health_check.go:28 +0x25
github.com/gin-gonic/gin.(*Context).Next(0xc00294b300)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginGroup.CheckingKey.func1(0xc00294b300)
        /app/internal/server/middleware.go:26 +0x95
github.com/gin-gonic/gin.(*Context).Next(0xc00294b300)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).server.CollectActiveRequests.func3(0x490013?)
        /app/internal/server/controllers/health_check.go:20 +0x25
github.com/gin-gonic/gin.(*Context).Next(...)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0xc00294b300)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 +0x6f
github.com/gin-gonic/gin.(*Context).Next(...)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.LoggerWithConfig.func1(0xc00294b300)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 +0xe5
github.com/gin-gonic/gin.(*Context).Next(...)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc000900340, 0xc00294b300)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 +0x892
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc000900340, {0x29cb6f0, 0xc0006da0e0}, 0xc0002c6a00)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 +0x1b2
net/http.serverHandler.ServeHTTP({0x29bdc48?}, {0x29cb6f0?, 0xc0006da0e0?}, 0x6?)
        /usr/local/go/src/net/http/server.go:3210 +0x8e
net/http.(*conn).serve(0xc0016fe000, {0x29cfff8, 0xc0007ff440})
        /usr/local/go/src/net/http/server.go:2092 +0x5d0
created by net/http.(*Server).Serve in goroutine 46
        /usr/local/go/src/net/http/server.go:3360 +0x485

[GIN] 2025/10/31 - 19:13:50 | 200 |         10m0s |      172.20.0.8 | POST     "/plugin/65ceaef2-beb5-4237-8a6e-02223304d6bd/dispatch/agent_strategy/invoke"
2025/10/31 19:18:51 factory.go:28: [ERROR]PluginDaemonInternalServerError: killed by timeout
goroutine 71181 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:26 +0x5e
github.com/langgenius/dify-plugin-daemon/internal/types/exception.InternalServerError({0x299c120, 0xc0008f6510})
        /app/internal/types/exception/factory.go:27 +0x27
github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEService[...](0xc000787200, 0x267728c, 0x258?)
        /app/internal/service/base_sse.go:84 +0x4c6
github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEWithSession[...](0xc000787290, {0x267728c, 0xe}, {0x268829c, 0x15}, 0xc00092e480, 0xc000207c00, 0x258)
        /app/internal/service/base_sse.go:114 +0x1c5
github.com/langgenius/dify-plugin-daemon/internal/service.InvokeAgentStrategy(0x100000048aaca?, 0x23d2cc0?, 0xc0006e6880?)
        /app/internal/service/invoke_agent.go:19 +0x52
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.InvokeAgentStrategy.func5.1({{{0xc0007a02ad, 0x24}, {0xc000eb8300, 0x24}}, {{0x0, 0x0}}, {0xc0007a0360, 0x58}, 0xc00146a070, 0x0, ...}) 
        /app/internal/server/controllers/agent_strategy.gen.go:20 +0x89
github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...].func1()
        /app/internal/server/controllers/base.go:53 +0x9b
github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindRequest[...](0xc000207c00, 0xc0007874e8)
        /app/internal/server/controllers/base.go:31 +0x262
github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...](0x266faff?, 0xa?)
        /app/internal/server/controllers/base.go:37 +0x36
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.InvokeAgentStrategy.func5(0xc000207c00)
        /app/internal/server/controllers/agent_strategy.gen.go:17 +0x74
github.com/gin-gonic/gin.(*Context).Next(0xc000207c00)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).InitClusterID.func4(0xc000207c00)
        /app/internal/server/middleware.go:182 +0x54
github.com/gin-gonic/gin.(*Context).Next(0xc000207c00)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).RedirectPluginInvoke.func3(0xc000207c00)
        /app/internal/server/middleware.go:109 +0x74
github.com/gin-gonic/gin.(*Context).Next(0xc000207c00)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).FetchPluginInstallation.func2(0xc000207c00)
        /app/internal/server/middleware.go:78 +0x235
github.com/gin-gonic/gin.(*Context).Next(0xc000207c00)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.CollectActiveDispatchRequests.func1(0x266ddab?)
        /app/internal/server/controllers/health_check.go:28 +0x25
github.com/gin-gonic/gin.(*Context).Next(0xc000207c00)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginGroup.CheckingKey.func1(0xc000207c00)
        /app/internal/server/middleware.go:26 +0x95
github.com/gin-gonic/gin.(*Context).Next(0xc000207c00)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).server.CollectActiveRequests.func3(0x0?)
        /app/internal/server/controllers/health_check.go:20 +0x25
github.com/gin-gonic/gin.(*Context).Next(...)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0xc000207c00)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 +0x6f
github.com/gin-gonic/gin.(*Context).Next(...)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.LoggerWithConfig.func1(0xc000207c00)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 +0xe5
github.com/gin-gonic/gin.(*Context).Next(...)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc000900340, 0xc000207c00)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 +0x892
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc000900340, {0x29cb6f0, 0xc0013a4620}, 0xc0022c5cc0)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 +0x1b2
net/http.serverHandler.ServeHTTP({0x29bdc48?}, {0x29cb6f0?, 0xc0013a4620?}, 0x6?)
        /usr/local/go/src/net/http/server.go:3210 +0x8e
net/http.(*conn).serve(0xc000aaa3f0, {0x29cfff8, 0xc0007ff440})
        /usr/local/go/src/net/http/server.go:2092 +0x5d0
created by net/http.(*Server).Serve in goroutine 46
        /usr/local/go/src/net/http/server.go:3360 +0x485
Originally created by @pr-maia on GitHub (Oct 31, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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 [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.9.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Can't really reproduce this as it happens out of nowhere. ### ✔️ Expected Behavior The agent plugin should answer in a timely manner without being killed by timeout. ### ❌ Actual Behavior From the logs/UI it seems the agent ran for 10m and got killed by a timeout: The first log indicates something like an token too long ``` **2025/10/31 19:08:51 stdio.go:179: [ERROR]plugin langgenius/agent:0.0.25 has an error on stdout: bufio.Scanner: token too long** 2025/10/31 19:08:51 run.go:135: [ERROR]plugin langgenius/agent:0.0.25 exited with error: signal: killed 2025/10/31 19:08:51 run.go:190: [INFO]plugin langgenius/agent:0.0.25 stopped [GIN] 2025/10/31 - 19:08:51 | 200 | 3.307909ms | 172.20.0.8 | GET "/plugin/65ceaef2-beb5-4237-8a6e-02223304d6bd/management/tools?page=1&page_size=256" 2025/10/31 19:08:56 run.go:147: [INFO]plugin langgenius/agent:0.0.25 started 2025/10/31 19:08:57 stdio.go:173: [INFO]plugin langgenius/agent:0.0.25: Installed agent: agent 2025/10/31 19:13:50 factory.go:28: [ERROR]PluginDaemonInternalServerError: killed by timeout goroutine 71086 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:26 +0x5e github.com/langgenius/dify-plugin-daemon/internal/types/exception.InternalServerError({0x299c120, 0xc00146ac70}) /app/internal/types/exception/factory.go:27 +0x27 github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEService[...](0xc0020c1200, 0x267728c, 0x258?) /app/internal/service/base_sse.go:84 +0x4c6 github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEWithSession[...](0xc0020c1290, {0x267728c, 0xe}, {0x268829c, 0x15}, 0xc0016fe510, 0xc00294b300, 0x258) /app/internal/service/base_sse.go:114 +0x1c5 github.com/langgenius/dify-plugin-daemon/internal/service.InvokeAgentStrategy(0x100000048aaca?, 0x23d2cc0?, 0xc000c900e0?) /app/internal/service/invoke_agent.go:19 +0x52 github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.InvokeAgentStrategy.func5.1({{{0xc00162e60d, 0x24}, {0xc000eb8150, 0x24}}, {{0x0, 0x0}}, {0xc00162e6c0, 0x58}, 0xc000c90240, 0x0, ...}) /app/internal/server/controllers/agent_strategy.gen.go:20 +0x89 github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...].func1() /app/internal/server/controllers/base.go:53 +0x9b github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindRequest[...](0xc00294b300, 0xc0020c14e8) /app/internal/server/controllers/base.go:31 +0x262 github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...](0x266faff?, 0xa?) /app/internal/server/controllers/base.go:37 +0x36 github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.InvokeAgentStrategy.func5(0xc00294b300) /app/internal/server/controllers/agent_strategy.gen.go:17 +0x74 github.com/gin-gonic/gin.(*Context).Next(0xc00294b300) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).InitClusterID.func4(0xc00294b300) /app/internal/server/middleware.go:182 +0x54 github.com/gin-gonic/gin.(*Context).Next(0xc00294b300) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).RedirectPluginInvoke.func3(0xc00294b300) /app/internal/server/middleware.go:109 +0x74 github.com/gin-gonic/gin.(*Context).Next(0xc00294b300) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).FetchPluginInstallation.func2(0xc00294b300) /app/internal/server/middleware.go:78 +0x235 github.com/gin-gonic/gin.(*Context).Next(0xc00294b300) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.CollectActiveDispatchRequests.func1(0x266ddab?) /app/internal/server/controllers/health_check.go:28 +0x25 github.com/gin-gonic/gin.(*Context).Next(0xc00294b300) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginGroup.CheckingKey.func1(0xc00294b300) /app/internal/server/middleware.go:26 +0x95 github.com/gin-gonic/gin.(*Context).Next(0xc00294b300) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).server.CollectActiveRequests.func3(0x490013?) /app/internal/server/controllers/health_check.go:20 +0x25 github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0xc00294b300) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 +0x6f github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.LoggerWithConfig.func1(0xc00294b300) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 +0xe5 github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc000900340, 0xc00294b300) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 +0x892 github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc000900340, {0x29cb6f0, 0xc0006da0e0}, 0xc0002c6a00) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 +0x1b2 net/http.serverHandler.ServeHTTP({0x29bdc48?}, {0x29cb6f0?, 0xc0006da0e0?}, 0x6?) /usr/local/go/src/net/http/server.go:3210 +0x8e net/http.(*conn).serve(0xc0016fe000, {0x29cfff8, 0xc0007ff440}) /usr/local/go/src/net/http/server.go:2092 +0x5d0 created by net/http.(*Server).Serve in goroutine 46 /usr/local/go/src/net/http/server.go:3360 +0x485 [GIN] 2025/10/31 - 19:13:50 | 200 | 10m0s | 172.20.0.8 | POST "/plugin/65ceaef2-beb5-4237-8a6e-02223304d6bd/dispatch/agent_strategy/invoke" 2025/10/31 19:18:51 factory.go:28: [ERROR]PluginDaemonInternalServerError: killed by timeout goroutine 71181 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:26 +0x5e github.com/langgenius/dify-plugin-daemon/internal/types/exception.InternalServerError({0x299c120, 0xc0008f6510}) /app/internal/types/exception/factory.go:27 +0x27 github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEService[...](0xc000787200, 0x267728c, 0x258?) /app/internal/service/base_sse.go:84 +0x4c6 github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEWithSession[...](0xc000787290, {0x267728c, 0xe}, {0x268829c, 0x15}, 0xc00092e480, 0xc000207c00, 0x258) /app/internal/service/base_sse.go:114 +0x1c5 github.com/langgenius/dify-plugin-daemon/internal/service.InvokeAgentStrategy(0x100000048aaca?, 0x23d2cc0?, 0xc0006e6880?) /app/internal/service/invoke_agent.go:19 +0x52 github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.InvokeAgentStrategy.func5.1({{{0xc0007a02ad, 0x24}, {0xc000eb8300, 0x24}}, {{0x0, 0x0}}, {0xc0007a0360, 0x58}, 0xc00146a070, 0x0, ...}) /app/internal/server/controllers/agent_strategy.gen.go:20 +0x89 github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...].func1() /app/internal/server/controllers/base.go:53 +0x9b github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindRequest[...](0xc000207c00, 0xc0007874e8) /app/internal/server/controllers/base.go:31 +0x262 github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...](0x266faff?, 0xa?) /app/internal/server/controllers/base.go:37 +0x36 github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.InvokeAgentStrategy.func5(0xc000207c00) /app/internal/server/controllers/agent_strategy.gen.go:17 +0x74 github.com/gin-gonic/gin.(*Context).Next(0xc000207c00) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).InitClusterID.func4(0xc000207c00) /app/internal/server/middleware.go:182 +0x54 github.com/gin-gonic/gin.(*Context).Next(0xc000207c00) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).RedirectPluginInvoke.func3(0xc000207c00) /app/internal/server/middleware.go:109 +0x74 github.com/gin-gonic/gin.(*Context).Next(0xc000207c00) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).FetchPluginInstallation.func2(0xc000207c00) /app/internal/server/middleware.go:78 +0x235 github.com/gin-gonic/gin.(*Context).Next(0xc000207c00) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.CollectActiveDispatchRequests.func1(0x266ddab?) /app/internal/server/controllers/health_check.go:28 +0x25 github.com/gin-gonic/gin.(*Context).Next(0xc000207c00) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginGroup.CheckingKey.func1(0xc000207c00) /app/internal/server/middleware.go:26 +0x95 github.com/gin-gonic/gin.(*Context).Next(0xc000207c00) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).server.CollectActiveRequests.func3(0x0?) /app/internal/server/controllers/health_check.go:20 +0x25 github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0xc000207c00) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 +0x6f github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.LoggerWithConfig.func1(0xc000207c00) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 +0xe5 github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc000900340, 0xc000207c00) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 +0x892 github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc000900340, {0x29cb6f0, 0xc0013a4620}, 0xc0022c5cc0) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 +0x1b2 net/http.serverHandler.ServeHTTP({0x29bdc48?}, {0x29cb6f0?, 0xc0013a4620?}, 0x6?) /usr/local/go/src/net/http/server.go:3210 +0x8e net/http.(*conn).serve(0xc000aaa3f0, {0x29cfff8, 0xc0007ff440}) /usr/local/go/src/net/http/server.go:2092 +0x5d0 created by net/http.(*Server).Serve in goroutine 46 /usr/local/go/src/net/http/server.go:3360 +0x485 ```
yindo added the 🐞 bug label 2026-02-21 20:05:43 -05:00
yindo closed this issue 2026-02-21 20:05:43 -05:00
Author
Owner

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

This error is caused by two things: the agent plugin process is killed after hitting a hard 10-minute timeout, and before that, it encounters a bufio.Scanner: token too long error. The scanner error means the plugin tried to read a line or token larger than Go's default buffer size (64KB), which is not configurable unless you patch the plugin daemon code itself. When this happens, the plugin may hang or fail to respond, leading to the timeout and forced termination by the daemon.

Timeouts for plugin execution are enforced at the plugin daemon level and can be adjusted via environment variables (like PLUGIN_DAEMON_TIMEOUT or similar) in your Docker or service configuration. Recent updates have made this configurable, so you can lower or raise the timeout as needed for your deployment details.

For the scanner error, workarounds from other users include reducing the size of data sent to the plugin (for example, smaller images or payloads), changing how data is sent (such as using URLs instead of base64 for images), or switching model providers if possible. If you need to handle very large outputs, you would need to modify the Go code in the plugin daemon to increase the buffer size or use a different reader reference.

If you’re seeing this with large payloads, try reducing their size or changing the workflow to avoid sending oversized data. For timeouts, check your environment variables and Docker Compose settings to adjust the plugin daemon timeout as needed reference.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Oct 31, 2025): <!-- Answer --> This error is caused by two things: the agent plugin process is killed after hitting a hard 10-minute timeout, and before that, it encounters a `bufio.Scanner: token too long` error. The scanner error means the plugin tried to read a line or token larger than Go's default buffer size (64KB), which is not configurable unless you patch the plugin daemon code itself. When this happens, the plugin may hang or fail to respond, leading to the timeout and forced termination by the daemon. Timeouts for plugin execution are enforced at the plugin daemon level and can be adjusted via environment variables (like `PLUGIN_DAEMON_TIMEOUT` or similar) in your Docker or service configuration. Recent updates have made this configurable, so you can lower or raise the timeout as needed for your deployment [details](https://github.com/langgenius/dify/pull/26852). For the scanner error, workarounds from other users include reducing the size of data sent to the plugin (for example, smaller images or payloads), changing how data is sent (such as using URLs instead of base64 for images), or switching model providers if possible. If you need to handle very large outputs, you would need to modify the Go code in the plugin daemon to increase the buffer size or use a different reader [reference](https://github.com/langgenius/dify-official-plugins/issues/1226). If you’re seeing this with large payloads, try reducing their size or changing the workflow to avoid sending oversized data. For timeouts, check your environment variables and Docker Compose settings to adjust the plugin daemon timeout as needed [reference](https://github.com/langgenius/dify/pull/26685). <!-- 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/497c4dbf-8919-4a4f-95d4-4d673ab8cbb6?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/497c4dbf-8919-4a4f-95d4-4d673ab8cbb6?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/497c4dbf-8919-4a4f-95d4-4d673ab8cbb6?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/497c4dbf-8919-4a4f-95d4-4d673ab8cbb6?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/497c4dbf-8919-4a4f-95d4-4d673ab8cbb6?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/497c4dbf-8919-4a4f-95d4-4d673ab8cbb6?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/497c4dbf-8919-4a4f-95d4-4d673ab8cbb6?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&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/issues/27714)
Author
Owner

@pr-maia commented on GitHub (Oct 31, 2025):

That's strange, 64kb of text is not much. This not only shouldn't happen but also shouldn't take 10 min to fail.

@pr-maia commented on GitHub (Oct 31, 2025): That's strange, 64kb of text is not much. This not only shouldn't happen but also shouldn't take 10 min to fail.
Author
Owner

@pr-maia commented on GitHub (Nov 3, 2025):

@crazywoola Why was this closed as not planned when this bug is also affecting other users?

@pr-maia commented on GitHub (Nov 3, 2025): @crazywoola Why was this closed as not planned when this bug is also affecting other users?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20070