installs Dify Agent 0.20 and 0.21 versions abnormally #473

Closed
opened 2026-02-16 10:19:30 -05:00 by yindo · 2 comments
Owner

Originally created by @yejiaaqi on GitHub (Jul 23, 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 Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.7.0

Plugin version

0.2.0、0.2.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Dify 1.7.0 installs Dify Agent 0.20 and 0.21 versions abnormally, downgrading to 0.9.0 is fine, no abnormality

✔️ Error log

plugin_daemon-1 | 2025/07/24 02:46:14 /app/internal/db/executor.go:259 record not found
plugin_daemon-1 | [0.194ms] [rows:0] SELECT * FROM "plugins" WHERE plugin_unique_identifier = 'langgenius/agent:0.0.19@3850c37e0f04f6ff6f00641fc36ed1d11555b0222470c37aa715218a4c5c95fd' ORDER BY "plugins"."id" LIMIT 1
plugin_daemon-1 | 2025/07/24 02:46:14 stdio.go:179: [ERROR]plugin langgenius/agent:0.0.20 has an error on stdout: read |0: file already closed
plugin_daemon-1 | 2025/07/24 02:46:14 run.go:135: [ERROR]plugin langgenius/agent:0.0.20 exited with error: signal: killed
plugin_daemon-1 | dify_plugin/core/utils/class_loader.py", line 34, in import_module_from_source
plugin_daemon-1 | raise e
plugin_daemon-1 | File "/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/.venv/lib/python3.12/site-packages/dify_plugin/core/utils/class_loader.py", line 31, in import_module_from_source
plugin_daemon-1 |
plugin_daemon-1 | spec.loader.exec_module(module)
plugin_daemon-1 |
plugin_daemon-1 | File "", line 995, in exec_module
plugin_daemon-1 | File "", line 488, in _call_with_frames_removed
plugin_daemon-1 |
plugin_daemon-1 | File "/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/strategies/function_calling.py", line 23, in
plugin_daemon-1 |
plugin_daemon-1 | from dify_plugin.entities.tool import LogMetadata, ToolInvokeMessage, ToolProviderType
plugin_daemon-1 |
plugin_daemon-1 | ImportError: cannot import name 'LogMetadata' from 'dify_plugin.entities.tool' (/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/.venv/lib/python3.12/site-packages/dify_plugin/entities/tool.py)
plugin_daemon-1 |

Originally created by @yejiaaqi on GitHub (Jul 23, 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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.7.0 ### Plugin version 0.2.0、0.2.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Dify 1.7.0 installs Dify Agent 0.20 and 0.21 versions abnormally, downgrading to 0.9.0 is fine, no abnormality ### ✔️ Error log plugin_daemon-1 | 2025/07/24 02:46:14 /app/internal/db/executor.go:259 record not found plugin_daemon-1 | [0.194ms] [rows:0] SELECT * FROM "plugins" WHERE plugin_unique_identifier = 'langgenius/agent:0.0.19@3850c37e0f04f6ff6f00641fc36ed1d11555b0222470c37aa715218a4c5c95fd' ORDER BY "plugins"."id" LIMIT 1 plugin_daemon-1 | 2025/07/24 02:46:14 stdio.go:179: [ERROR]plugin langgenius/agent:0.0.20 has an error on stdout: read |0: file already closed plugin_daemon-1 | 2025/07/24 02:46:14 run.go:135: [ERROR]plugin langgenius/agent:0.0.20 exited with error: signal: killed plugin_daemon-1 | dify_plugin/core/utils/class_loader.py", line 34, in import_module_from_source plugin_daemon-1 | raise e plugin_daemon-1 | File "/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/.venv/lib/python3.12/site-packages/dify_plugin/core/utils/class_loader.py", line 31, in import_module_from_source plugin_daemon-1 | plugin_daemon-1 | spec.loader.exec_module(module) plugin_daemon-1 | plugin_daemon-1 | File "<frozen importlib._bootstrap_external>", line 995, in exec_module plugin_daemon-1 | File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed plugin_daemon-1 | plugin_daemon-1 | File "/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/strategies/function_calling.py", line 23, in <module> plugin_daemon-1 | plugin_daemon-1 | from dify_plugin.entities.tool import LogMetadata, ToolInvokeMessage, ToolProviderType plugin_daemon-1 | plugin_daemon-1 | ImportError: cannot import name 'LogMetadata' from 'dify_plugin.entities.tool' (/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/.venv/lib/python3.12/site-packages/dify_plugin/entities/tool.py) plugin_daemon-1 |
yindo added the bug label 2026-02-16 10:19:30 -05:00
yindo closed this issue 2026-02-16 10:19:30 -05:00
Author
Owner

@wangtao commented on GitHub (Jul 24, 2025):

same here

@wangtao commented on GitHub (Jul 24, 2025): same here
Author
Owner

@litongyu55 commented on GitHub (Jul 24, 2025):

This appears to be an ImportError caused by a recent change in the Dify framework where the LogMetadata entity was moved. The traceback confirms it's trying to import LogMetadata from dify_plugin.entities.tool, but it is no longer located there.
Solution:
You need to update the import path for LogMetadata in the agent's strategy files. Specifically, please modify the following two files:

/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/strategies/function_calling.py
/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/strategies/ReAct.py

In both files, you need to change the import statements.

The old import might look something like this:

from dify_plugin.entities.tool import LogMetadata, ToolInvokeMessage, ToolProviderType

And replace it with the following two import statements:

from dify_plugin.entities.provider_config import LogMetadata
from dify_plugin.entities.tool import ToolInvokeMessage, ToolProviderType

In the file ReAct.py, find this import block:

from dify_plugin.entities.tool import (
LogMetadata,
ToolInvokeMessage,
ToolParameter,
ToolProviderType,
)

And replace it with the following two import statements:

from dify_plugin.entities.provider_config import LogMetadata
from dify_plugin.entities.tool import (
ToolInvokeMessage,
ToolParameter,
ToolProviderType,
)

This separates the import for LogMetadata and points it to the correct new location, which should resolve the error.
Finally, restart the container to apply changes.

@litongyu55 commented on GitHub (Jul 24, 2025): This appears to be an ImportError caused by a recent change in the Dify framework where the LogMetadata entity was moved. The traceback confirms it's trying to import LogMetadata from dify_plugin.entities.tool, but it is no longer located there. Solution: You need to update the import path for LogMetadata in the agent's strategy files. Specifically, please modify the following two files: /app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/strategies/function_calling.py /app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/strategies/ReAct.py In both files, you need to change the import statements. ### The old import might look something like this: from dify_plugin.entities.tool import LogMetadata, ToolInvokeMessage, ToolProviderType ### And replace it with the following two import statements: from dify_plugin.entities.provider_config import LogMetadata from dify_plugin.entities.tool import ToolInvokeMessage, ToolProviderType ### In the file ReAct.py, find this import block: from dify_plugin.entities.tool import ( LogMetadata, ToolInvokeMessage, ToolParameter, ToolProviderType, ) ### And replace it with the following two import statements: from dify_plugin.entities.provider_config import LogMetadata from dify_plugin.entities.tool import ( ToolInvokeMessage, ToolParameter, ToolProviderType, ) This separates the import for LogMetadata and points it to the correct new location, which should resolve the error. Finally, restart the container to apply changes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#473