"tool invoke error: 'Document' object has no attribute 'doc_metadat'" #8787

Closed
opened 2026-02-21 18:27:36 -05:00 by yindo · 4 comments
Owner

Originally created by @adolf2024 on GitHub (Feb 28, 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

First: I create an [Knowledge],and import some md files, the content in the md files is chinese,
Then: I create an [Agent], using the [Knowledge],I can see the Knowledge shows me the correct answer, But the result shows me {用户之前遇到了调用工具时出现的错误:“tool invoke error: 'Document' object has no attribute 'doc_metadat'”。现在要继续处理初始问题“放门口”。
首先分析错误原因。可能是数据集工具在检索过程中出现结构问题,或者返回的数据格式不符合预期。比如“doc_metadat”应该是“doc_metadata”拼写错误?或者文档对象的元数据字段缺失了所需的信息。需要检查该工具的配置或数据集结构是否有误。}
Third: I have searched the whole code in the dify version 1.0.0, I can't find doc_metadat parameters, can you help me to solved it?Or is it a bug in the new versions?

✔️ Expected Behavior

Help to solve the problem.

Actual Behavior

1 create a [Knowledge],using [High Quality], Embedding model using BAAI in [siliconflow], and [FULL Text Search] with [rerank],rerank using [BCE-Rerank] in [siliconflow],.
2 craete An Agent,using [siliconflow] deepseek R1.

Image Image
Originally created by @adolf2024 on GitHub (Feb 28, 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 First: I create an [Knowledge],and import some md files, the content in the md files is chinese, Then: I create an [Agent], using the [Knowledge],I can see the Knowledge shows me the correct answer, But the result shows me {用户之前遇到了调用工具时出现的错误:“tool invoke error: 'Document' object has no attribute 'doc_metadat'”。现在要继续处理初始问题“放门口”。 首先分析错误原因。可能是数据集工具在检索过程中出现结构问题,或者返回的数据格式不符合预期。比如“doc_metadat”应该是“doc_metadata”拼写错误?或者文档对象的元数据字段缺失了所需的信息。需要检查该工具的配置或数据集结构是否有误。} Third: I have searched the whole code in the dify version 1.0.0, I can't find doc_metadat parameters, can you help me to solved it?Or is it a bug in the new versions? ### ✔️ Expected Behavior Help to solve the problem. ### ❌ Actual Behavior 1 create a [Knowledge],using [High Quality], Embedding model using BAAI in [siliconflow], and [FULL Text Search] with [rerank],rerank using [BCE-Rerank] in [siliconflow],. 2 craete An Agent,using [siliconflow] deepseek R1. <img width="738" alt="Image" src="https://github.com/user-attachments/assets/142e8998-2387-486f-ada5-9d2b7839fa18" /> <img width="790" alt="Image" src="https://github.com/user-attachments/assets/3abb1f90-6ab3-42c5-9a8a-1e6d53b25dfc" />
yindo added the 🐞 bug label 2026-02-21 18:27:36 -05:00
yindo closed this issue 2026-02-21 18:27:36 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 28, 2025):

Hey there, @adolf2024! I'm here to assist you with bug fixes, answer your questions, and help you become a contributor. Let's tackle this issue together!

The error message you're encountering, "'Document' object has no attribute 'doc_metadat'", suggests a typo in the attribute name. The correct attribute name should be metadata, not doc_metadat. In the Dify codebase, the 'Document' object has the following attributes: page_content, vector, metadata, provider, and children [1].

To resolve this issue, you should check the part of your code or configuration where the 'Document' object is being accessed and ensure that you are using the correct attribute name metadata. If this error is occurring within a tool or plugin, you may need to update the tool's code to use the correct attribute name. If you have control over the code, correct the typo; otherwise, you might need to report this as a bug to the maintainers if it is part of the Dify codebase.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Feb 28, 2025): <!-- Greeting --> Hey there, @adolf2024! I'm here to assist you with bug fixes, answer your questions, and help you become a contributor. Let's tackle this issue together! <!-- Answer --> The error message you're encountering, "'Document' object has no attribute 'doc_metadat'", suggests a typo in the attribute name. The correct attribute name should be `metadata`, not `doc_metadat`. In the Dify codebase, the 'Document' object has the following attributes: `page_content`, `vector`, `metadata`, `provider`, and `children` <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/rag/models/document.py)</sup>. To resolve this issue, you should check the part of your code or configuration where the 'Document' object is being accessed and ensure that you are using the correct attribute name `metadata`. If this error is occurring within a tool or plugin, you may need to update the tool's code to use the correct attribute name. If you have control over the code, correct the typo; otherwise, you might need to report this as a bug to the maintainers if it is part of the Dify codebase. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/3cf47578-a961-4b6a-90d0-ca8d56fdcfee?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/3cf47578-a961-4b6a-90d0-ca8d56fdcfee?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/3cf47578-a961-4b6a-90d0-ca8d56fdcfee?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/3cf47578-a961-4b6a-90d0-ca8d56fdcfee?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3cf47578-a961-4b6a-90d0-ca8d56fdcfee?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/3cf47578-a961-4b6a-90d0-ca8d56fdcfee?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3cf47578-a961-4b6a-90d0-ca8d56fdcfee?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Mar 1, 2025):

Already fixed in @dosubot fix: typo doc_metadat (#14569)

@crazywoola commented on GitHub (Mar 1, 2025): Already fixed in @dosubot fix: typo `doc_metadat` (#14569)
Author
Owner

@dosubot[bot] commented on GitHub (Mar 3, 2025):

Hey @crazywoola! I'm just a bot here to help with bugs, technical questions, and engineering knowledge. It looks like you're mentioning a fix for a typo, which is awesome! If you think I should have more info on this, feel free to reach out to the Dosu Team. Keep up the great work! 😊

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 3, 2025): <!-- Answer --> Hey @crazywoola! I'm just a bot here to help with bugs, technical questions, and engineering knowledge. It looks like you're mentioning a fix for a typo, which is awesome! If you think I should have more info on this, feel free to reach out to the [Dosu Team](mailto:customersuccess@dosu.dev). Keep up the great work! 😊 <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/8394165c-6872-4e21-b889-2def22286ce7?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/8394165c-6872-4e21-b889-2def22286ce7?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/8394165c-6872-4e21-b889-2def22286ce7?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/8394165c-6872-4e21-b889-2def22286ce7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8394165c-6872-4e21-b889-2def22286ce7?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/8394165c-6872-4e21-b889-2def22286ce7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8394165c-6872-4e21-b889-2def22286ce7?feedback_type=other)</sup>
Author
Owner

@alfredzouang commented on GitHub (Mar 5, 2025):

Hi, I face the same issue here. I used docker compose to start my application, how can I fix this?

@alfredzouang commented on GitHub (Mar 5, 2025): Hi, I face the same issue here. I used docker compose to start my application, how can I fix this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8787