Knowledge base upload file error #12055

Closed
opened 2026-02-21 19:05:31 -05:00 by yindo · 8 comments
Owner

Originally created by @xuegao-tzx on GitHub (Mar 24, 2025).

Originally assigned to: @WTW0313 on GitHub.

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.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The second time uploading the file to the knowledge base, an error occurs

  1. First I create a knowledge base:

Image

  1. Click Save

Image

Image

  1. Upload the second

Image

Image

I found that Cloud is normal, but Self Hosted is abnormal

✔️ Expected Behavior

Fix this bug, previous versions 1.1.0 did not have this problem

Actual Behavior

Image
Originally created by @xuegao-tzx on GitHub (Mar 24, 2025). Originally assigned to: @WTW0313 on GitHub. ### 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.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The second time uploading the file to the knowledge base, an error occurs 1. First I create a knowledge base: ![Image](https://github.com/user-attachments/assets/60b716f3-ee2f-4c2f-9c03-482478225ccb) 2. Click Save ![Image](https://github.com/user-attachments/assets/fa48aef3-3ef7-4226-a9b8-3993d27a4327) ![Image](https://github.com/user-attachments/assets/160783a0-9005-48b0-bc02-e17195412292) 3. Upload the second ![Image](https://github.com/user-attachments/assets/c42dc2c1-a539-4dbe-8f44-f1fb457d263d) ![Image](https://github.com/user-attachments/assets/2cfa04c8-e2f1-45f4-9a27-5173d704de21) I found that Cloud is normal, but Self Hosted is abnormal ### ✔️ Expected Behavior Fix this bug, previous versions 1.1.0 did not have this problem ### ❌ Actual Behavior <img width="369" alt="Image" src="https://github.com/user-attachments/assets/4eede00e-a7be-4f1e-b2bc-a01be7420654" />
yindo added the 🐞 bug label 2026-02-21 19:05:31 -05:00
yindo closed this issue 2026-02-21 19:05:31 -05:00
Author
Owner

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

Hello @xuegao-tzx! I'm here to help you with any bugs, questions, or contributions you have for the project. Let me know how I can assist you!

To resolve the Pydantic validation error related to the weight_type field in KnowledgeConfig.retrieval_model.weights when uploading a file to the knowledge base in Dify version 1.1.3, you need to ensure that the weight_type field is included with the value customized in your weights configuration. This issue is similar to a known bug in Dify 1.1.2, where the weight_type field is required but missing. The correct structure should look like this:

"weights": {
    "weight_type": "customized",
    "vector_setting": {
        "vector_weight": 0.7,
        "embedding_provider_name": "",
        "embedding_model_name": ""
    },
    "keyword_setting": {
        "keyword_weight": 0.3
    }
}

If the issue persists, consider checking for updates or patches that might address this bug, as it was a known issue in previous versions [1][2].

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 24, 2025): <!-- Greeting --> Hello @xuegao-tzx! I'm here to help you with any bugs, questions, or contributions you have for the project. Let me know how I can assist you! <!-- Answer --> To resolve the Pydantic validation error related to the `weight_type` field in `KnowledgeConfig.retrieval_model.weights` when uploading a file to the knowledge base in Dify version 1.1.3, you need to ensure that the `weight_type` field is included with the value `customized` in your weights configuration. This issue is similar to a known bug in Dify 1.1.2, where the `weight_type` field is required but missing. The correct structure should look like this: ```json "weights": { "weight_type": "customized", "vector_setting": { "vector_weight": 0.7, "embedding_provider_name": "", "embedding_model_name": "" }, "keyword_setting": { "keyword_weight": 0.3 } } ``` If the issue persists, consider checking for updates or patches that might address this bug, as it was a known issue in previous versions <sup>[[1]](https://github.com/langgenius/dify-docs/issues/653)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/16619)</sup>. <!-- 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/45cf16de-a486-4c28-8b92-bc07a080e1b4?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/45cf16de-a486-4c28-8b92-bc07a080e1b4?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/45cf16de-a486-4c28-8b92-bc07a080e1b4?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/45cf16de-a486-4c28-8b92-bc07a080e1b4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/45cf16de-a486-4c28-8b92-bc07a080e1b4?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/45cf16de-a486-4c28-8b92-bc07a080e1b4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/45cf16de-a486-4c28-8b92-bc07a080e1b4?feedback_type=other)</sup>
Author
Owner

@WTW0313 commented on GitHub (Mar 24, 2025):

Hello, @xuegao-tzx. I can't reproduce this issue right now. Could you please provide your steps to reproduce this issue in detail. Screenshots of each step you create the dataset and upload new file will be helpful.

@WTW0313 commented on GitHub (Mar 24, 2025): Hello, @xuegao-tzx. I can't reproduce this issue right now. Could you please provide your steps to reproduce this issue in detail. Screenshots of each step you create the dataset and upload new file will be helpful.
Author
Owner

@xuegao-tzx commented on GitHub (Mar 24, 2025):

Hello, @xuegao-tzx. I can't reproduce this issue right now. Could you please provide your steps to reproduce this issue in detail. Screenshots of each step you create the dataset and upload new file will be helpful.

Already updated

@xuegao-tzx commented on GitHub (Mar 24, 2025): > Hello, [@xuegao-tzx](https://github.com/xuegao-tzx). I can't reproduce this issue right now. Could you please provide your steps to reproduce this issue in detail. Screenshots of each step you create the dataset and upload new file will be helpful. Already updated
Author
Owner

@dandan1232 commented on GitHub (Mar 24, 2025):

After updating to version 1.1.3 today, I encountered the same issue when uploading documents. Then, I tried deleting the old knowledge base and re-uploading the files, which worked successfully. You can give it a try!

@dandan1232 commented on GitHub (Mar 24, 2025): After updating to version 1.1.3 today, I encountered the same issue when uploading documents. Then, I tried deleting the old knowledge base and re-uploading the files, which worked successfully. You can give it a try!
Author
Owner

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

After updating to version 1.1.3 today, I encountered the same issue when uploading documents. Then, I tried deleting the old knowledge base and re-uploading the files, which worked successfully. You can give it a try!

@xuegao-tzx This should be able to solve the problem.

The old data loses it's integrity of the weight_type , it's broken and can not be used any longer.

@crazywoola commented on GitHub (Mar 24, 2025): > After updating to version 1.1.3 today, I encountered the same issue when uploading documents. Then, I tried deleting the old knowledge base and re-uploading the files, which worked successfully. You can give it a try! @xuegao-tzx This should be able to solve the problem. The old data loses it's integrity of the `weight_type `, it's broken and can not be used any longer.
Author
Owner

@xuegao-tzx commented on GitHub (Mar 24, 2025):

After updating to version 1.1.3 today, I encountered the same issue when uploading documents. Then, I tried deleting the old knowledge base and re-uploading the files, which worked successfully. You can give it a try!

@xuegao-tzx This should be able to solve the problem.

The old data loses it's integrity of the weight_type , it's broken and can not be used any longer.

Is there any other method? I have a lot of existing knowledge base data.

@xuegao-tzx commented on GitHub (Mar 24, 2025): > > After updating to version 1.1.3 today, I encountered the same issue when uploading documents. Then, I tried deleting the old knowledge base and re-uploading the files, which worked successfully. You can give it a try! > > [@xuegao-tzx](https://github.com/xuegao-tzx) This should be able to solve the problem. > > The old data loses it's integrity of the `weight_type `, it's broken and can not be used any longer. Is there any other method? I have a lot of existing knowledge base data.
Author
Owner

@xuegao-tzx commented on GitHub (Mar 24, 2025):

After updating to version 1.1.3 today, I encountered the same issue when uploading documents. Then, I tried deleting the old knowledge base and re-uploading the files, which worked successfully. You can give it a try!

Is there any other method? I have a lot of existing knowledge base data.

@xuegao-tzx commented on GitHub (Mar 24, 2025): > After updating to version 1.1.3 today, I encountered the same issue when uploading documents. Then, I tried deleting the old knowledge base and re-uploading the files, which worked successfully. You can give it a try! Is there any other method? I have a lot of existing knowledge base data.
Author
Owner

@WTW0313 commented on GitHub (Mar 25, 2025):

After updating to version 1.1.3 today, I encountered the same issue when uploading documents. Then, I tried deleting the old knowledge base and re-uploading the files, which worked successfully. You can give it a try!

Is there any other method? I have a lot of existing knowledge base data.

Sorry, it seems the only way to avoid this error currently. We are working on a better solution, which is compatible with old data.

@WTW0313 commented on GitHub (Mar 25, 2025): > > After updating to version 1.1.3 today, I encountered the same issue when uploading documents. Then, I tried deleting the old knowledge base and re-uploading the files, which worked successfully. You can give it a try! > > Is there any other method? I have a lot of existing knowledge base data. Sorry, it seems the only way to avoid this error currently. We are working on a better solution, which is compatible with old data.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12055