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

Out of range float values are not JSON compliant: nan #11792

Closed
5 tasks done
luoyutao03 opened this issue Dec 18, 2024 · 2 comments
Closed
5 tasks done

Out of range float values are not JSON compliant: nan #11792

luoyutao03 opened this issue Dec 18, 2024 · 2 comments
Labels
🐞 bug Something isn't working 🌚 invalid This doesn't seem right

Comments

@luoyutao03
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.13.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I encountered this error while uploading the document to the knowledge base:Out of range float values are not JSON compliant: nan

image
image

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

@dosubot dosubot bot added the 🐞 bug Something isn't working label Dec 18, 2024
Copy link

dosubot bot commented Dec 18, 2024

@luoyutao03 你好!我是Dosu,一个可以帮助你解决 bug、回答问题,并成为贡献者的机器人。我会在等待人类维护者的期间帮助你。

The error message "Out of range float values are not JSON compliant: nan" typically occurs when a JSON serialization process encounters a NaN (Not a Number) value, which is not supported by the JSON standard. This issue can arise during the document processing or indexing phase in Dify.

To address this issue, you can try the following steps:

  1. Check Document Content: Ensure that the document does not contain any invalid numerical values that could be interpreted as NaN. This might involve reviewing the document for any unusual data entries or calculations.

  2. Review Code for JSON Serialization: If you have access to the codebase, look for any parts of the code where float values are processed or converted to JSON. Ensure that these values are validated or converted to a JSON-compliant format before serialization.

  3. Error Handling: Implement error handling to catch and manage NaN values before they are serialized. This can involve setting default values or skipping problematic entries.

  4. Update Dependencies: Ensure that all dependencies and libraries used for JSON processing are up to date, as newer versions might handle such cases more gracefully.

If the issue persists, you might need to delve deeper into the specific part of the codebase where JSON serialization occurs, although the exact location of this logic in the Dify codebase is not specified in the available information.

To continue talking to Dosu, mention @dosu.


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

@crazywoola
Copy link
Member

Can you provide the container logs of the api and worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🌚 invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants