{"record":{"id":"63d14a4342bbf465","repo":"infiniflow/ragflow","slug":"google-drive-oauth-credentials-are-incomplete-ple","errorCode":null,"errorMessage":"Google Drive OAuth credentials are incomplete. Please finish the OAuth flow to generate access tokens.","messagePattern":"Google Drive OAuth credentials are incomplete\\. Please finish the OAuth flow to generate access tokens\\.","errorType":"exception","errorClass":"PermissionError","httpStatus":null,"severity":"error","filePath":"common/data_source/google_util/auth.py","lineNumber":70,"sourceCode":"    oauth_creds = None\n    service_creds = None\n    new_creds_dict = None\n    if DB_CREDENTIALS_DICT_TOKEN_KEY in credentials:\n        # OAUTH\n        authentication_method: str = credentials.get(\n            DB_CREDENTIALS_AUTHENTICATION_METHOD,\n            GoogleOAuthAuthenticationMethod.UPLOADED,\n        )\n\n        credentials_dict_str = credentials[DB_CREDENTIALS_DICT_TOKEN_KEY]\n        credentials_dict = json.loads(credentials_dict_str)\n\n        regenerated_from_client_secret = False\n        if \"client_id\" not in credentials_dict or \"client_secret\" not in credentials_dict or \"refresh_token\" not in credentials_dict:\n            try:\n                credentials_dict = ensure_oauth_token_dict(credentials_dict, source)\n            except Exception as exc:\n                raise PermissionError(\"Google Drive OAuth credentials are incomplete. Please finish the OAuth flow to generate access tokens.\") from exc\n            credentials_dict_str = json.dumps(credentials_dict)\n            regenerated_from_client_secret = True\n\n        # only send what get_google_oauth_creds needs\n        authorized_user_info = {}\n\n        # oauth_interactive is sanitized and needs credentials from the environment\n        if authentication_method == GoogleOAuthAuthenticationMethod.OAUTH_INTERACTIVE:\n            authorized_user_info[\"client_id\"] = OAUTH_GOOGLE_DRIVE_CLIENT_ID\n            authorized_user_info[\"client_secret\"] = OAUTH_GOOGLE_DRIVE_CLIENT_SECRET\n        else:\n            authorized_user_info[\"client_id\"] = credentials_dict[\"client_id\"]\n            authorized_user_info[\"client_secret\"] = credentials_dict[\"client_secret\"]\n\n        authorized_user_info[\"refresh_token\"] = credentials_dict[\"refresh_token\"]\n\n        authorized_user_info[\"token\"] = credentials_dict[\"token\"]\n        authorized_user_info[\"expiry\"] = credentials_dict[\"expiry\"]","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/google_util/auth.py#L52-L88","documentation":"Error \"Google Drive OAuth credentials are incomplete. Please finish the OAuth flow to generate access tokens.\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at common/data_source/google_util/auth.py:70 when the library encounters an invalid state.","commonSituations":"Only the OAuth client config is present but no user tokens; finishing the OAuth flow prevents this error.","solutions":["Complete the OAuth consent flow so access and refresh tokens are stored."],"exampleFix":"# open the OAuth URL, consent, and let the callback store tokens","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}