Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the knowledge failed #11691

Open
5 tasks done
yuuufeng opened this issue Dec 16, 2024 · 5 comments
Open
5 tasks done

Create the knowledge failed #11691

yuuufeng opened this issue Dec 16, 2024 · 5 comments
Labels
🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited

Comments

@yuuufeng
Copy link

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

Copy link

dosubot bot commented 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 dosubot bot added the 🐞 bug Something isn't working label Dec 16, 2024
@yihong0618
Copy link
Contributor

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

@crazywoola
Copy link
Member

Please upgrade to latest version to see if this persists.

@crazywoola crazywoola added the 🤔 cant-reproduce We can not reproduce it or the information is limited label Dec 16, 2024
@yuuufeng
Copy link
Author

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

just some test file such as .txt
456.txt

@yuuufeng
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited
Projects
None yet
Development

No branches or pull requests

3 participants