From 619b9717854160738e109a2a9169e898ffa36fb8 Mon Sep 17 00:00:00 2001 From: Wang Qi Date: Tue, 26 May 2026 12:28:53 +0800 Subject: [PATCH] Fix: empty file with better message (#15232) Fix: empty file with better message --- rag/svr/task_executor.py | 2 ++ 1 file changed, 2 insertions(+) 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.")