plugin Connection Fails After Upgrading Dify from 1.8.x to 1.9.1 #198

Closed
opened 2026-02-16 00:20:27 -05:00 by yindo · 3 comments
Owner

Originally created by @xinkuang on GitHub (Oct 14, 2025).

Issue Report

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (I have read and agree with the Language Policy).
  • [FOR CHINESE USERS] I understand that issues submitted in Chinese will be closed. Thank you! :)
  • Please do not modify this template :) and fill in all the required fields.

Versions

  1. dify-plugin-daemon Version: 0.4.5 (also tested with 0.5.0)
  2. dify-api Version: 1.9.1 (upgraded from 1.8.x)

Describe the bug

After upgrading Dify from version 1.8.x to 1.9.1, a previously working custom plugin can no longer establish a proper connection with the plugin daemon.

Inside the docker-plugin_daemon-1 container, running pip show dify_plugin returns:

Version: 0.4.5

Attempts to upgrade the plugin SDK from 0.4.5 to 0.5.0 result in the same error.

To Reproduce

  1. Upgrade Dify from 1.8.x to 1.9.1
  2. Start the plugin daemon container
  3. Launch a custom plugin that worked before the upgrade
  4. Observe connection errors in the logs

Expected behavior

The plugin should connect successfully to the daemon and operate as it did under Dify 1.8.x.

Logs

environment_python.go:363: [ERROR] failed to get the version of the plugin sdk: failed to find the version of the plugin sdk

INFO:dify_plugin.plugin:Installed agent: mcp_agent
ERROR:dify_plugin.core.server.tcp.request_reader:Failed to read data from localhost:5003
Traceback (most recent call last):
  File "D:\anaconda3\Lib\site-packages\dify_plugin\core\server\tcp\request_reader.py", line 169, in _read_stream
    raise Exception("Connection is closed")
Exception: Connection is closed

Additional context

  • The plugin functioned correctly under Dify 1.8.x.
  • The issue occurs immediately after upgrading to Dify 1.9.1.
  • Both dify-plugin-sdk versions 0.4.5 and 0.5.0 produce identical errors.
  • The error suggests the daemon fails to detect or communicate with the plugin SDK properly, possibly due to a compatibility or initialization issue introduced in 1.9.1.
Originally created by @xinkuang on GitHub (Oct 14, 2025). # Issue Report ## Self Checks - [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 (I have read and agree with the [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] I understand that issues submitted in Chinese will be closed. Thank you! :) - [x] Please do not modify this template :) and fill in all the required fields. ## Versions 1. **dify-plugin-daemon Version**: 0.4.5 (also tested with 0.5.0) 2. **dify-api Version**: 1.9.1 (upgraded from 1.8.x) ## Describe the bug After upgrading Dify from version 1.8.x to 1.9.1, a previously working custom plugin can no longer establish a proper connection with the plugin daemon. Inside the `docker-plugin_daemon-1` container, running `pip show dify_plugin` returns: ``` Version: 0.4.5 ``` Attempts to upgrade the plugin SDK from `0.4.5` to `0.5.0` result in the same error. ## To Reproduce 1. Upgrade Dify from 1.8.x to 1.9.1 2. Start the plugin daemon container 3. Launch a custom plugin that worked before the upgrade 4. Observe connection errors in the logs ## Expected behavior The plugin should connect successfully to the daemon and operate as it did under Dify 1.8.x. ## Logs ``` environment_python.go:363: [ERROR] failed to get the version of the plugin sdk: failed to find the version of the plugin sdk INFO:dify_plugin.plugin:Installed agent: mcp_agent ERROR:dify_plugin.core.server.tcp.request_reader:Failed to read data from localhost:5003 Traceback (most recent call last): File "D:\anaconda3\Lib\site-packages\dify_plugin\core\server\tcp\request_reader.py", line 169, in _read_stream raise Exception("Connection is closed") Exception: Connection is closed ``` ## Additional context - The plugin functioned correctly under Dify 1.8.x. - The issue occurs immediately after upgrading to Dify 1.9.1. - Both `dify-plugin-sdk` versions `0.4.5` and `0.5.0` produce identical errors. - The error suggests the daemon fails to detect or communicate with the plugin SDK properly, possibly due to a compatibility or initialization issue introduced in 1.9.1.
yindo closed this issue 2026-02-16 00:20:27 -05:00
Author
Owner

@xinkuang commented on GitHub (Oct 14, 2025):

[GIN] 2025/10/14 - 07:58:42 | 200 | 4.451189ms | 172.20.0.10 | POST "/plugin/7107438c-63b6-4ab5-915a-7bb15c27d6d6/dispatch/model/schema"

panic: Undefined validation function 'json_schema' on field 'OutputSchema'

github.com/go-playground/validator/v10.(*Validate).Struct(...)

/go/pkg/mod/github.com/go-playground/validator/v10@v10.22.0/validator_instance.go:368

github.com/langgenius/dify-plugin-daemon/internal/utils/parser.UnmarshalJsonBytes2Slice[...]({0xc002064000, 0xd61, 0xd80})

/app/internal/utils/parser/json.go:44 +0x1a5

github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/debugging_runtime.(*DifyServer).onMessage(0xc0005ea0c0, 0xc001ba9808, {0xc00204c3de?, 0xa?, 0xc00083e000?})

/app/internal/core/plugin_manager/debugging_runtime/hooks.go:414 +0x120a

github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/debugging_runtime.(*DifyServer).OnTraffic(0xc0005ea0c0, {0x29f6e08, 0xc001dd21c0})

/app/internal/core/plugin_manager/debugging_runtime/hooks.go:178 +0x150

github.com/panjf2000/gnet/v2.(*eventloop).read(0xc0002e4280, 0xc001dd21c0)

/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/eventloop_unix.go:144 +0x102

github.com/panjf2000/gnet/v2.(*conn).processIO(0xc001dd21c0, 0xc000a02600?, 0x1, 0x0?)

/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/connection_linux.go:54 +0xa5

github.com/panjf2000/gnet/v2.(*eventloop).orbit.func1(0xa, 0x1, 0x0)

/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/reactor_default.go:66 +0x1b6

github.com/panjf2000/gnet/v2/internal/netpoll.(*Poller).Polling(0xc0007ca360, 0xc004a0ff30)

/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/internal/netpoll/poller_epoll_default.go:136 +0x26c

github.com/panjf2000/gnet/v2.(*eventloop).orbit(0xc0002e4280)

/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/reactor_default.go:54 +0x91

golang.org/x/sync/errgroup.(*Group).Go.func1()

/go/pkg/mod/golang.org/x/sync@v0.16.0/errgroup/errgroup.go:93 +0x50

created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 38

/go/pkg/mod/golang.org/x/sync@v0.16.0/errgroup/errgroup.go:78 +0x96
@xinkuang commented on GitHub (Oct 14, 2025): [GIN] 2025/10/14 - 07:58:42 | 200 | 4.451189ms | 172.20.0.10 | POST "/plugin/7107438c-63b6-4ab5-915a-7bb15c27d6d6/dispatch/model/schema" **panic: Undefined validation function 'json_schema' on field 'OutputSchema'** github.com/go-playground/validator/v10.(*Validate).Struct(...) /go/pkg/mod/github.com/go-playground/validator/v10@v10.22.0/validator_instance.go:368 github.com/langgenius/dify-plugin-daemon/internal/utils/parser.UnmarshalJsonBytes2Slice[...]({0xc002064000, 0xd61, 0xd80}) /app/internal/utils/parser/json.go:44 +0x1a5 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/debugging_runtime.(*DifyServer).onMessage(0xc0005ea0c0, 0xc001ba9808, {0xc00204c3de?, 0xa?, 0xc00083e000?}) /app/internal/core/plugin_manager/debugging_runtime/hooks.go:414 +0x120a github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/debugging_runtime.(*DifyServer).OnTraffic(0xc0005ea0c0, {0x29f6e08, 0xc001dd21c0}) /app/internal/core/plugin_manager/debugging_runtime/hooks.go:178 +0x150 github.com/panjf2000/gnet/v2.(*eventloop).read(0xc0002e4280, 0xc001dd21c0) /go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/eventloop_unix.go:144 +0x102 github.com/panjf2000/gnet/v2.(*conn).processIO(0xc001dd21c0, 0xc000a02600?, 0x1, 0x0?) /go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/connection_linux.go:54 +0xa5 github.com/panjf2000/gnet/v2.(*eventloop).orbit.func1(0xa, 0x1, 0x0) /go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/reactor_default.go:66 +0x1b6 github.com/panjf2000/gnet/v2/internal/netpoll.(*Poller).Polling(0xc0007ca360, 0xc004a0ff30) /go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/internal/netpoll/poller_epoll_default.go:136 +0x26c github.com/panjf2000/gnet/v2.(*eventloop).orbit(0xc0002e4280) /go/pkg/mod/github.com/panjf2000/gnet/v2@v2.5.5/reactor_default.go:54 +0x91 golang.org/x/sync/errgroup.(*Group).Go.func1() /go/pkg/mod/golang.org/x/sync@v0.16.0/errgroup/errgroup.go:93 +0x50 created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 38 /go/pkg/mod/golang.org/x/sync@v0.16.0/errgroup/errgroup.go:78 +0x96
Author
Owner

@xinkuang commented on GitHub (Oct 14, 2025):

Downgrading to Dify 1.8.1, langgenius/dify-plugin-daemon:0.2.0-local, and dify_plugin==0.4.2 allows the plugin system to connect successfully. Please investigate the root cause of the issue accordingly. Thank you!

@xinkuang commented on GitHub (Oct 14, 2025): Downgrading to Dify 1.8.1, langgenius/dify-plugin-daemon:0.2.0-local, and dify_plugin==0.4.2 allows the plugin system to connect successfully. Please investigate the root cause of the issue accordingly. Thank you!
Author
Owner

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

Fixed by #460

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

No dependencies set.

Reference: langgenius/dify-plugin-daemon#198