"Knowledge" is not working: "tool invoke error: 'Document' object has no attribute 'doc_metadat'"
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [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
Cloud
Steps to reproduce
✔️ Expected Behavior
Get the knowledge content correctly
❌ Actual Behavior
throw "tool invoke error: 'Document' object has no attribute 'doc_metadat'"
@anthonylee1994 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'm a bot and I can assist you while we wait for a human maintainer.
The error you're encountering is due to a typo in the Dify 1.0.0 codebase, where the attribute 'doc_metadat' is incorrectly named and should be 'doc_metadata'. This issue has been addressed in a subsequent update. To resolve this error, you should update your Dify installation to the latest version that includes the fix from PR #14569 [1].
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
I can confirm this issue in Dify Cloud v1.0.0. When the AI agent invokes a tool, it throws this error: tool invoke error: 'Document' object has no attribute 'doc_metadat'
I am got a same issue.
Indeed, whether Cloud or Self Hosted, v1.0.0.
{"dataset_90a85ed8_e34f_4da2_a93d_a3d9168be041": "tool invoke error: 'Document' object has no attribute 'doc_metadat'"} metoo
+1
My Dify's version is 1.0.0 and run in Docker
This error is displayed when referencing the knowledge base
retest, brnach: main, This error still occurs
Should be fixed with #14569 but this hasn't been released yet.
The code has been fixed, but the image hasn't been updated yet. This is how I solved the problem.
- docker exec -it container /bin/bash
- fix the file /app/api/core/tools/utils/dataset_retriever/dataset_retriever_tool.py
- docker commit old_ container langgenius/dify-api:1.0.1
- change docker/docker-compose.yaml. and fix langgenius/dify-api:1.0.0 to langgenius/dify-api:1.0.1(your new images)
- docker compose up -d
- will ok
The code has been fixed, but the image hasn't been updated yet. This is how I solved the problem.
- docker exec -it container /bin/bash
- fix the file /app/api/core/tools/utils/dataset_retriever/dataset_retriever_tool.py
- docker commit old_ container langgenius/dify-api:1.0.1
- change docker/docker-compose.yaml. and fix langgenius/dify-api:1.0.0 to langgenius/dify-api:1.0.1(your new images)
- docker compose up -d
- will ok
Thank you~ A little more detail.
- docker exec -it your_container_name /bin/bash, replace your container name, mine is docker-api-1, you can by 'docker ps' command to check it
- fix the file at 175 line, you can use this command: sed -i '175c"doc_metadata": document.doc_metadata, # type:ignore' core/tools/utils/dataset_retriever/dataset_retriever_tool.py
- exit docker container
- docker commit your_container_name langgenius/dify-api:1.0.1
- edit your docker-compose.yaml file, replace all the dify-api version to 1.0.1
- docker compose up -d
Should be fixed with 1.0.1
Hi, @anthonylee1994. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.
Issue Summary:
- Reported bug in Dify version 1.0.0 when accessing "Knowledge" due to a typo.
- I suggested updating to the latest version with a fix from PR #14569.
- Multiple users confirmed the error; a workaround was provided by zhoudaqiang.
- perzeuss mentioned the fix should be in version 1.0.1, which is not yet released.
Next Steps:
- Please confirm if this issue is still relevant to the latest version of Dify. If so, you can keep the discussion open by commenting here.
- If there is no further activity, this issue will be automatically closed in 15 days.
Thank you for your understanding and contribution!