infiniflow/ragflow · error · ConnectorValidationError

Unexpected Google Drive error (status={status_code}): {e}

Error message

Unexpected Google Drive error (status={status_code}): {e}

What it means

Error "Unexpected Google Drive error (status={status_code}): {e}" thrown in infiniflow/ragflow.

Source

Thrown at common/data_source/google_drive/connector.py:1137

            raise ConnectorValidationError("Primary admin email not found in credentials. Ensure DB_CREDENTIALS_PRIMARY_ADMIN_KEY is set.")

        try:
            drive_service = get_drive_service(self._creds, self._primary_admin_email)
            drive_service.files().list(pageSize=1, fields="files(id)").execute()

            if isinstance(self._creds, ServiceAccountCredentials):
                # default is ~17mins of retries, don't do that here since this is called from
                # the UI
                get_root_folder_id(drive_service)

        except HttpError as e:
            status_code = e.resp.status if e.resp else None
            if status_code == 401:
                raise CredentialExpiredError("Invalid or expired Google Drive credentials (401).")
            elif status_code == 403:
                raise InsufficientPermissionsError("Google Drive app lacks required permissions (403). Please ensure the necessary scopes are granted and Drive apps are enabled.")
            else:
                raise ConnectorValidationError(f"Unexpected Google Drive error (status={status_code}): {e}")

        except Exception as e:
            # Check for scope-related hints from the error message
            if MISSING_SCOPES_ERROR_STR in str(e):
                raise InsufficientPermissionsError("Google Drive credentials are missing required scopes.")
            raise ConnectorValidationError(f"Unexpected error during Google Drive validation: {e}")

    @override
    def build_dummy_checkpoint(self) -> GoogleDriveCheckpoint:
        return GoogleDriveCheckpoint(
            retrieved_folder_and_drive_ids=set(),
            completion_stage=DriveRetrievalStage.START,
            completion_map=ThreadSafeDict(),
            all_retrieved_file_ids=set(),
            has_more=True,
        )

    @override

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Inspect the status code and message from the Drive API for details.
  2. Retry with backoff for transient 5xx errors; fix quota issues for 429.

Example fix

# on 429/5xx: exponential backoff retry

When it happens

Trigger: Thrown at common/data_source/google_drive/connector.py:1137 when the library encounters an invalid state.

Common situations: The Drive API returns an unexpected status such as rate limiting or a server error; handling retries prevents this error.


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/e369db456b403630. Report an issue: GitHub.