fix: Google Drive sign-in fails a form run when Google is unreachable
Merged
EV
1d ago+130+130+012345678901234567890123456789-5-5-0123456789
Description
Google Drive sign-in now follows the shared sign-in rule: on a form run (a draft run or a pair dry run), it fails when Google is unreachable or times out. Stored and scheduled runs keep it Incomplete, so a slow Google never holds indexing.
_GoogleDriveCheckacceptsfails_when_unreachable, andgoogle_drive_authsets it.- New
GOOGLE_CONNECTION_ERRORSandis_google_timeout()insource_operations.py. They cover google-authTransportError,httplib2.ServerNotFoundError, requests connection and timeout errors, and the built-inConnectionErrorandTimeoutError. _google_errorsmaps these errors toTimedOutValidationErrororUnreachableValidationErrorwith the design's rows: "Cannot reach Google Drive" and "Sign-in timed out" for sign-in, "Timed out" for other checks.- The gateway still raises the raw errors, because indexing's retries (
is_transient_google_error) expect them.
Known gap: an OAuth account's token refresh (get_google_oauth_creds) swallows network errors, so an unreachable Google still reads "Google no longer accepts the account" for OAuth. The fix also touches Gmail and two server endpoints, so it belongs in its own PR.
How Has This Been Tested?
- Unit tests:
- An unreachable Google (three error types) gives FAILED on a form run and INCOMPLETE on a stored run, with kind
unreachable. - A sign-in timeout gives FAILED on a form run and "Sign-in timed out".
- A timeout in a later check stays INCOMPLETE.
- An unreachable Google (three error types) gives FAILED on a form run and INCOMPLETE on a stored run, with kind
- Connector, server and EE unit suites pass at this tip.
Additional Options
- [Optional] Please cherry-pick this PR to the latest release version.
- [Optional] Override Linear Check
🤖 Generated with Claude Code
Summary by cubic
Google Drive sign-in now fails a form run when Google is unreachable or times out, matching the other sign-in checks. Stored and scheduled runs keep the check Incomplete, so a slow Google never holds indexing.
source_operations.pygainsGOOGLE_CONNECTION_ERRORSandis_google_timeout()to classify google-authTransportError,httplib2.ServerNotFoundError, requests connection and timeout errors, and built-inConnectionError/TimeoutError, including wrapped causes._google_errorsmaps them toUnreachableValidationErrororTimedOutValidationError; a timeout in a later check stays Incomplete, andgoogle_drive_authsetsfails_when_unreachable.- The gateway still raises the raw errors because indexing's retries expect them. Known gap: OAuth token refresh swallows network errors, so an unreachable Google still reads "Google no longer accepts the account"; that fix touches Gmail and server endpoints and belongs in its own PR.
Summary by CodeRabbit
- Bug Fixes
- Improved Google Drive connection validation by distinguishing unreachable services from request timeouts.
- Google Drive authentication and file-listing checks now show clearer error statuses and messages.
- Form-based checks report connection failures as failed when appropriate, while saved connection checks preserve incomplete status for retryable issues.
- Shared-drive request timeouts remain marked incomplete during form validation, helping users retry without treating the configuration as permanently invalid.