From adbb8319e08e4b21eb2878a85e4fa6e2c53696e4 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Thu, 6 Nov 2025 09:49:57 +0800 Subject: [PATCH] Fix: add fields for logs. (#11039) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/db/services/connector_service.py | 1 + rag/svr/sync_data_source.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/db/services/connector_service.py b/api/db/services/connector_service.py index bc54dc34b..3e51289bf 100644 --- a/api/db/services/connector_service.py +++ b/api/db/services/connector_service.py @@ -81,6 +81,7 @@ class SyncLogsService(CommonService): cls.model.poll_range_end, cls.model.new_docs_indexed, cls.model.total_docs_indexed, + cls.model.error_msg, cls.model.full_exception_trace, cls.model.error_count, Connector.name, diff --git a/rag/svr/sync_data_source.py b/rag/svr/sync_data_source.py index 8d62d6db6..059155aca 100644 --- a/rag/svr/sync_data_source.py +++ b/rag/svr/sync_data_source.py @@ -89,7 +89,7 @@ class SyncBase: ''.join(traceback.format_exception_only(None, ex)).strip(), ''.join(traceback.format_exception(None, ex, ex.__traceback__)).strip() ]) - SyncLogsService.update_by_id(task["id"], {"status": TaskStatus.FAIL, "full_exception_trace": msg}) + SyncLogsService.update_by_id(task["id"], {"status": TaskStatus.FAIL, "full_exception_trace": msg, "error_msg": str(ex)}) SyncLogsService.schedule(task["connector_id"], task["kb_id"], task["poll_range_start"])