Normal Q&A is possible, but RAG cannot run #6770

Closed
opened 2026-02-21 18:17:13 -05:00 by yindo · 2 comments
Owner

Originally created by @bamhill on GitHub (Nov 14, 2024).

Originally assigned to: @JohnJyong 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

Version 0.9.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image
When the question involves the content in the knowledge base, it will report: 1 validation error for documentcontext score input should be a valid number [type=float_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.8/v/float_type

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @bamhill on GitHub (Nov 14, 2024). Originally assigned to: @JohnJyong 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 Version 0.9.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![image](https://github.com/user-attachments/assets/2b6704ab-a3dc-4b63-aa32-0d24cab4bdb1) When the question involves the content in the knowledge base, it will report: 1 validation error for documentcontext score input should be a valid number [type=float_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.8/v/float_type ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 👻 feat:rag label 2026-02-21 18:17:13 -05:00
yindo closed this issue 2026-02-21 18:17:13 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 14, 2024):

Hey @bamhill! I'm here to help you with bugs, questions, and becoming a contributor. Let's tackle this issue together while we wait for a human maintainer.

The error you're encountering, "1 validation error for documentcontext score input should be a valid number," suggests that the documentcontext score is expected to be a numerical value, but it is currently None. This can happen if the score is missing in the metadata when creating DocumentContext objects or if the index_node_id is not found in the document_score_list [1].

To resolve this issue, ensure that the score is correctly retrieved and assigned a valid numerical value in the metadata or document score list. You might need to check the data source or logic that populates these scores to ensure they are not missing or incorrectly set to None.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 14, 2024): <!-- Greeting --> Hey @bamhill! I'm here to help you with bugs, questions, and becoming a contributor. Let's tackle this issue together while we wait for a human maintainer. <!-- Answer --> The error you're encountering, "1 validation error for documentcontext score input should be a valid number," suggests that the `documentcontext score` is expected to be a numerical value, but it is currently `None`. This can happen if the score is missing in the metadata when creating `DocumentContext` objects or if the `index_node_id` is not found in the `document_score_list` <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/rag/retrieval/dataset_retrieval.py)</sup>. To resolve this issue, ensure that the score is correctly retrieved and assigned a valid numerical value in the metadata or document score list. You might need to check the data source or logic that populates these scores to ensure they are not missing or incorrectly set to `None`. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner
@crazywoola commented on GitHub (Nov 14, 2024): Duplicated - https://github.com/langgenius/dify/issues/9351 - https://github.com/langgenius/dify/issues/9208 - https://github.com/langgenius/dify/issues/8957 Fixed - https://github.com/langgenius/dify/pull/8342
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6770