Create the knowledge failed #7215

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

Originally created by @yuuufeng on GitHub (Dec 16, 2024).

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

v0.10.2

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

New deployment and using Chinese. Knowledge -> Create Knowledge -> Import from file -> Next -> chunk Settings(Automatic),Index mode(High Quality)

✔️ Expected Behavior

Create the knowledge successfully

Actual Behavior

Create the knowledge failed
rules
traceback

Originally created by @yuuufeng on GitHub (Dec 16, 2024). ### 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 v0.10.2 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce New deployment and using Chinese. Knowledge -> Create Knowledge -> Import from file -> Next -> chunk Settings(Automatic),Index mode(High Quality) ### ✔️ Expected Behavior Create the knowledge successfully ### ❌ Actual Behavior Create the knowledge failed ![rules](https://github.com/user-attachments/assets/0358893c-d57d-4def-aa43-731233219aca) ![traceback](https://github.com/user-attachments/assets/ff2d43e7-fa8f-4223-957d-2a8c23fd20aa)
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 18:19:27 -05:00
yindo closed this issue 2026-02-21 18:19:27 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 16, 2024):

@yuuufeng Hello! I'm here to help you with any bugs, questions, or contributions. Let's work together to resolve your issue.

I found a similar open issue related to the error you're encountering. The issue involves a KeyError for the key 'rules' during the knowledge creation process in Dify. The error suggests a problem with how the rules are being retrieved or applied during the indexing process.

Here are some steps that were suggested to resolve the issue:

  1. Check the get_process_rules Method: Ensure that the rules variable is correctly retrieved in the get_process_rules method of the DatasetService class. This method should fetch the latest processing rules for a dataset or default to DocumentService.DEFAULT_RULES if none are found.

  2. Ensure Default Rules are Defined: Verify that the default rules in DocumentService are properly defined and accessible. These rules should include pre-processing rules and segmentation settings.

  3. Review the post Method in datasets.py: The error might occur during the execution of the indexing_runner.indexing_estimate method. Check the error handling block for IndexingEstimateError in the post method.

  4. Dependencies in Chunk Preview: Ensure that functions like setRules, getRules, getRulesFromDetail, and resetRules are correctly implemented and update the rules state properly.

By examining these areas, you might be able to identify and resolve the issue with the rules variable that is causing the error [1].

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Dec 16, 2024): <!-- Greeting --> @yuuufeng Hello! I'm here to help you with any bugs, questions, or contributions. Let's work together to resolve your issue. <!-- Answer --> I found a similar open issue related to the error you're encountering. The issue involves a `KeyError` for the key `'rules'` during the knowledge creation process in Dify. The error suggests a problem with how the `rules` are being retrieved or applied during the indexing process. Here are some steps that were suggested to resolve the issue: 1. **Check the `get_process_rules` Method**: Ensure that the `rules` variable is correctly retrieved in the `get_process_rules` method of the `DatasetService` class. This method should fetch the latest processing rules for a dataset or default to `DocumentService.DEFAULT_RULES` if none are found. 2. **Ensure Default Rules are Defined**: Verify that the default rules in `DocumentService` are properly defined and accessible. These rules should include pre-processing rules and segmentation settings. 3. **Review the `post` Method in `datasets.py`**: The error might occur during the execution of the `indexing_runner.indexing_estimate` method. Check the error handling block for `IndexingEstimateError` in the `post` method. 4. **Dependencies in Chunk Preview**: Ensure that functions like `setRules`, `getRules`, `getRulesFromDetail`, and `resetRules` are correctly implemented and update the `rules` state properly. By examining these areas, you might be able to identify and resolve the issue with the `rules` variable that is causing the error <sup>[[1]](https://github.com/langgenius/dify/issues/10204)</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/6af0f6c0-53f8-4391-b0e4-9f20e33d9e5d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/6af0f6c0-53f8-4391-b0e4-9f20e33d9e5d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/6af0f6c0-53f8-4391-b0e4-9f20e33d9e5d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/6af0f6c0-53f8-4391-b0e4-9f20e33d9e5d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6af0f6c0-53f8-4391-b0e4-9f20e33d9e5d?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/6af0f6c0-53f8-4391-b0e4-9f20e33d9e5d?feedback_type=other)</sup>
Author
Owner

@yihong0618 commented on GitHub (Dec 16, 2024):

can you offer your file(some data is enough) or the file ext?

@yihong0618 commented on GitHub (Dec 16, 2024): can you offer your file(some data is enough) or the file ext?
Author
Owner

@crazywoola commented on GitHub (Dec 16, 2024):

Please upgrade to latest version to see if this persists.

@crazywoola commented on GitHub (Dec 16, 2024): Please upgrade to latest version to see if this persists.
Author
Owner

@yuuufeng commented on GitHub (Dec 16, 2024):

can you offer your file(some data is enough) or the file ext?

just some test file such as .txt
456.txt

@yuuufeng commented on GitHub (Dec 16, 2024): > can you offer your file(some data is enough) or the file ext? just some test file such as .txt [456.txt](https://github.com/user-attachments/files/18147728/456.txt)
Author
Owner

@yuuufeng commented on GitHub (Dec 16, 2024):

Please upgrade to latest version to see if this persists.

I saw someone in discord had the same problem as me;
image
I looked at the latest version of the code and found that it had not been changed. I tried to change the code myself and then it worked.

@yuuufeng commented on GitHub (Dec 16, 2024): > Please upgrade to latest version to see if this persists. I saw someone in discord had the same problem as me; ![image](https://github.com/user-attachments/assets/4931a389-f514-407d-bef0-1bb9933b4d05) I looked at the latest version of the code and found that it had not been changed. I tried to change the code myself and then it worked.
Author
Owner

@crazywoola commented on GitHub (Dec 18, 2024):

Please feel free to open a pull request :)

@crazywoola commented on GitHub (Dec 18, 2024): Please feel free to open a pull request :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7215