plugin panic error #191

Closed
opened 2026-02-16 00:20:26 -05:00 by yindo · 4 comments
Owner

Originally created by @NieRonghua on GitHub (Sep 25, 2025).

Self Checks

To make sure we get to you in time, please check the following :)

  • I have searched for existing issues search for existing issues, 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."

Versions

  1. dify-plugin-daemon Version
    0.2.0
  2. dify-api Version
    1.8.1

Describe the bug
a panci error

2025-09-25 13:50:05:runtime error: invalid memory address or nil pointer dereference  
2025-09-25 13:50:05:/nfsc/DPMJKS/install_files/go-1.23.7.linux-amd64/src/runtime/panic.go:262 (0x4771b8)  
2025-09-25 13:50:05:/nfsc/DPMJKS/install_files/go-1.23.7.linux-amd64/src/runtime/signal_unix.go:917 (0x477188)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/core/plugin_manager/local_runtime/stdio.go:85 (0xdbf052)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/core/plugin_manager/local_runtime/io.go:16 (0xdbc9ba)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/core/plugin_daemon/generic.go:27 (0xfdb4b6)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/core/plugin_daemon/model.gen.go:161 (0x1009f8b)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/service/model.gen.go:210 (0x1009f72)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/service/base_sse.go:116 (0x1014eda)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/service/base_sse.go:44 (0x101513e)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/service/base_sse.go:114 (0x1014e24)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/service/model.gen.go:208 (0x1009f31)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/model.gen.go:163 (0x1ec9028)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/base.go:53 (0x103effb)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/base.go:31 (0x103f461)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/base.go:37 (0x103ef15)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/model.gen.go:160 (0x1ec8f73)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/middleware.go:170 (0x1ecbab3)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/middleware.go:97 (0x1ecbb53)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/middleware.go:66 (0x1ecfe31)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/health_check.go:28 (0x1ecfb24)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/middleware.go:24 (0x1ecb234)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a)  
2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/health_check.go:20 (0x1ecfac4)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf973ee)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 (0xf973db)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf96524)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xf9650b)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf95911)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 (0xf95380)  
2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 (0xf94eb1)  
2025-09-25 13:50:05:/nfsc/DPMJKS/install_files/go-1.23.7.linux-amd64/src/net/http/server.go:3210 (0x7e24ed)  
2025-09-25 13:50:05:/nfsc/DPMJKS/install_files/go-1.23.7.linux-amd64/src/net/http/server.go:2092 (0x7c1a0f)  
2025-09-25 13:50:05:/nfsc/DPMJKS/install_files/go-1.23.7.linux-amd64/src/runtime/asm_amd64.s:1700 (0x47d3a0)  
2025-09-25 13:50:05:  
2025-09-25 13:50:07:  
2025-09-25 13:50:07:  
2025-09-25 13:50:07:2025/09/25 13:50:07 [Recovery] 2025/09/25 - 13:50:07 panic recovered:  

Expected behavior
Based on my understanding of the go code, I think it is because the plugin has not been started yet (maybe the plugin is abnormal), but dify-api has requested the plugin service to execute the plugin.

I don't know if what I think is right. I don't know where the problem is now. I hope to get a reply.

Originally created by @NieRonghua on GitHub (Sep 25, 2025). **Self Checks** To make sure we get to you in time, please check the following :) - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify-plugin-daemon/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." **Versions** 1. dify-plugin-daemon Version 0.2.0 2. dify-api Version 1.8.1 **Describe the bug** a panci error ``` 2025-09-25 13:50:05:runtime error: invalid memory address or nil pointer dereference 2025-09-25 13:50:05:/nfsc/DPMJKS/install_files/go-1.23.7.linux-amd64/src/runtime/panic.go:262 (0x4771b8) 2025-09-25 13:50:05:/nfsc/DPMJKS/install_files/go-1.23.7.linux-amd64/src/runtime/signal_unix.go:917 (0x477188) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/core/plugin_manager/local_runtime/stdio.go:85 (0xdbf052) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/core/plugin_manager/local_runtime/io.go:16 (0xdbc9ba) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/core/plugin_daemon/generic.go:27 (0xfdb4b6) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/core/plugin_daemon/model.gen.go:161 (0x1009f8b) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/service/model.gen.go:210 (0x1009f72) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/service/base_sse.go:116 (0x1014eda) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/service/base_sse.go:44 (0x101513e) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/service/base_sse.go:114 (0x1014e24) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/service/model.gen.go:208 (0x1009f31) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/model.gen.go:163 (0x1ec9028) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/base.go:53 (0x103effb) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/base.go:31 (0x103f461) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/base.go:37 (0x103ef15) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/model.gen.go:160 (0x1ec8f73) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/middleware.go:170 (0x1ecbab3) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/middleware.go:97 (0x1ecbb53) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/middleware.go:66 (0x1ecfe31) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/health_check.go:28 (0x1ecfb24) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/middleware.go:24 (0x1ecb234) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf8988a) 2025-09-25 13:50:05:/app/workspace/DEPLOY/inc-aiplat-core/inc-aiplat-core-dify-plugin-blue/internal/server/controllers/health_check.go:20 (0x1ecfac4) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf973ee) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 (0xf973db) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf96524) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xf9650b) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xf95911) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 (0xf95380) 2025-09-25 13:50:05:/app/MAVEN_REPOSITORY/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 (0xf94eb1) 2025-09-25 13:50:05:/nfsc/DPMJKS/install_files/go-1.23.7.linux-amd64/src/net/http/server.go:3210 (0x7e24ed) 2025-09-25 13:50:05:/nfsc/DPMJKS/install_files/go-1.23.7.linux-amd64/src/net/http/server.go:2092 (0x7c1a0f) 2025-09-25 13:50:05:/nfsc/DPMJKS/install_files/go-1.23.7.linux-amd64/src/runtime/asm_amd64.s:1700 (0x47d3a0) 2025-09-25 13:50:05: 2025-09-25 13:50:07: 2025-09-25 13:50:07: 2025-09-25 13:50:07:2025/09/25 13:50:07 [Recovery] 2025/09/25 - 13:50:07 panic recovered: ``` **Expected behavior** Based on my understanding of the go code, I think it is because the plugin has not been started yet (maybe the plugin is abnormal), but dify-api has requested the plugin service to execute the plugin. I don't know if what I think is right. I don't know where the problem is now. I hope to get a reply.
yindo closed this issue 2026-02-16 00:20:26 -05:00
Author
Owner

@NieRonghua commented on GitHub (Sep 25, 2025):

Please close this issue. This panic does not cause a service-level error. I have resolved the issue.

@NieRonghua commented on GitHub (Sep 25, 2025): Please close this issue. This panic does not cause a service-level error. I have resolved the issue.
Author
Owner

@kingfs commented on GitHub (Sep 28, 2025):

my local dify is use dify 1.8.1 and plugin daemon 0.3.1, also found this panic

@kingfs commented on GitHub (Sep 28, 2025): my local dify is use dify 1.8.1 and plugin daemon 0.3.1, also found this panic
Author
Owner

@QuantumGhost commented on GitHub (Sep 29, 2025):

I have encountered this issue too while trying to resolve this issue.

I make a tiny adjustment to the source code of plugin daemon to get a more comprehensive traceback.

The following traceback are from my debugging docker image. The log s: <nil> indicates that the receiver s of method setupStdioEventListener is nil. The traceback also confirms this. The first element in parameter list is 0x0, as the follow line shows:

plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).setupStdioEventListener(0x0, {0x40007dc2a0, 0x24}, 0x400145ad30)

I suspect this is a timing issue in connection setup and listening.

Full traceback:

plugin_daemon-1  | [GIN] 2025/09/28 - 16:52:13 | 200 |    3.142482ms |   192.168.107.1 | GET      "/plugin/b8100148-b808-472a-b265-41409558f5d7/management/tool?provider=md_exporter&plugin_id=bowenliang123%2Fmd_exporter"
plugin_daemon-1  | s: <nil>
plugin_daemon-1  |
plugin_daemon-1  |
plugin_daemon-1  | 2025/09/28 16:52:13 [Recovery] 2025/09/28 - 16:52:13 panic recovered:
plugin_daemon-1  | POST /plugin/b8100148-b808-472a-b265-41409558f5d7/dispatch/tool/invoke HTTP/1.1
plugin_daemon-1  | Host: 127.0.0.1:5002
plugin_daemon-1  | Accept: */*
plugin_daemon-1  | Accept-Encoding: gzip, deflate, br
plugin_daemon-1  | Connection: keep-alive
plugin_daemon-1  | Content-Length: 373
plugin_daemon-1  | Content-Type: application/json
plugin_daemon-1  | User-Agent: python-requests/2.32.5
plugin_daemon-1  | X-Api-Key: [REDACTED]
plugin_daemon-1  | X-Plugin-Id: bowenliang123/md_exporter
plugin_daemon-1  |
plugin_daemon-1  |
plugin_daemon-1  | runtime error: invalid memory address or nil pointer dereference
plugin_daemon-1  | /usr/local/go/src/runtime/panic.go:262 (0x8781f)
plugin_daemon-1  | /usr/local/go/src/runtime/signal_unix.go:917 (0x877ec)
plugin_daemon-1  | /app/internal/core/plugin_manager/local_runtime/stdio.go:86 (0x905f4c)
plugin_daemon-1  | /app/internal/core/plugin_manager/local_runtime/io.go:16 (0x903b97)
plugin_daemon-1  | /app/internal/core/plugin_daemon/generic.go:27 (0xb13f37)
plugin_daemon-1  | /app/internal/core/plugin_daemon/tool.gen.go:18 (0xb55aa7)
plugin_daemon-1  | /app/internal/service/tool.gen.go:23 (0xb55a8c)
plugin_daemon-1  | /app/internal/service/base_sse.go:116 (0xb58017)
plugin_daemon-1  | /app/internal/service/base_sse.go:44 (0xb58243)
plugin_daemon-1  | /app/internal/service/base_sse.go:114 (0xb57f6f)
plugin_daemon-1  | /app/internal/service/tool.gen.go:21 (0xb55a3b)
plugin_daemon-1  | /app/internal/server/controllers/tool.gen.go:20 (0x18c1ccf)
plugin_daemon-1  | /app/internal/server/controllers/base.go:53 (0xb83097)
plugin_daemon-1  | /app/internal/server/controllers/base.go:31 (0xb83477)
plugin_daemon-1  | /app/internal/server/controllers/base.go:37 (0xb82fcb)
plugin_daemon-1  | /app/internal/server/controllers/tool.gen.go:17 (0x18c1c1f)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f)
plugin_daemon-1  | /app/internal/server/middleware.go:182 (0x18c3377)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f)
plugin_daemon-1  | /app/internal/server/middleware.go:109 (0x18c3413)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f)
plugin_daemon-1  | /app/internal/server/middleware.go:78 (0x18c749b)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f)
plugin_daemon-1  | /app/internal/server/controllers/health_check.go:28 (0x18c725b)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f)
plugin_daemon-1  | /app/internal/server/middleware.go:26 (0x18c2d37)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f)
plugin_daemon-1  | /app/internal/server/controllers/health_check.go:20 (0x18c719b)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xaccc3b)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 (0xaccc1c)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xacc037)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xacc014)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xacb473)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 (0xacaffc)
plugin_daemon-1  | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 (0xacac23)
plugin_daemon-1  | /usr/local/go/src/net/http/server.go:3210 (0x39dfdb)
plugin_daemon-1  | /usr/local/go/src/net/http/server.go:2092 (0x37f27b)
plugin_daemon-1  | /usr/local/go/src/runtime/asm_arm64.s:1223 (0x8dae3)
plugin_daemon-1  |
plugin_daemon-1  | [GIN] 2025/09/28 - 16:52:13 | 200 |   30.150975ms |   192.168.107.1 | POST     "/plugin/b8100148-b808-472a-b265-41409558f5d7/dispatch/tool/invoke"
plugin_daemon-1  | goroutine 576 [running]:
plugin_daemon-1  | runtime/debug.Stack()
plugin_daemon-1  |      /usr/local/go/src/runtime/debug/stack.go:26 +0x64
plugin_daemon-1  | runtime/debug.PrintStack()
plugin_daemon-1  |      /usr/local/go/src/runtime/debug/stack.go:18 +0x1c
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server.panicHandler(0x40004d5380?, {0x0?, 0x2?})
plugin_daemon-1  |      /app/internal/server/http_server.go:22 +0x1c
plugin_daemon-1  | github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1.1()
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:98 +0x5ac
plugin_daemon-1  | panic({0x1ba6dc0?, 0x37e3550?})
plugin_daemon-1  |      /usr/local/go/src/runtime/panic.go:791 +0x124
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).setupStdioEventListener(0x0, {0x40007dc2a0, 0x24}, 0x400145ad30)
plugin_daemon-1  |      /app/internal/core/plugin_manager/local_runtime/stdio.go:86 +0x7c
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).Listen(0x4002914008, {0x40007dc2a0, 0x24})
plugin_daemon-1  |      /app/internal/core/plugin_manager/local_runtime/io.go:16 +0x148
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_daemon.GenericInvokePlugin[...](0x400320f500, 0x40035a7df8, 0x400)
plugin_daemon-1  |      /app/internal/core/plugin_daemon/generic.go:27 +0xf8
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_daemon.InvokeTool(...)
plugin_daemon-1  |      /app/internal/core/plugin_daemon/tool.gen.go:18
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/service.InvokeTool.func1(0x1a7b301?)
plugin_daemon-1  |      /app/internal/service/tool.gen.go:23 +0x38
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEWithSession[...].func1()
plugin_daemon-1  |      /app/internal/service/base_sse.go:116 +0x28
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEService[...](0x4003139150, 0x206940b, 0x258?)
plugin_daemon-1  |      /app/internal/service/base_sse.go:44 +0x1a4
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEWithSession[...](0x40031391e8, {0x206940b, 0x4}, {0x207baef, 0xb}, 0x40035a7d90, 0x400052c200, 0x258)
plugin_daemon-1  |      /app/internal/service/base_sse.go:114 +0x180
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/service.InvokeTool(0x1004000a82880?, 0x1ddcb80?, 0x40021fcad0?)
plugin_daemon-1  |      /app/internal/service/tool.gen.go:21 +0x5c
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).setupGeneratedRoutes.InvokeTool.func1.1({{{0x400387d6dd, 0x24}, {0x40024b7f20, 0x24}}, {{0x0, 0x0}}, {0x4002aec660, 0x60}, 0x40021fcb70, 0x0, ...})
plugin_daemon-1  |      /app/internal/server/controllers/tool.gen.go:20 +0x90
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...].func1()
plugin_daemon-1  |      /app/internal/server/controllers/base.go:53 +0x98
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindRequest[...](0x400052c200, 0x4003139488)
plugin_daemon-1  |      /app/internal/server/controllers/base.go:31 +0x228
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...](0x605040702010003?, 0x40031394d8?)
plugin_daemon-1  |      /app/internal/server/controllers/base.go:37 +0x3c
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).setupGeneratedRoutes.InvokeTool.func1(0x400052c200)
plugin_daemon-1  |      /app/internal/server/controllers/tool.gen.go:17 +0x80
plugin_daemon-1  | github.com/gin-gonic/gin.(*Context).Next(0x400052c200)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).InitClusterID.func4(0x400052c200)
plugin_daemon-1  |      /app/internal/server/middleware.go:182 +0x58
plugin_daemon-1  | github.com/gin-gonic/gin.(*Context).Next(0x400052c200)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).RedirectPluginInvoke.func3(0x400052c200)
plugin_daemon-1  |      /app/internal/server/middleware.go:109 +0x74
plugin_daemon-1  | github.com/gin-gonic/gin.(*Context).Next(0x400052c200)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).FetchPluginInstallation.func2(0x400052c200)
plugin_daemon-1  |      /app/internal/server/middleware.go:78 +0x1dc
plugin_daemon-1  | github.com/gin-gonic/gin.(*Context).Next(0x400052c200)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.CollectActiveDispatchRequests.func1(0x40026b7718?)
plugin_daemon-1  |      /app/internal/server/controllers/health_check.go:28 +0x5c
plugin_daemon-1  | github.com/gin-gonic/gin.(*Context).Next(0x400052c200)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginGroup.CheckingKey.func1(0x400052c200)
plugin_daemon-1  |      /app/internal/server/middleware.go:26 +0x98
plugin_daemon-1  | github.com/gin-gonic/gin.(*Context).Next(0x400052c200)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).server.CollectActiveRequests.func3(0x40026b77b8?)
plugin_daemon-1  |      /app/internal/server/controllers/health_check.go:20 +0x5c
plugin_daemon-1  | github.com/gin-gonic/gin.(*Context).Next(...)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
plugin_daemon-1  | github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0x400052c200)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 +0x7c
plugin_daemon-1  | github.com/gin-gonic/gin.(*Context).Next(...)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
plugin_daemon-1  | github.com/gin-gonic/gin.LoggerWithConfig.func1(0x400052c200)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 +0xb8
plugin_daemon-1  | github.com/gin-gonic/gin.(*Context).Next(...)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
plugin_daemon-1  | github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0x40006ac1a0, 0x400052c200)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 +0x6c4
plugin_daemon-1  | github.com/gin-gonic/gin.(*Engine).ServeHTTP(0x40006ac1a0, {0x23d3dd0, 0x4002612540}, 0x4002e3ea00)
plugin_daemon-1  |      /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 +0x174
plugin_daemon-1  | net/http.serverHandler.ServeHTTP({0x23c6328?}, {0x23d3dd0?, 0x4002612540?}, 0x6?)
plugin_daemon-1  |      /usr/local/go/src/net/http/server.go:3210 +0xbc
plugin_daemon-1  | net/http.(*conn).serve(0x400184ab40, {0x23d8738, 0x40006ee330})
plugin_daemon-1  |      /usr/local/go/src/net/http/server.go:2092 +0x4fc
plugin_daemon-1  | created by net/http.(*Server).Serve in goroutine 54
plugin_daemon-1  |      /usr/local/go/src/net/http/server.go:3360 +0x3dc
plugin_daemon-1  | [GIN] 2025/09/28 - 16:52:13 | 200 |    1.401677ms |   192.168.107.1 | GET      "/plugin/b8100148-b808-472a-b265-41409558f5d7/management/install/tasks?page=1&page_size=100"

The patch I applied is:

diff --git i/internal/core/plugin_manager/local_runtime/stdio.go w/internal/core/plugin_manager/local_runtime/stdio.go
index 3e9f13d..275d6f5 100644
--- i/internal/core/plugin_manager/local_runtime/stdio.go
+++ w/internal/core/plugin_manager/local_runtime/stdio.go
@@ -82,6 +82,8 @@ func newStdioHolder(
 }
 
 func (s *stdioHolder) setupStdioEventListener(session_id string, listener func([]byte)) {
+	fmt.Printf("s: %+v\n", s)
+	fmt.Printf("s.l: %+v\n", s.l)
 	s.l.Lock()
 	defer s.l.Unlock()
 	if s.listener == nil {
diff --git i/internal/server/http_server.go w/internal/server/http_server.go
index 7439647..b4f3c06 100644
--- i/internal/server/http_server.go
+++ w/internal/server/http_server.go
@@ -4,6 +4,8 @@
 	"context"
 	"fmt"
 	"net/http"
+	"os"
+	"runtime/debug"
 	"time"
 
 	"github.com/gin-gonic/gin"
@@ -16,9 +18,15 @@
 	sentrygin "github.com/getsentry/sentry-go/gin"
 )
 
+func panicHandler(ctx *gin.Context, err any) {
+	debug.PrintStack()
+	os.Stderr.Sync()
+}
+
 // server starts a http server and returns a function to stop it
 func (app *App) server(config *app.Config) func() {
 	engine := gin.New()
+	gin.SetMode(gin.DebugMode)
 	if *config.HealthApiLogEnabled {
 		engine.Use(gin.Logger())
 	} else {
@@ -26,7 +34,7 @@ func (app *App) server(config *app.Config) func() {
 			SkipPaths: []string{"/health/check"},
 		}))
 	}
-	engine.Use(gin.Recovery())
+	engine.Use(gin.CustomRecoveryWithWriter(os.Stderr, panicHandler))
 	engine.Use(controllers.CollectActiveRequests())
 	engine.GET("/health/check", controllers.HealthCheck(config))
@QuantumGhost commented on GitHub (Sep 29, 2025): I have encountered this issue too while trying to resolve [this issue](https://github.com/bowenliang123/md_exporter/issues/102). I make a tiny adjustment to the source code of plugin daemon to get a more comprehensive traceback. The following traceback are from my debugging docker image. The log ` s: <nil>` indicates that the receiver `s` of method `setupStdioEventListener` is `nil`. The traceback also confirms this. The first element in parameter list is `0x0`, as the follow line shows: ``` plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).setupStdioEventListener(0x0, {0x40007dc2a0, 0x24}, 0x400145ad30) ``` I suspect this is a timing issue in connection setup and listening. Full traceback: ```text plugin_daemon-1 | [GIN] 2025/09/28 - 16:52:13 | 200 | 3.142482ms | 192.168.107.1 | GET "/plugin/b8100148-b808-472a-b265-41409558f5d7/management/tool?provider=md_exporter&plugin_id=bowenliang123%2Fmd_exporter" plugin_daemon-1 | s: <nil> plugin_daemon-1 | plugin_daemon-1 | plugin_daemon-1 | 2025/09/28 16:52:13 [Recovery] 2025/09/28 - 16:52:13 panic recovered: plugin_daemon-1 | POST /plugin/b8100148-b808-472a-b265-41409558f5d7/dispatch/tool/invoke HTTP/1.1 plugin_daemon-1 | Host: 127.0.0.1:5002 plugin_daemon-1 | Accept: */* plugin_daemon-1 | Accept-Encoding: gzip, deflate, br plugin_daemon-1 | Connection: keep-alive plugin_daemon-1 | Content-Length: 373 plugin_daemon-1 | Content-Type: application/json plugin_daemon-1 | User-Agent: python-requests/2.32.5 plugin_daemon-1 | X-Api-Key: [REDACTED] plugin_daemon-1 | X-Plugin-Id: bowenliang123/md_exporter plugin_daemon-1 | plugin_daemon-1 | plugin_daemon-1 | runtime error: invalid memory address or nil pointer dereference plugin_daemon-1 | /usr/local/go/src/runtime/panic.go:262 (0x8781f) plugin_daemon-1 | /usr/local/go/src/runtime/signal_unix.go:917 (0x877ec) plugin_daemon-1 | /app/internal/core/plugin_manager/local_runtime/stdio.go:86 (0x905f4c) plugin_daemon-1 | /app/internal/core/plugin_manager/local_runtime/io.go:16 (0x903b97) plugin_daemon-1 | /app/internal/core/plugin_daemon/generic.go:27 (0xb13f37) plugin_daemon-1 | /app/internal/core/plugin_daemon/tool.gen.go:18 (0xb55aa7) plugin_daemon-1 | /app/internal/service/tool.gen.go:23 (0xb55a8c) plugin_daemon-1 | /app/internal/service/base_sse.go:116 (0xb58017) plugin_daemon-1 | /app/internal/service/base_sse.go:44 (0xb58243) plugin_daemon-1 | /app/internal/service/base_sse.go:114 (0xb57f6f) plugin_daemon-1 | /app/internal/service/tool.gen.go:21 (0xb55a3b) plugin_daemon-1 | /app/internal/server/controllers/tool.gen.go:20 (0x18c1ccf) plugin_daemon-1 | /app/internal/server/controllers/base.go:53 (0xb83097) plugin_daemon-1 | /app/internal/server/controllers/base.go:31 (0xb83477) plugin_daemon-1 | /app/internal/server/controllers/base.go:37 (0xb82fcb) plugin_daemon-1 | /app/internal/server/controllers/tool.gen.go:17 (0x18c1c1f) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f) plugin_daemon-1 | /app/internal/server/middleware.go:182 (0x18c3377) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f) plugin_daemon-1 | /app/internal/server/middleware.go:109 (0x18c3413) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f) plugin_daemon-1 | /app/internal/server/middleware.go:78 (0x18c749b) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f) plugin_daemon-1 | /app/internal/server/controllers/health_check.go:28 (0x18c725b) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f) plugin_daemon-1 | /app/internal/server/middleware.go:26 (0x18c2d37) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xabfd4f) plugin_daemon-1 | /app/internal/server/controllers/health_check.go:20 (0x18c719b) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xaccc3b) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 (0xaccc1c) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xacc037) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xacc014) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xacb473) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 (0xacaffc) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 (0xacac23) plugin_daemon-1 | /usr/local/go/src/net/http/server.go:3210 (0x39dfdb) plugin_daemon-1 | /usr/local/go/src/net/http/server.go:2092 (0x37f27b) plugin_daemon-1 | /usr/local/go/src/runtime/asm_arm64.s:1223 (0x8dae3) plugin_daemon-1 | plugin_daemon-1 | [GIN] 2025/09/28 - 16:52:13 | 200 | 30.150975ms | 192.168.107.1 | POST "/plugin/b8100148-b808-472a-b265-41409558f5d7/dispatch/tool/invoke" plugin_daemon-1 | goroutine 576 [running]: plugin_daemon-1 | runtime/debug.Stack() plugin_daemon-1 | /usr/local/go/src/runtime/debug/stack.go:26 +0x64 plugin_daemon-1 | runtime/debug.PrintStack() plugin_daemon-1 | /usr/local/go/src/runtime/debug/stack.go:18 +0x1c plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server.panicHandler(0x40004d5380?, {0x0?, 0x2?}) plugin_daemon-1 | /app/internal/server/http_server.go:22 +0x1c plugin_daemon-1 | github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1.1() plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:98 +0x5ac plugin_daemon-1 | panic({0x1ba6dc0?, 0x37e3550?}) plugin_daemon-1 | /usr/local/go/src/runtime/panic.go:791 +0x124 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).setupStdioEventListener(0x0, {0x40007dc2a0, 0x24}, 0x400145ad30) plugin_daemon-1 | /app/internal/core/plugin_manager/local_runtime/stdio.go:86 +0x7c plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).Listen(0x4002914008, {0x40007dc2a0, 0x24}) plugin_daemon-1 | /app/internal/core/plugin_manager/local_runtime/io.go:16 +0x148 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_daemon.GenericInvokePlugin[...](0x400320f500, 0x40035a7df8, 0x400) plugin_daemon-1 | /app/internal/core/plugin_daemon/generic.go:27 +0xf8 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_daemon.InvokeTool(...) plugin_daemon-1 | /app/internal/core/plugin_daemon/tool.gen.go:18 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/service.InvokeTool.func1(0x1a7b301?) plugin_daemon-1 | /app/internal/service/tool.gen.go:23 +0x38 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEWithSession[...].func1() plugin_daemon-1 | /app/internal/service/base_sse.go:116 +0x28 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEService[...](0x4003139150, 0x206940b, 0x258?) plugin_daemon-1 | /app/internal/service/base_sse.go:44 +0x1a4 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/service.baseSSEWithSession[...](0x40031391e8, {0x206940b, 0x4}, {0x207baef, 0xb}, 0x40035a7d90, 0x400052c200, 0x258) plugin_daemon-1 | /app/internal/service/base_sse.go:114 +0x180 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/service.InvokeTool(0x1004000a82880?, 0x1ddcb80?, 0x40021fcad0?) plugin_daemon-1 | /app/internal/service/tool.gen.go:21 +0x5c plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).setupGeneratedRoutes.InvokeTool.func1.1({{{0x400387d6dd, 0x24}, {0x40024b7f20, 0x24}}, {{0x0, 0x0}}, {0x4002aec660, 0x60}, 0x40021fcb70, 0x0, ...}) plugin_daemon-1 | /app/internal/server/controllers/tool.gen.go:20 +0x90 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...].func1() plugin_daemon-1 | /app/internal/server/controllers/base.go:53 +0x98 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindRequest[...](0x400052c200, 0x4003139488) plugin_daemon-1 | /app/internal/server/controllers/base.go:31 +0x228 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server/controllers.BindPluginDispatchRequest[...](0x605040702010003?, 0x40031394d8?) plugin_daemon-1 | /app/internal/server/controllers/base.go:37 +0x3c plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).setupGeneratedRoutes.InvokeTool.func1(0x400052c200) plugin_daemon-1 | /app/internal/server/controllers/tool.gen.go:17 +0x80 plugin_daemon-1 | github.com/gin-gonic/gin.(*Context).Next(0x400052c200) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).InitClusterID.func4(0x400052c200) plugin_daemon-1 | /app/internal/server/middleware.go:182 +0x58 plugin_daemon-1 | github.com/gin-gonic/gin.(*Context).Next(0x400052c200) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).RedirectPluginInvoke.func3(0x400052c200) plugin_daemon-1 | /app/internal/server/middleware.go:109 +0x74 plugin_daemon-1 | github.com/gin-gonic/gin.(*Context).Next(0x400052c200) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).FetchPluginInstallation.func2(0x400052c200) plugin_daemon-1 | /app/internal/server/middleware.go:78 +0x1dc plugin_daemon-1 | github.com/gin-gonic/gin.(*Context).Next(0x400052c200) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.CollectActiveDispatchRequests.func1(0x40026b7718?) plugin_daemon-1 | /app/internal/server/controllers/health_check.go:28 +0x5c plugin_daemon-1 | github.com/gin-gonic/gin.(*Context).Next(0x400052c200) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginGroup.CheckingKey.func1(0x400052c200) plugin_daemon-1 | /app/internal/server/middleware.go:26 +0x98 plugin_daemon-1 | github.com/gin-gonic/gin.(*Context).Next(0x400052c200) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x40 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/server.(*App).server.CollectActiveRequests.func3(0x40026b77b8?) plugin_daemon-1 | /app/internal/server/controllers/health_check.go:20 +0x5c plugin_daemon-1 | github.com/gin-gonic/gin.(*Context).Next(...) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 plugin_daemon-1 | github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0x400052c200) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 +0x7c plugin_daemon-1 | github.com/gin-gonic/gin.(*Context).Next(...) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 plugin_daemon-1 | github.com/gin-gonic/gin.LoggerWithConfig.func1(0x400052c200) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 +0xb8 plugin_daemon-1 | github.com/gin-gonic/gin.(*Context).Next(...) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 plugin_daemon-1 | github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0x40006ac1a0, 0x400052c200) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 +0x6c4 plugin_daemon-1 | github.com/gin-gonic/gin.(*Engine).ServeHTTP(0x40006ac1a0, {0x23d3dd0, 0x4002612540}, 0x4002e3ea00) plugin_daemon-1 | /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 +0x174 plugin_daemon-1 | net/http.serverHandler.ServeHTTP({0x23c6328?}, {0x23d3dd0?, 0x4002612540?}, 0x6?) plugin_daemon-1 | /usr/local/go/src/net/http/server.go:3210 +0xbc plugin_daemon-1 | net/http.(*conn).serve(0x400184ab40, {0x23d8738, 0x40006ee330}) plugin_daemon-1 | /usr/local/go/src/net/http/server.go:2092 +0x4fc plugin_daemon-1 | created by net/http.(*Server).Serve in goroutine 54 plugin_daemon-1 | /usr/local/go/src/net/http/server.go:3360 +0x3dc plugin_daemon-1 | [GIN] 2025/09/28 - 16:52:13 | 200 | 1.401677ms | 192.168.107.1 | GET "/plugin/b8100148-b808-472a-b265-41409558f5d7/management/install/tasks?page=1&page_size=100" ``` The patch I applied is: ```diff diff --git i/internal/core/plugin_manager/local_runtime/stdio.go w/internal/core/plugin_manager/local_runtime/stdio.go index 3e9f13d..275d6f5 100644 --- i/internal/core/plugin_manager/local_runtime/stdio.go +++ w/internal/core/plugin_manager/local_runtime/stdio.go @@ -82,6 +82,8 @@ func newStdioHolder( } func (s *stdioHolder) setupStdioEventListener(session_id string, listener func([]byte)) { + fmt.Printf("s: %+v\n", s) + fmt.Printf("s.l: %+v\n", s.l) s.l.Lock() defer s.l.Unlock() if s.listener == nil { diff --git i/internal/server/http_server.go w/internal/server/http_server.go index 7439647..b4f3c06 100644 --- i/internal/server/http_server.go +++ w/internal/server/http_server.go @@ -4,6 +4,8 @@ "context" "fmt" "net/http" + "os" + "runtime/debug" "time" "github.com/gin-gonic/gin" @@ -16,9 +18,15 @@ sentrygin "github.com/getsentry/sentry-go/gin" ) +func panicHandler(ctx *gin.Context, err any) { + debug.PrintStack() + os.Stderr.Sync() +} + // server starts a http server and returns a function to stop it func (app *App) server(config *app.Config) func() { engine := gin.New() + gin.SetMode(gin.DebugMode) if *config.HealthApiLogEnabled { engine.Use(gin.Logger()) } else { @@ -26,7 +34,7 @@ func (app *App) server(config *app.Config) func() { SkipPaths: []string{"/health/check"}, })) } - engine.Use(gin.Recovery()) + engine.Use(gin.CustomRecoveryWithWriter(os.Stderr, panicHandler)) engine.Use(controllers.CollectActiveRequests()) engine.GET("/health/check", controllers.HealthCheck(config)) ```
Author
Owner

@Yeuoly commented on GitHub (Dec 12, 2025):

Already solved.

@Yeuoly commented on GitHub (Dec 12, 2025): Already solved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#191