diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.py index a46c6051b4..ce41c2b28b 100644 --- a/rag/svr/task_executor.py +++ b/rag/svr/task_executor.py @@ -273,6 +273,8 @@ async def build_chunks(task, progress_callback): st = timer() bucket, name = File2DocumentService.get_storage_address(doc_id=task["doc_id"]) binary = await get_storage_binary(bucket, name) + if binary is None: + raise FileNotFoundError(f"File not found: storage returned no content for {bucket}/{name}.") logging.info("From minio({}) {}/{}".format(timer() - st, task["location"], task["name"])) except TimeoutError: progress_callback(-1, "Internal server error: Fetch file from minio timeout. Could you try it again.")