Fail to update doc_metadata for document when the doc_type is set to "others" #9439

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

Originally created by @Mgmg1 on GitHub (Mar 5, 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

  1. create a document with the doc_type of "others" and some doc_metadata (such as " { test : true}" )
  2. query the metadata of this document and find that the doc_metadata is set to "{ test : true}".
  3. using the api update-by-text at service-api module, update this document with the doc_type of "others" and some doc_metadata (such as " { test : true}" )
  4. query the metadata of this document, find that the doc_metadata is set to the value of "others"

I think the problem is caused by the code shown below

Image

✔️ Expected Behavior

the value of doc_metadata can be updated correctly

Actual Behavior

Image

Originally created by @Mgmg1 on GitHub (Mar 5, 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 1. create a document with the doc_type of "others" and some doc_metadata (such as " { test : true}" ) 2. query the metadata of this document and find that the doc_metadata is set to "{ test : true}". 3. using the api update-by-text at service-api module, update this document with the doc_type of "others" and some doc_metadata (such as " { test : true}" ) 4. query the metadata of this document, find that the doc_metadata is set to the value of "others" **I think the problem is caused by the code shown below** ![Image](https://github.com/user-attachments/assets/5043916e-5507-418a-87f2-e0ae368f7d96) ### ✔️ Expected Behavior the value of doc_metadata can be updated correctly ### ❌ Actual Behavior ![Image](https://github.com/user-attachments/assets/7e264162-bd2e-4d4b-a4f2-4724ea0bdce8)
yindo added the 🐞 buggood first issue labels 2026-02-21 18:34:44 -05:00
yindo closed this issue 2026-02-21 18:34:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#9439