From 347e9e0ab923f9ac20f137f5e0fc9fd857ec245a Mon Sep 17 00:00:00 2001 From: Weves Date: Mon, 14 Oct 2024 14:07:32 -0700 Subject: [PATCH 1/2] Fix file too large error --- backend/danswer/connectors/google_drive/connector.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/danswer/connectors/google_drive/connector.py b/backend/danswer/connectors/google_drive/connector.py index a50d632edb3..5098529f7d2 100644 --- a/backend/danswer/connectors/google_drive/connector.py +++ b/backend/danswer/connectors/google_drive/connector.py @@ -475,7 +475,14 @@ def _fetch_docs_from_drive( if e.error_details else e.reason ) - if e.status_code == 403 and reason == "cannotExportFile": + + # these errors don't represent a failure in the connector, but simply files + # that can't / shouldn't be indexed + ERRORS_TO_CONTINUE_ON = [ + "cannotExportFile", + "exportSizeLimitExceeded", + ] + if e.status_code == 403 and reason in ERRORS_TO_CONTINUE_ON: logger.warning( f"Could not export file '{file['name']}' due to '{message}', skipping..." ) From 5fc87d087f0c021727f97354e5802d671c84ce51 Mon Sep 17 00:00:00 2001 From: Weves Date: Mon, 14 Oct 2024 14:30:46 -0700 Subject: [PATCH 2/2] Add cannotDownloadFile --- backend/danswer/connectors/google_drive/connector.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/danswer/connectors/google_drive/connector.py b/backend/danswer/connectors/google_drive/connector.py index 5098529f7d2..9f8c6fbfda8 100644 --- a/backend/danswer/connectors/google_drive/connector.py +++ b/backend/danswer/connectors/google_drive/connector.py @@ -481,6 +481,7 @@ def _fetch_docs_from_drive( ERRORS_TO_CONTINUE_ON = [ "cannotExportFile", "exportSizeLimitExceeded", + "cannotDownloadFile", ] if e.status_code == 403 and reason in ERRORS_TO_CONTINUE_ON: logger.warning(