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

Error When Creating Knowledge: "rules" Error Prevents Chunk Preview #10204

Closed
5 tasks done
MitraSafarinejad opened this issue Nov 2, 2024 · 3 comments
Closed
5 tasks done
Assignees
Labels
🐞 bug Something isn't working

Comments

@MitraSafarinejad
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

0.10.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I am encountering an issue with Dify version 0.10.2 when attempting to create Knowledge. After uploading a file, I receive an error message indicating a "rules" error. Despite the error, the file upload completes successfully. However, the chunk preview does not display as expected. Here are the details of the error:

image

Error Message:
[{"code": "indexing_estimate_error", "message": "'rules'", "status": 500}]

The relevant logs are:

Traceback (most recent call last):
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
api-1         |     rv = self.dispatch_request()
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
api-1         |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/flask_restful/__init__.py", line 489, in wrapper
api-1         |     resp = resource(*args, **kwargs)
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/flask/views.py", line 110, in view
api-1         |     return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/flask_restful/__init__.py", line 604, in dispatch_request
api-1         |     resp = meth(*args, **kwargs)
api-1         |   File "/app/api/controllers/console/wraps.py", line 142, in decorated
api-1         |     return view(*args, **kwargs)
api-1         |   File "/app/api/libs/login.py", line 92, in decorated_view
api-1         |     return current_app.ensure_sync(func)(*args, **kwargs)
api-1         |   File "/app/api/controllers/console/wraps.py", line 26, in decorated
api-1         |     return view(*args, **kwargs)
api-1         |   File "/app/api/controllers/console/datasets/datasets.py", line 464, in post
api-1         |     raise IndexingEstimateError(str(e))
api-1         | controllers.console.datasets.error.IndexingEstimateError: 500 Internal Server Error: 'rules'

✔️ Expected Behavior

After uploading a file, the system should successfully complete the process and display the chunk preview without any errors.

❌ Actual Behavior

While the file is uploaded successfully, an error message related to "rules" appears, and the chunk preview is not displayed as it should be

Copy link

dosubot bot commented Nov 2, 2024

The error you're encountering seems to be related to the handling of the rules variable during the knowledge creation process in Dify. The error message IndexingEstimateError with the message 'rules' suggests that there might be an issue with how the rules are being retrieved or applied during the indexing process.

Here are a few things to consider:

  1. Check the get_process_rules Method: The rules variable is defined in the get_process_rules method of the DatasetService class. This method retrieves the latest processing rules for a given dataset. If no specific rules are found, it defaults to the rules defined in DocumentService.DEFAULT_RULES [1].

  2. Ensure Default Rules are Defined: Make sure that the default rules in DocumentService are correctly defined and accessible. The default rules should include pre-processing rules and segmentation settings.

  3. Review the post Method in datasets.py: The post method in datasets.py is responsible for handling the indexing process. The error handling block for IndexingEstimateError suggests that the error might be occurring during the execution of the indexing_runner.indexing_estimate method [2].

  4. Dependencies in Chunk Preview: The rules variable is used in the chunk preview functionality to manage pre-processing rules. Ensure that the functions setRules, getRules, getRulesFromDetail, and resetRules are correctly implemented and that they properly update the rules state [3].

By checking these areas, you might be able to identify where the issue with the rules variable is occurring and resolve the error preventing the chunk preview from displaying.

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the 🐞 bug Something isn't working label Nov 2, 2024
@soulzzz
Copy link

soulzzz commented Nov 6, 2024

i got the same issue happened

@JohnJyong
Copy link
Contributor

fixed by #10258

@dosubot dosubot bot mentioned this issue Dec 16, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants