Batch uploading files to the knowledge base will result in errors #10153

Closed
opened 2026-02-21 18:43:22 -05:00 by yindo · 0 comments
Owner

Originally created by @David885L2 on GitHub (Mar 10, 2025).

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 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.

Dify version

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Batch uploading files to the knowledge base will result in errors

[GIN] 2025/03/10 - 08:19:09 | 200 | 1.048124ms | 172.20.0.9 | POST "/plugin/8b9f3a8c-92b3-4dbb-a9e6-03500fcfab64/dispatch/text_embedding/num_tokens"
fatal error: concurrent map iteration and map write

goroutine 83 [running]:
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout.func1({0xc000bb0720, 0x24}, {0xc000730e28, 0x18, 0x18})
/app/internal/core/plugin_manager/local_runtime/stdio_handle.go:100 +0x105
github.com/langgenius/dify-plugin-daemon/pkg/entities/plugin_entities.ParsePluginUniversalEvent({0xc0008be7a7, 0x67, 0x60?}, {0x0, 0x0}, 0xc00102dd38, 0xc00102dd20, 0xc00102dd10, 0xc00102dd00)
/app/pkg/entities/plugin_entities/event.go:54 +0x515
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout(0xc0000cec30, 0x16713b8)
/app/internal/core/plugin_manager/local_runtime/stdio_handle.go:93 +0x273
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin.func3()
/app/internal/core/plugin_manager/local_runtime/run.go:160 +0x57
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc000258ba0?})
/app/internal/utils/routine/pool.go:58 +0x34
runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc00026a280?, 0x16178c8?, 0x138dc20?}}, 0xc000363f00)
/usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1()
/app/internal/utils/routine/pool.go:56 +0x394
github.com/panjf2000/ants.(*goWorker).run.func1()
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d
created by github.com/panjf2000/ants.(*goWorker).run in goroutine 82
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c

goroutine 1 [select (no cases)]:
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc0001160d8, 0xc00091d608)
/app/internal/server/server.go:82 +0x1d8
main.main()
/app/cmd/server/main.go:28 +0xff

goroutine 6 [chan receive]:
github.com/panjf2000/ants.(*Pool).periodicallyPurge(0xc0000f2000)
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/pool.go:84 +0xc7
created by github.com/panjf2000/ants.NewPool in goroutine 1
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/pool.go:163 +0x20c

goroutine 13 [chan receive]:
github.com/panjf2000/ants.(*Pool).periodicallyPurge(0xc0000f2510)
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/pool.go:84 +0xc7
created by github.com/panjf2000/ants.NewPool in goroutine 1
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/pool.go:163 +0x20c

goroutine 85 [IO wait]:
internal/poll.runtime_pollWait(0x7f9ab92a4500, 0x72)
/usr/local/go/src/runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc0003725a0?, 0xc0005a20cc?, 0x1)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0003725a0, {0xc0005a20cc, 0x734, 0x734})
/usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a
os.(*File).read(...)
/usr/local/go/src/os/file_posix.go:29
os.(*File).Read(0xc000094a70, {0xc0005a20cc?, 0x735?, 0xc000a8a000?})
/usr/local/go/src/os/file.go:118 +0x52
bufio.(*Scanner).Scan(0xc0007fdc70)
/usr/local/go/src/bufio/scan.go:219 +0x81e
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout(0xc000939380, 0x16713b8)
/app/internal/core/plugin_manager/local_runtime/stdio_handle.go:86 +0x17f
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin.func3()
/app/internal/core/plugin_manager/local_runtime/run.go:160 +0x57
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc00087efc0?})
/app/internal/utils/routine/pool.go:58 +0x34
runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc000734480?, 0x16178c8?, 0x138dc20?}}, 0xc00002af00)
/usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1()
/app/internal/utils/routine/pool.go:56 +0x394
github.com/panjf2000/ants.(*goWorker).run.func1()
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d
created by github.com/panjf2000/ants.(*goWorker).run in goroutine 20
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c

goroutine 49 [select]:
database/sql.(*DB).connectionOpener(0xc0009388f0, {0x1820248, 0xc00027ecd0})
/usr/local/go/src/database/sql/sql.go:1246 +0x87
created by database/sql.OpenDB in goroutine 1
/usr/local/go/src/database/sql/sql.go:824 +0x14c

goroutine 52 [select]:
database/sql.(*DB).connectionCleaner(0xc0009388f0, 0x0?)
/usr/local/go/src/database/sql/sql.go:1089 +0x9c
created by database/sql.(*DB).startCleanerLocked in goroutine 1
/usr/local/go/src/database/sql/sql.go:1076 +0x105

goroutine 42 [chan receive]:
github.com/langgenius/dify-plugin-daemon/internal/utils/stream.(*Stream[...]).Next(0xc00071c000)
/app/internal/utils/stream/stream.go:74 +0x165
github.com/langgenius/dify-plugin-daemon/internal/utils/stream.(*Stream[...]).Async(0x1830b40, 0xc00071c000)
/app/internal/utils/stream/stream.go:108 +0x3f
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/debugging_runtime.(*RemotePluginServer).Wrap(0x0?, 0x0?)
/app/internal/core/plugin_manager/debugging_runtime/server.go:55 +0x25
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startRemoteWatcher.func2()
/app/internal/core/plugin_manager/watcher.go:43 +0x6b
created by github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startRemoteWatcher in goroutine 1
/app/internal/core/plugin_manager/watcher.go:42 +0x105

goroutine 84 [IO wait]:
internal/poll.runtime_pollWait(0x7f9ab92a4120, 0x72)
/usr/local/go/src/runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc0002905a0?, 0xc0000d5c00?, 0x1)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0002905a0, {0xc0000d5c00, 0x400, 0x400})
/usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a
os.(*File).read(...)
/usr/local/go/src/os/file_posix.go:29
os.(*File).Read(0xc0000948b8, {0xc0000d5c00?, 0x1?, 0x41a798?})
/usr/local/go/src/os/file.go:118 +0x52
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStderr(0xc0000cec30)
/app/internal/core/plugin_manager/local_runtime/stdio_handle.go:147 +0x51
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin.func4()
/app/internal/core/plugin_manager/local_runtime/run.go:170 +0x50
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc000143650?})
/app/internal/utils/routine/pool.go:58 +0x34
runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc00036a400?, 0x16178c8?, 0x138dc20?}}, 0xc0006fcf00)
/usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1()
/app/internal/utils/routine/pool.go:56 +0x394
github.com/panjf2000/ants.(*goWorker).run.func1()
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d
created by github.com/panjf2000/ants.(*goWorker).run in goroutine 82
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c

goroutine 40 [chan receive]:
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startLocalWatcher.func1()
/app/internal/core/plugin_manager/watcher.go:18 +0xd4
created by github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startLocalWatcher in goroutine 1
/app/internal/core/plugin_manager/watcher.go:15 +0x4f

goroutine 82 [select]:
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).Wait(0xc0000cec30)
/app/internal/core/plugin_manager/local_runtime/stdio_handle.go:183 +0x1f4
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin(0xc0003dc708)
/app/internal/core/plugin_manager/local_runtime/run.go:184 +0xdfc
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).fullDuplexLifecycle(0x1400040?, {0x1836100, 0xc0003dc708}, 0xc000188300, 0xc000188360)
/app/internal/core/plugin_manager/runtime_lifetime.go:99 +0x571
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).launchLocal.func2()
/app/internal/core/plugin_manager/launcher.go:186 +0x1a5
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc000142ba0?})
/app/internal/utils/routine/pool.go:58 +0x34
runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc000290360?, 0x16178c8?, 0x138dc20?}}, 0xc0006fdf00)
/usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1()
/app/internal/utils/routine/pool.go:56 +0x394
github.com/panjf2000/ants.(*goWorker).run.func1()
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d
created by github.com/panjf2000/ants.(*goWorker).run in goroutine 40
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c

goroutine 41 [chan receive]:
github.com/panjf2000/gnet/v2.(*engine).stop(0xc0000f2630, {0xc0007eca10?})
/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/engine_unix.go:208 +0x34
github.com/panjf2000/gnet/v2.run({0x1824958, 0xc0000b46c0}, {0xc000094ac0, 0x1, 0x2?}, 0xc0000f2360, {0xc00002ce90, 0x1, 0x44080e?})
/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/engine_unix.go:306 +0x6b1
github.com/panjf2000/gnet/v2.Run({0x1824958, 0xc0000b46c0}, {0xc000730048, 0x12}, {0xc00002cf30?, 0x1820248?, 0xc000534230?})
/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/gnet.go:551 +0x145
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/debugging_runtime.(*RemotePluginServer).Launch(0xc0000944b0)
/app/internal/core/plugin_manager/debugging_runtime/server.go:80 +0x186
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startRemoteWatcher.func1()
/app/internal/core/plugin_manager/watcher.go:37 +0x2a
created by github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startRemoteWatcher in goroutine 1
/app/internal/core/plugin_manager/watcher.go:36 +0xc5

goroutine 43 [select]:
github.com/langgenius/dify-plugin-daemon/internal/cluster.(*Cluster).clusterLifetime(0xc000726000)
/app/internal/cluster/cluster_lifetime.go:105 +0x3fc
created by github.com/langgenius/dify-plugin-daemon/internal/cluster.(*Cluster).Launch in goroutine 1
/app/internal/cluster/cluster.go:97 +0x4f

goroutine 44 [IO wait]:
internal/poll.runtime_pollWait(0x7f9ab92a4db8, 0x72)
/usr/local/go/src/runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xa?, 0x1?, 0x0)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0xc000734080)
/usr/local/go/src/internal/poll/fd_unix.go:611 +0x2ac
net.(*netFD).accept(0xc000734080)
/usr/local/go/src/net/fd_unix.go:172 +0x29
net.(*TCPListener).accept(0xc000270700)
/usr/local/go/src/net/tcpsock_posix.go:159 +0x1e
net.(*TCPListener).Accept(0xc000270700)
/usr/local/go/src/net/tcpsock.go:327 +0x30
net/http.(*Server).Serve(0xc00056a000, {0x181dc10, 0xc000270700})
/usr/local/go/src/net/http/server.go:3260 +0x33e
net/http.(*Server).ListenAndServe(0xc00056a000)
/usr/local/go/src/net/http/server.go:3189 +0x71
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).server.func1()
/app/internal/server/http_server.go:54 +0x1b
created by github.com/langgenius/dify-plugin-daemon/internal/server.(*App).server in goroutine 1
/app/internal/server/http_server.go:53 +0x336

goroutine 20 [select]:
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).Wait(0xc000939380)
/app/internal/core/plugin_manager/local_runtime/stdio_handle.go:183 +0x1f4
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin(0xc000944008)
/app/internal/core/plugin_manager/local_runtime/run.go:184 +0xdfc
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).fullDuplexLifecycle(0x1400040?, {0x1836100, 0xc000944008}, 0xc000542720, 0xc000542780)
/app/internal/core/plugin_manager/runtime_lifetime.go:99 +0x571
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).launchLocal.func2()
/app/internal/core/plugin_manager/launcher.go:186 +0x1a5
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc00087ed20?})
/app/internal/utils/routine/pool.go:58 +0x34
runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc000372420?, 0x16178c8?, 0x138dc20?}}, 0xc00035ef00)
/usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1()
/app/internal/utils/routine/pool.go:56 +0x394
github.com/panjf2000/ants.(*goWorker).run.func1()
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d
created by github.com/panjf2000/ants.(*goWorker).run in goroutine 43
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c

goroutine 69 [IO wait]:
internal/poll.runtime_pollWait(0x7f9ab92a49d8, 0x72)
/usr/local/go/src/runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc00026a180?, 0xc000030000?, 0x0)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc00026a180, {0xc000030000, 0x1000, 0x1000})
/usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a
net.(*netFD).Read(0xc00026a180, {0xc000030000?, 0x87d865?, 0xc000503480?})
/usr/local/go/src/net/fd_posix.go:55 +0x25
net.(*conn).Read(0xc00011a060, {0xc000030000?, 0xc00002dcc0?, 0x410330?})
/usr/local/go/src/net/net.go:185 +0x45
bufio.(*Reader).fill(0xc0001eb2c0)
/usr/local/go/src/bufio/bufio.go:110 +0x103
bufio.(*Reader).ReadSlice(0xc0001eb2c0, 0xa)
/usr/local/go/src/bufio/bufio.go:376 +0x29
github.com/redis/go-redis/v9/internal/proto.(*Reader).readLine(0xc00011a068)
/go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/internal/proto/reader.go:131 +0x2a
github.com/redis/go-redis/v9/internal/proto.(*Reader).ReadLine(0xc00011a068)
/go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/internal/proto/reader.go:96 +0x1c
github.com/redis/go-redis/v9/internal/proto.(*Reader).ReadReply(0xc00011a068)
/go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/internal/proto/reader.go:155 +0x1c
github.com/redis/go-redis/v9.(*Cmd).readReply(...)
/go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/command.go:481
github.com/redis/go-redis/v9.(*PubSub).ReceiveTimeout.func1(0xc0005343c0?)
/go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/pubsub.go:436 +0x25
github.com/redis/go-redis/v9/internal/pool.(*Conn).WithReader(0xc0005343c0?, {0x1820060?, 0x22c9d60?}, 0xc00002def0?, 0xc00002def0?)
/go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/internal/pool/conn.go:74 +0x66
github.com/redis/go-redis/v9.(*PubSub).ReceiveTimeout(0xc000060080, {0x1820060, 0x22c9d60}, 0x0)
/go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/pubsub.go:435 +0xf6
github.com/redis/go-redis/v9.(*PubSub).Receive(0x181d400?, {0x1820060?, 0x22c9d60?})
/go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/pubsub.go:452 +0x1f
github.com/langgenius/dify-plugin-daemon/internal/utils/cache.Subscribe[...].func1()
/app/internal/utils/cache/redis.go:484 +0xdf
created by github.com/langgenius/dify-plugin-daemon/internal/utils/cache.Subscribe[...] in goroutine 43
/app/internal/utils/cache/redis.go:478 +0xfd

goroutine 56 [IO wait]:
internal/poll.runtime_pollWait(0x7f9ab92a45f8, 0x72)
/usr/local/go/src/runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc000060200?, 0xc0002aa000?, 0x0)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc000060200, {0xc0002aa000, 0x1000, 0x1000})
/usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a
net.(*netFD).Read(0xc000060200, {0xc0002aa000?, 0xc0002eba98?, 0x4f0725?})
/usr/local/go/src/net/fd_posix.go:55 +0x25
net.(*conn).Read(0xc00011a018, {0xc0002aa000?, 0x0?, 0xc0002ca0f8?})
/usr/local/go/src/net/net.go:185 +0x45
net/http.(*connReader).Read(0xc0002ca0f0, {0xc0002aa000, 0x1000, 0x1000})
/usr/local/go/src/net/http/server.go:789 +0x14b
bufio.(*Reader).fill(0xc00028e120)
/usr/local/go/src/bufio/bufio.go:110 +0x103
bufio.(*Reader).Peek(0xc00028e120, 0x4)
/usr/local/go/src/bufio/bufio.go:148 +0x53
net/http.(*conn).serve(0xc000538090, {0x1820210, 0xc000227320})
/usr/local/go/src/net/http/server.go:2079 +0x749
created by net/http.(*Server).Serve in goroutine 44
/usr/local/go/src/net/http/server.go:3290 +0x4b4

goroutine 99 [IO wait]:
internal/poll.runtime_pollWait(0x7f9ab92a48e0, 0x72)
/usr/local/go/src/runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc000734100?, 0xc000014000?, 0x0)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc000734100, {0xc000014000, 0x1000, 0x1000})
/usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a
net.(*netFD).Read(0xc000734100, {0xc000014000?, 0x0?, 0xc000583180?})
/usr/local/go/src/net/fd_posix.go:55 +0x25
net.(*conn).Read(0xc000182028, {0xc000014000?, 0x0?, 0xc0005828c0?})
/usr/local/go/src/net/net.go:185 +0x45
net/http.(*persistConn).Read(0xc00075d560, {0xc000014000?, 0xc0006d4e40?, 0xc000360d38?})
/usr/local/go/src/net/http/transport.go:1977 +0x4a
bufio.(*Reader).fill(0xc000114a80)
/usr/local/go/src/bufio/bufio.go:110 +0x103
bufio.(*Reader).Peek(0xc000114a80, 0x1)
/usr/local/go/src/bufio/bufio.go:148 +0x53
net/http.(*persistConn).readLoop(0xc00075d560)
/usr/local/go/src/net/http/transport.go:2141 +0x1b9
created by net/http.(*Transport).dialConn in goroutine 97
/usr/local/go/src/net/http/transport.go:1799 +0x152f

goroutine 48 [IO wait]:
internal/poll.runtime_pollWait(0x7f9ab92a4ad0, 0x72)
/usr/local/go/src/runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc00036a600?, 0xc0002a4000?, 0x0)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc00036a600, {0xc0002a4000, 0x1000, 0x1000})
/usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a
net.(*netFD).Read(0xc00036a600, {0xc0002a4000?, 0xc00001fa98?, 0x4f0725?})
/usr/local/go/src/net/fd_posix.go:55 +0x25
net.(*conn).Read(0xc000094758, {0xc0002a4000?, 0x0?, 0xc0000c8a58?})
/usr/local/go/src/net/net.go:185 +0x45
net/http.(*connReader).Read(0xc0000c8a50, {0xc0002a4000, 0x1000, 0x1000})
/usr/local/go/src/net/http/server.go:789 +0x14b
bufio.(*Reader).fill(0xc00028e000)
/usr/local/go/src/bufio/bufio.go:110 +0x103
bufio.(*Reader).Peek(0xc00028e000, 0x4)
/usr/local/go/src/bufio/bufio.go:148 +0x53
net/http.(*conn).serve(0xc0006e8750, {0x1820210, 0xc000227320})
/usr/local/go/src/net/http/server.go:2079 +0x749
created by net/http.(*Server).Serve in goroutine 44
/usr/local/go/src/net/http/server.go:3290 +0x4b4

goroutine 100 [select]:
net/http.(*persistConn).writeLoop(0xc00075d560)
/usr/local/go/src/net/http/transport.go:2458 +0xf0
created by net/http.(*Transport).dialConn in goroutine 97
/usr/local/go/src/net/http/transport.go:1800 +0x1585

goroutine 26 [IO wait]:
internal/poll.runtime_pollWait(0x7f9ab92a46f0, 0x72)
/usr/local/go/src/runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc00026a000?, 0xc000384000?, 0x0)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc00026a000, {0xc000384000, 0x1000, 0x1000})
/usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a
net.(*netFD).Read(0xc00026a000, {0xc000384000?, 0xc000182020?, 0xc000702a80?})
/usr/local/go/src/net/fd_posix.go:55 +0x25
net.(*conn).Read(0xc000296028, {0xc000384000?, 0x12d4f00?, 0xc000702700?})
/usr/local/go/src/net/net.go:185 +0x45
net/http.(*persistConn).Read(0xc00036e7e0, {0xc000384000?, 0xc0000c0a80?, 0xc0003ffd38?})
/usr/local/go/src/net/http/transport.go:1977 +0x4a
bufio.(*Reader).fill(0xc000372300)
/usr/local/go/src/bufio/bufio.go:110 +0x103
bufio.(*Reader).Peek(0xc000372300, 0x1)
/usr/local/go/src/bufio/bufio.go:148 +0x53
net/http.(*persistConn).readLoop(0xc00036e7e0)
/usr/local/go/src/net/http/transport.go:2141 +0x1b9
created by net/http.(*Transport).dialConn in goroutine 24
/usr/local/go/src/net/http/transport.go:1799 +0x152f

goroutine 27 [select]:
net/http.(*persistConn).writeLoop(0xc00036e7e0)
/usr/local/go/src/net/http/transport.go:2458 +0xf0
created by net/http.(*Transport).dialConn in goroutine 24
/usr/local/go/src/net/http/transport.go:1800 +0x1585

goroutine 86 [IO wait]:
internal/poll.runtime_pollWait(0x7f9ab8dbc120, 0x72)
/usr/local/go/src/runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc000372660?, 0xc000178400?, 0x1)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc000372660, {0xc000178400, 0x400, 0x400})
/usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a
os.(*File).read(...)
/usr/local/go/src/os/file_posix.go:29
os.(*File).Read(0xc000094a80, {0xc000178400?, 0x1?, 0x41a798?})
/usr/local/go/src/os/file.go:118 +0x52
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStderr(0xc000939380)
/app/internal/core/plugin_manager/local_runtime/stdio_handle.go:147 +0x51
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin.func4()
/app/internal/core/plugin_manager/local_runtime/run.go:170 +0x50
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc00087ef60?})
/app/internal/utils/routine/pool.go:58 +0x34
runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc000734380?, 0x16178c8?, 0x138dc20?}}, 0xc0006fd700)
/usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1()
/app/internal/utils/routine/pool.go:56 +0x394
github.com/panjf2000/ants.(*goWorker).run.func1()
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d
created by github.com/panjf2000/ants.(*goWorker).run in goroutine 20
/go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c

goroutine 87 [syscall]:
syscall.Syscall6(0xe8, 0x16, 0xc000432000, 0x80, 0xffffffffffffffff, 0x0, 0x0)
/usr/local/go/src/syscall/syscall_linux.go:91 +0x39
golang.org/x/sys/unix.EpollWait(0x1820060?, {0xc000432000?, 0xc0006fde00?, 0xc0006fdf70?}, 0x8066f4?)
/go/pkg/mod/golang.org/x/sys@v0.28.0/unix/zsyscall_linux_amd64.go:55 +0x4f
github.com/panjf2000/gnet/v2/internal/netpoll.(*Poller).Polling(0xc0003728a0, 0xc0006fdf28)
/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/internal/netpoll/poller_epoll_default.go:120 +0x9d
github.com/panjf2000/gnet/v2.(*eventloop).orbit(0xc000734580)
/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/reactor_default.go:54 +0x97
golang.org/x/sync/errgroup.(*Group).Go.func1()
/go/pkg/mod/golang.org/x/sync@v0.10.0/errgroup/errgroup.go:78 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 41
/go/pkg/mod/golang.org/x/sync@v0.10.0/errgroup/errgroup.go:75 +0x96

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @David885L2 on GitHub (Mar 10, 2025). ### Self Checks - [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 (我已阅读并同意 [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. ### Dify version 1.0.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Batch uploading files to the knowledge base will result in errors [GIN] 2025/03/10 - 08:19:09 | 200 | 1.048124ms | 172.20.0.9 | POST "/plugin/8b9f3a8c-92b3-4dbb-a9e6-03500fcfab64/dispatch/text_embedding/num_tokens" fatal error: concurrent map iteration and map write goroutine 83 [running]: github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout.func1({0xc000bb0720, 0x24}, {0xc000730e28, 0x18, 0x18}) /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:100 +0x105 github.com/langgenius/dify-plugin-daemon/pkg/entities/plugin_entities.ParsePluginUniversalEvent({0xc0008be7a7, 0x67, 0x60?}, {0x0, 0x0}, 0xc00102dd38, 0xc00102dd20, 0xc00102dd10, 0xc00102dd00) /app/pkg/entities/plugin_entities/event.go:54 +0x515 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout(0xc0000cec30, 0x16713b8) /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:93 +0x273 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin.func3() /app/internal/core/plugin_manager/local_runtime/run.go:160 +0x57 github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc000258ba0?}) /app/internal/utils/routine/pool.go:58 +0x34 runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc00026a280?, 0x16178c8?, 0x138dc20?}}, 0xc000363f00) /usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1() /app/internal/utils/routine/pool.go:56 +0x394 github.com/panjf2000/ants.(*goWorker).run.func1() /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d created by github.com/panjf2000/ants.(*goWorker).run in goroutine 82 /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c goroutine 1 [select (no cases)]: github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc0001160d8, 0xc00091d608) /app/internal/server/server.go:82 +0x1d8 main.main() /app/cmd/server/main.go:28 +0xff goroutine 6 [chan receive]: github.com/panjf2000/ants.(*Pool).periodicallyPurge(0xc0000f2000) /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/pool.go:84 +0xc7 created by github.com/panjf2000/ants.NewPool in goroutine 1 /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/pool.go:163 +0x20c goroutine 13 [chan receive]: github.com/panjf2000/ants.(*Pool).periodicallyPurge(0xc0000f2510) /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/pool.go:84 +0xc7 created by github.com/panjf2000/ants.NewPool in goroutine 1 /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/pool.go:163 +0x20c goroutine 85 [IO wait]: internal/poll.runtime_pollWait(0x7f9ab92a4500, 0x72) /usr/local/go/src/runtime/netpoll.go:345 +0x85 internal/poll.(*pollDesc).wait(0xc0003725a0?, 0xc0005a20cc?, 0x1) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Read(0xc0003725a0, {0xc0005a20cc, 0x734, 0x734}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a os.(*File).read(...) /usr/local/go/src/os/file_posix.go:29 os.(*File).Read(0xc000094a70, {0xc0005a20cc?, 0x735?, 0xc000a8a000?}) /usr/local/go/src/os/file.go:118 +0x52 bufio.(*Scanner).Scan(0xc0007fdc70) /usr/local/go/src/bufio/scan.go:219 +0x81e github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout(0xc000939380, 0x16713b8) /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:86 +0x17f github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin.func3() /app/internal/core/plugin_manager/local_runtime/run.go:160 +0x57 github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc00087efc0?}) /app/internal/utils/routine/pool.go:58 +0x34 runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc000734480?, 0x16178c8?, 0x138dc20?}}, 0xc00002af00) /usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1() /app/internal/utils/routine/pool.go:56 +0x394 github.com/panjf2000/ants.(*goWorker).run.func1() /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d created by github.com/panjf2000/ants.(*goWorker).run in goroutine 20 /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c goroutine 49 [select]: database/sql.(*DB).connectionOpener(0xc0009388f0, {0x1820248, 0xc00027ecd0}) /usr/local/go/src/database/sql/sql.go:1246 +0x87 created by database/sql.OpenDB in goroutine 1 /usr/local/go/src/database/sql/sql.go:824 +0x14c goroutine 52 [select]: database/sql.(*DB).connectionCleaner(0xc0009388f0, 0x0?) /usr/local/go/src/database/sql/sql.go:1089 +0x9c created by database/sql.(*DB).startCleanerLocked in goroutine 1 /usr/local/go/src/database/sql/sql.go:1076 +0x105 goroutine 42 [chan receive]: github.com/langgenius/dify-plugin-daemon/internal/utils/stream.(*Stream[...]).Next(0xc00071c000) /app/internal/utils/stream/stream.go:74 +0x165 github.com/langgenius/dify-plugin-daemon/internal/utils/stream.(*Stream[...]).Async(0x1830b40, 0xc00071c000) /app/internal/utils/stream/stream.go:108 +0x3f github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/debugging_runtime.(*RemotePluginServer).Wrap(0x0?, 0x0?) /app/internal/core/plugin_manager/debugging_runtime/server.go:55 +0x25 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startRemoteWatcher.func2() /app/internal/core/plugin_manager/watcher.go:43 +0x6b created by github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startRemoteWatcher in goroutine 1 /app/internal/core/plugin_manager/watcher.go:42 +0x105 goroutine 84 [IO wait]: internal/poll.runtime_pollWait(0x7f9ab92a4120, 0x72) /usr/local/go/src/runtime/netpoll.go:345 +0x85 internal/poll.(*pollDesc).wait(0xc0002905a0?, 0xc0000d5c00?, 0x1) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Read(0xc0002905a0, {0xc0000d5c00, 0x400, 0x400}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a os.(*File).read(...) /usr/local/go/src/os/file_posix.go:29 os.(*File).Read(0xc0000948b8, {0xc0000d5c00?, 0x1?, 0x41a798?}) /usr/local/go/src/os/file.go:118 +0x52 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStderr(0xc0000cec30) /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:147 +0x51 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin.func4() /app/internal/core/plugin_manager/local_runtime/run.go:170 +0x50 github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc000143650?}) /app/internal/utils/routine/pool.go:58 +0x34 runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc00036a400?, 0x16178c8?, 0x138dc20?}}, 0xc0006fcf00) /usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1() /app/internal/utils/routine/pool.go:56 +0x394 github.com/panjf2000/ants.(*goWorker).run.func1() /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d created by github.com/panjf2000/ants.(*goWorker).run in goroutine 82 /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c goroutine 40 [chan receive]: github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startLocalWatcher.func1() /app/internal/core/plugin_manager/watcher.go:18 +0xd4 created by github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startLocalWatcher in goroutine 1 /app/internal/core/plugin_manager/watcher.go:15 +0x4f goroutine 82 [select]: github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).Wait(0xc0000cec30) /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:183 +0x1f4 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin(0xc0003dc708) /app/internal/core/plugin_manager/local_runtime/run.go:184 +0xdfc github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).fullDuplexLifecycle(0x1400040?, {0x1836100, 0xc0003dc708}, 0xc000188300, 0xc000188360) /app/internal/core/plugin_manager/runtime_lifetime.go:99 +0x571 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).launchLocal.func2() /app/internal/core/plugin_manager/launcher.go:186 +0x1a5 github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc000142ba0?}) /app/internal/utils/routine/pool.go:58 +0x34 runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc000290360?, 0x16178c8?, 0x138dc20?}}, 0xc0006fdf00) /usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1() /app/internal/utils/routine/pool.go:56 +0x394 github.com/panjf2000/ants.(*goWorker).run.func1() /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d created by github.com/panjf2000/ants.(*goWorker).run in goroutine 40 /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c goroutine 41 [chan receive]: github.com/panjf2000/gnet/v2.(*engine).stop(0xc0000f2630, {0xc0007eca10?}) /go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/engine_unix.go:208 +0x34 github.com/panjf2000/gnet/v2.run({0x1824958, 0xc0000b46c0}, {0xc000094ac0, 0x1, 0x2?}, 0xc0000f2360, {0xc00002ce90, 0x1, 0x44080e?}) /go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/engine_unix.go:306 +0x6b1 github.com/panjf2000/gnet/v2.Run({0x1824958, 0xc0000b46c0}, {0xc000730048, 0x12}, {0xc00002cf30?, 0x1820248?, 0xc000534230?}) /go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/gnet.go:551 +0x145 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/debugging_runtime.(*RemotePluginServer).Launch(0xc0000944b0) /app/internal/core/plugin_manager/debugging_runtime/server.go:80 +0x186 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startRemoteWatcher.func1() /app/internal/core/plugin_manager/watcher.go:37 +0x2a created by github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).startRemoteWatcher in goroutine 1 /app/internal/core/plugin_manager/watcher.go:36 +0xc5 goroutine 43 [select]: github.com/langgenius/dify-plugin-daemon/internal/cluster.(*Cluster).clusterLifetime(0xc000726000) /app/internal/cluster/cluster_lifetime.go:105 +0x3fc created by github.com/langgenius/dify-plugin-daemon/internal/cluster.(*Cluster).Launch in goroutine 1 /app/internal/cluster/cluster.go:97 +0x4f goroutine 44 [IO wait]: internal/poll.runtime_pollWait(0x7f9ab92a4db8, 0x72) /usr/local/go/src/runtime/netpoll.go:345 +0x85 internal/poll.(*pollDesc).wait(0xa?, 0x1?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Accept(0xc000734080) /usr/local/go/src/internal/poll/fd_unix.go:611 +0x2ac net.(*netFD).accept(0xc000734080) /usr/local/go/src/net/fd_unix.go:172 +0x29 net.(*TCPListener).accept(0xc000270700) /usr/local/go/src/net/tcpsock_posix.go:159 +0x1e net.(*TCPListener).Accept(0xc000270700) /usr/local/go/src/net/tcpsock.go:327 +0x30 net/http.(*Server).Serve(0xc00056a000, {0x181dc10, 0xc000270700}) /usr/local/go/src/net/http/server.go:3260 +0x33e net/http.(*Server).ListenAndServe(0xc00056a000) /usr/local/go/src/net/http/server.go:3189 +0x71 github.com/langgenius/dify-plugin-daemon/internal/server.(*App).server.func1() /app/internal/server/http_server.go:54 +0x1b created by github.com/langgenius/dify-plugin-daemon/internal/server.(*App).server in goroutine 1 /app/internal/server/http_server.go:53 +0x336 goroutine 20 [select]: github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).Wait(0xc000939380) /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:183 +0x1f4 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin(0xc000944008) /app/internal/core/plugin_manager/local_runtime/run.go:184 +0xdfc github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).fullDuplexLifecycle(0x1400040?, {0x1836100, 0xc000944008}, 0xc000542720, 0xc000542780) /app/internal/core/plugin_manager/runtime_lifetime.go:99 +0x571 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager.(*PluginManager).launchLocal.func2() /app/internal/core/plugin_manager/launcher.go:186 +0x1a5 github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc00087ed20?}) /app/internal/utils/routine/pool.go:58 +0x34 runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc000372420?, 0x16178c8?, 0x138dc20?}}, 0xc00035ef00) /usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1() /app/internal/utils/routine/pool.go:56 +0x394 github.com/panjf2000/ants.(*goWorker).run.func1() /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d created by github.com/panjf2000/ants.(*goWorker).run in goroutine 43 /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c goroutine 69 [IO wait]: internal/poll.runtime_pollWait(0x7f9ab92a49d8, 0x72) /usr/local/go/src/runtime/netpoll.go:345 +0x85 internal/poll.(*pollDesc).wait(0xc00026a180?, 0xc000030000?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Read(0xc00026a180, {0xc000030000, 0x1000, 0x1000}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a net.(*netFD).Read(0xc00026a180, {0xc000030000?, 0x87d865?, 0xc000503480?}) /usr/local/go/src/net/fd_posix.go:55 +0x25 net.(*conn).Read(0xc00011a060, {0xc000030000?, 0xc00002dcc0?, 0x410330?}) /usr/local/go/src/net/net.go:185 +0x45 bufio.(*Reader).fill(0xc0001eb2c0) /usr/local/go/src/bufio/bufio.go:110 +0x103 bufio.(*Reader).ReadSlice(0xc0001eb2c0, 0xa) /usr/local/go/src/bufio/bufio.go:376 +0x29 github.com/redis/go-redis/v9/internal/proto.(*Reader).readLine(0xc00011a068) /go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/internal/proto/reader.go:131 +0x2a github.com/redis/go-redis/v9/internal/proto.(*Reader).ReadLine(0xc00011a068) /go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/internal/proto/reader.go:96 +0x1c github.com/redis/go-redis/v9/internal/proto.(*Reader).ReadReply(0xc00011a068) /go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/internal/proto/reader.go:155 +0x1c github.com/redis/go-redis/v9.(*Cmd).readReply(...) /go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/command.go:481 github.com/redis/go-redis/v9.(*PubSub).ReceiveTimeout.func1(0xc0005343c0?) /go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/pubsub.go:436 +0x25 github.com/redis/go-redis/v9/internal/pool.(*Conn).WithReader(0xc0005343c0?, {0x1820060?, 0x22c9d60?}, 0xc00002def0?, 0xc00002def0?) /go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/internal/pool/conn.go:74 +0x66 github.com/redis/go-redis/v9.(*PubSub).ReceiveTimeout(0xc000060080, {0x1820060, 0x22c9d60}, 0x0) /go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/pubsub.go:435 +0xf6 github.com/redis/go-redis/v9.(*PubSub).Receive(0x181d400?, {0x1820060?, 0x22c9d60?}) /go/pkg/mod/github.com/redis/go-redis/v9@v9.5.3/pubsub.go:452 +0x1f github.com/langgenius/dify-plugin-daemon/internal/utils/cache.Subscribe[...].func1() /app/internal/utils/cache/redis.go:484 +0xdf created by github.com/langgenius/dify-plugin-daemon/internal/utils/cache.Subscribe[...] in goroutine 43 /app/internal/utils/cache/redis.go:478 +0xfd goroutine 56 [IO wait]: internal/poll.runtime_pollWait(0x7f9ab92a45f8, 0x72) /usr/local/go/src/runtime/netpoll.go:345 +0x85 internal/poll.(*pollDesc).wait(0xc000060200?, 0xc0002aa000?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Read(0xc000060200, {0xc0002aa000, 0x1000, 0x1000}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a net.(*netFD).Read(0xc000060200, {0xc0002aa000?, 0xc0002eba98?, 0x4f0725?}) /usr/local/go/src/net/fd_posix.go:55 +0x25 net.(*conn).Read(0xc00011a018, {0xc0002aa000?, 0x0?, 0xc0002ca0f8?}) /usr/local/go/src/net/net.go:185 +0x45 net/http.(*connReader).Read(0xc0002ca0f0, {0xc0002aa000, 0x1000, 0x1000}) /usr/local/go/src/net/http/server.go:789 +0x14b bufio.(*Reader).fill(0xc00028e120) /usr/local/go/src/bufio/bufio.go:110 +0x103 bufio.(*Reader).Peek(0xc00028e120, 0x4) /usr/local/go/src/bufio/bufio.go:148 +0x53 net/http.(*conn).serve(0xc000538090, {0x1820210, 0xc000227320}) /usr/local/go/src/net/http/server.go:2079 +0x749 created by net/http.(*Server).Serve in goroutine 44 /usr/local/go/src/net/http/server.go:3290 +0x4b4 goroutine 99 [IO wait]: internal/poll.runtime_pollWait(0x7f9ab92a48e0, 0x72) /usr/local/go/src/runtime/netpoll.go:345 +0x85 internal/poll.(*pollDesc).wait(0xc000734100?, 0xc000014000?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Read(0xc000734100, {0xc000014000, 0x1000, 0x1000}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a net.(*netFD).Read(0xc000734100, {0xc000014000?, 0x0?, 0xc000583180?}) /usr/local/go/src/net/fd_posix.go:55 +0x25 net.(*conn).Read(0xc000182028, {0xc000014000?, 0x0?, 0xc0005828c0?}) /usr/local/go/src/net/net.go:185 +0x45 net/http.(*persistConn).Read(0xc00075d560, {0xc000014000?, 0xc0006d4e40?, 0xc000360d38?}) /usr/local/go/src/net/http/transport.go:1977 +0x4a bufio.(*Reader).fill(0xc000114a80) /usr/local/go/src/bufio/bufio.go:110 +0x103 bufio.(*Reader).Peek(0xc000114a80, 0x1) /usr/local/go/src/bufio/bufio.go:148 +0x53 net/http.(*persistConn).readLoop(0xc00075d560) /usr/local/go/src/net/http/transport.go:2141 +0x1b9 created by net/http.(*Transport).dialConn in goroutine 97 /usr/local/go/src/net/http/transport.go:1799 +0x152f goroutine 48 [IO wait]: internal/poll.runtime_pollWait(0x7f9ab92a4ad0, 0x72) /usr/local/go/src/runtime/netpoll.go:345 +0x85 internal/poll.(*pollDesc).wait(0xc00036a600?, 0xc0002a4000?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Read(0xc00036a600, {0xc0002a4000, 0x1000, 0x1000}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a net.(*netFD).Read(0xc00036a600, {0xc0002a4000?, 0xc00001fa98?, 0x4f0725?}) /usr/local/go/src/net/fd_posix.go:55 +0x25 net.(*conn).Read(0xc000094758, {0xc0002a4000?, 0x0?, 0xc0000c8a58?}) /usr/local/go/src/net/net.go:185 +0x45 net/http.(*connReader).Read(0xc0000c8a50, {0xc0002a4000, 0x1000, 0x1000}) /usr/local/go/src/net/http/server.go:789 +0x14b bufio.(*Reader).fill(0xc00028e000) /usr/local/go/src/bufio/bufio.go:110 +0x103 bufio.(*Reader).Peek(0xc00028e000, 0x4) /usr/local/go/src/bufio/bufio.go:148 +0x53 net/http.(*conn).serve(0xc0006e8750, {0x1820210, 0xc000227320}) /usr/local/go/src/net/http/server.go:2079 +0x749 created by net/http.(*Server).Serve in goroutine 44 /usr/local/go/src/net/http/server.go:3290 +0x4b4 goroutine 100 [select]: net/http.(*persistConn).writeLoop(0xc00075d560) /usr/local/go/src/net/http/transport.go:2458 +0xf0 created by net/http.(*Transport).dialConn in goroutine 97 /usr/local/go/src/net/http/transport.go:1800 +0x1585 goroutine 26 [IO wait]: internal/poll.runtime_pollWait(0x7f9ab92a46f0, 0x72) /usr/local/go/src/runtime/netpoll.go:345 +0x85 internal/poll.(*pollDesc).wait(0xc00026a000?, 0xc000384000?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Read(0xc00026a000, {0xc000384000, 0x1000, 0x1000}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a net.(*netFD).Read(0xc00026a000, {0xc000384000?, 0xc000182020?, 0xc000702a80?}) /usr/local/go/src/net/fd_posix.go:55 +0x25 net.(*conn).Read(0xc000296028, {0xc000384000?, 0x12d4f00?, 0xc000702700?}) /usr/local/go/src/net/net.go:185 +0x45 net/http.(*persistConn).Read(0xc00036e7e0, {0xc000384000?, 0xc0000c0a80?, 0xc0003ffd38?}) /usr/local/go/src/net/http/transport.go:1977 +0x4a bufio.(*Reader).fill(0xc000372300) /usr/local/go/src/bufio/bufio.go:110 +0x103 bufio.(*Reader).Peek(0xc000372300, 0x1) /usr/local/go/src/bufio/bufio.go:148 +0x53 net/http.(*persistConn).readLoop(0xc00036e7e0) /usr/local/go/src/net/http/transport.go:2141 +0x1b9 created by net/http.(*Transport).dialConn in goroutine 24 /usr/local/go/src/net/http/transport.go:1799 +0x152f goroutine 27 [select]: net/http.(*persistConn).writeLoop(0xc00036e7e0) /usr/local/go/src/net/http/transport.go:2458 +0xf0 created by net/http.(*Transport).dialConn in goroutine 24 /usr/local/go/src/net/http/transport.go:1800 +0x1585 goroutine 86 [IO wait]: internal/poll.runtime_pollWait(0x7f9ab8dbc120, 0x72) /usr/local/go/src/runtime/netpoll.go:345 +0x85 internal/poll.(*pollDesc).wait(0xc000372660?, 0xc000178400?, 0x1) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Read(0xc000372660, {0xc000178400, 0x400, 0x400}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a os.(*File).read(...) /usr/local/go/src/os/file_posix.go:29 os.(*File).Read(0xc000094a80, {0xc000178400?, 0x1?, 0x41a798?}) /usr/local/go/src/os/file.go:118 +0x52 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStderr(0xc000939380) /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:147 +0x51 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin.func4() /app/internal/core/plugin_manager/local_runtime/run.go:170 +0x50 github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820210?, 0xc00087ef60?}) /app/internal/utils/routine/pool.go:58 +0x34 runtime/pprof.Do({0x1820060?, 0x22c9d60?}, {{0xc000734380?, 0x16178c8?, 0x138dc20?}}, 0xc0006fd700) /usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1() /app/internal/utils/routine/pool.go:56 +0x394 github.com/panjf2000/ants.(*goWorker).run.func1() /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d created by github.com/panjf2000/ants.(*goWorker).run in goroutine 20 /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c goroutine 87 [syscall]: syscall.Syscall6(0xe8, 0x16, 0xc000432000, 0x80, 0xffffffffffffffff, 0x0, 0x0) /usr/local/go/src/syscall/syscall_linux.go:91 +0x39 golang.org/x/sys/unix.EpollWait(0x1820060?, {0xc000432000?, 0xc0006fde00?, 0xc0006fdf70?}, 0x8066f4?) /go/pkg/mod/golang.org/x/sys@v0.28.0/unix/zsyscall_linux_amd64.go:55 +0x4f github.com/panjf2000/gnet/v2/internal/netpoll.(*Poller).Polling(0xc0003728a0, 0xc0006fdf28) /go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/internal/netpoll/poller_epoll_default.go:120 +0x9d github.com/panjf2000/gnet/v2.(*eventloop).orbit(0xc000734580) /go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/reactor_default.go:54 +0x97 golang.org/x/sync/errgroup.(*Group).Go.func1() /go/pkg/mod/golang.org/x/sync@v0.10.0/errgroup/errgroup.go:78 +0x56 created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 41 /go/pkg/mod/golang.org/x/sync@v0.10.0/errgroup/errgroup.go:75 +0x96 ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:43:22 -05:00
yindo closed this issue 2026-02-21 18:43:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#10153