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

[Bug]: When using the API to call RAgFlow, the error frequently occurs: ERROR: division by zero. #4622

Open
1 task done
ChenchunjieKK opened this issue Jan 24, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@ChenchunjieKK
Copy link

Is there an existing issue for the same bug?

  • I have checked the existing issues.

RAGFlow workspace code commit ID

0fd13b34d9ee11ef93aa0242ac140006

RAGFlow image version

V15.1

Other environment information

Actual behavior

When directly asking on the platform, there is an answer, but when using an external API, there is no answer.

Expected behavior

No response

Steps to reproduce

When directly asking on the platform, there is an answer, but when using an external API, there is no answer.

Additional information

No response

@ChenchunjieKK ChenchunjieKK added the bug Something isn't working label Jan 24, 2025
@KevinHuSh
Copy link
Collaborator

Which API?
And do you have backend error log?

@ChenchunjieKK
Copy link
Author

Below is the Docker error log.

2025-01-24 13:45:37,306 INFO 17 POST http://es01:9200/ragflow_6f16c442d88111ef901d0242ac140006/_search [status:200 duration:0.016s]
2025-01-24 13:45:37,380 INFO 17 POST http://es01:9200/ragflow_6f16c442d88111ef901d0242ac140006/_search [status:200 duration:0.013s]
2025-01-24 13:45:37,430 INFO 17 POST http://es01:9200/ragflow_6f16c442d88111ef901d0242ac140006/_search [status:200 duration:0.012s]
2025-01-24 13:45:37,899 ERROR 17 LLMBundle.similarity can't update token usage for 6f16c442d88111ef901d0242ac140006/RERANK used_tokens: 5132
2025-01-24 13:45:38,068 INFO 1771 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-01-24T13:45:38.068+08:00", "boot_at": "2025-01-23T11:11:23.679+08:00", "pending": 0, "lag": 0, "done": 2, "failed": 2, "current": null}
2025-01-24 13:46:07,307 ERROR 17
2025-01-24 13:46:08,099 INFO 1771 task_consumer_0 reported heartbeat: {"name": "task_consumer_0", "now": "2025-01-24T13:46:08.098+08:00", "boot_at": "2025-01-23T11:11:23.679+08:00", "pending": 0, "lag": 0, "done": 2, "failed": 2, "current": null}
2025-01-24 13:46:08,730 INFO 17 172.20.0.6 - - [24/Jan/2025 13:46:08] "POST /api/v1/chats/0fd13b34d9ee11ef93aa0242ac140006/completions HTTP/1.1" 200 -

Below is the information returned by calling the API using Postman.

{
"code": 0,
"data": {
"answer": "ERROR: \nERROR: division by zero",
"audio_binary": null,
"id": "795df3de-c99b-49d7-854a-186bfe77d0b8",
"prompt": "你是一个智能助手,请总结知识库的内容来回答问题,请列举知识库中的数据详细回答。当所有知识库内容都与问题无关时,你的回答必须包括“知识库中未找到您要的答案!”这句话。回答需要考虑聊天历史。\n 以下是知识库:\n
.......................
"dataset_id": "f48879fed97111ef85d70242ac140006",
"document_id": "1d0c5c6ad97211ef811f0242ac140006",
"document_name": "原子故障参数.xlsx",
"id": "df3d6c993de66acc",
"image_id": "",
"positions": []
}
],
"doc_aggs": [
{
"count": 2,
"doc_id": "1d0c5c6ad97211ef811f0242ac140006",
"doc_name": "原子故障参数.xlsx"
}
],
"total": 3
},
"session_id": "0ed33f8ad9f211ef873f0242ac140006"

@ChenchunjieKK
Copy link
Author

Some issues can output results when calling the API, while others return ERROR: \nERROR: division by zero.

@ChenchunjieKK
Copy link
Author

Through the debugging just now, I seem to have identified the cause. It appears that the returned text is too long. When displayed on the page, it shows something like:
"Scenario 1: Redis connection timeout... The response has been truncated due to its length. Would you like to continue?"
However, when calling through Postman, excessively long information returns ERROR: \nERROR: division by zero.

@KevinHuSh KevinHuSh mentioned this issue Jan 26, 2025
1 task
KevinHuSh added a commit that referenced this issue Jan 26, 2025
### What problem does this PR solve?
#4622

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
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

2 participants