infiniflow / ragflow

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding.
https://ragflow.io
Apache License 2.0
16.21k stars 1.65k forks source link

[Bug]: Assertion causes the program to terminate #916

Open jhualee opened 3 months ago

jhualee commented 3 months ago

Is there an existing issue for the same bug?

Branch name

main

Commit ID

c0d71adaa2c6c8d5b54d2ec5e4fe51ad0ea07c01

Other environment information

No response

Actual behavior

因为tasks = TaskService.get_tasks(msg["id"])返回空数组,导致assert tasks, "{} empty task!".format(msg["id"])抛出异常,程序终止 微信截图_20240524172611

Expected behavior

对抛出的断言异常进行捕获处理

Steps to reproduce

1、启动ragflow_server、task_executor、前端项目
2、在系统页面知识库->数据集中新增一个待解析文件,并点击执行按钮
3、在task_executor下的控制台中,提示报错

Additional information

/root/miniconda3/bin/conda run -n ragflow --no-capture-output python /mnt/e/work/shanghai_workspace/ai/ragflow/rag/svr/task_executor.py [WARNING] Load term.freq FAIL! [WARNING] [2024-05-24 17:25:31,492] [synonym.init] [line:24]: Realtime synonym is disabled, since no redis connection. Traceback (most recent call last): File "/mnt/e/work/shanghai_workspace/ai/ragflow/rag/svr/task_executor.py", line 375, in main() File "/mnt/e/work/shanghai_workspace/ai/ragflow/rag/svr/task_executor.py", line 294, in main rows = collect() ^^^^^^^^^ File "/mnt/e/work/shanghai_workspace/ai/ragflow/rag/svr/task_executor.py", line 117, in collect assert tasks, "{} empty task!".format(msg["id"]) AssertionError: 7fce51b819 ac11ef964e00155d0024f8 empty task! ERROR conda.cli.main_run:execute(124): conda run python /mnt/e/work/shan ghai_workspace/ai/ragflow/rag/svr/task_executor.py failed. (See above for error)

Snipaste_2024-05-24_17-34-57
KevinHuSh commented 3 months ago

This is caused by dirty data after restarting the system. Ignore that and the task_executor will restart itself. And cancel the task after restarting the server.