{"record":{"id":"1b1dac44ece8036a","repo":"infiniflow/ragflow","slug":"dropbox-credential-is-invalid-e","errorCode":null,"errorMessage":"Dropbox credential is invalid: {e}","messagePattern":"Dropbox credential is invalid: (.+?)","errorType":"validation","errorClass":"ConnectorValidationError","httpStatus":null,"severity":"error","filePath":"common/data_source/dropbox_connector.py","lineNumber":49,"sourceCode":"    def load_credentials(self, credentials: dict[str, Any]) -> dict[str, Any] | None:\n        \"\"\"Load Dropbox credentials\"\"\"\n        access_token = credentials.get(\"dropbox_access_token\")\n        if not access_token:\n            raise ConnectorMissingCredentialError(\"Dropbox access token is required\")\n\n        self.dropbox_client = Dropbox(access_token)\n        return None\n\n    def validate_connector_settings(self) -> None:\n        \"\"\"Validate Dropbox connector settings\"\"\"\n        if self.dropbox_client is None:\n            raise ConnectorMissingCredentialError(\"Dropbox\")\n\n        try:\n            self.dropbox_client.files_list_folder(path=\"\", limit=1)\n        except AuthError as e:\n            logger.exception(\"[Dropbox]: Failed to validate Dropbox credentials\")\n            raise ConnectorValidationError(f\"Dropbox credential is invalid: {e}\")\n        except ApiError as e:\n            if e.error is not None and \"insufficient_permissions\" in str(e.error).lower():\n                raise InsufficientPermissionsError(\"Your Dropbox token does not have sufficient permissions.\")\n            raise ConnectorValidationError(f\"Unexpected Dropbox error during validation: {e.user_message_text or e}\")\n        except Exception as e:\n            raise ConnectorValidationError(f\"Unexpected error during Dropbox settings validation: {e}\")\n\n    def _download_file(self, path: str) -> bytes:\n        \"\"\"Download a single file from Dropbox.\"\"\"\n        if self.dropbox_client is None:\n            raise ConnectorMissingCredentialError(\"Dropbox\")\n        _, resp = self.dropbox_client.files_download(path)\n        return resp.content\n\n    def _get_shared_link(self, path: str) -> str:\n        \"\"\"Create a shared link for a file in Dropbox.\"\"\"\n        if self.dropbox_client is None:\n            raise ConnectorMissingCredentialError(\"Dropbox\")","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/dropbox_connector.py#L31-L67","documentation":"Raised by validate_connector_settings() when the files_list_folder(path='', limit=1) probe throws the Dropbox SDK's AuthError. AuthError specifically means Dropbox rejected the token itself (malformed, revoked, expired, or wrong app type) — distinct from permission or network errors. The full stack is logged under '[Dropbox]: Failed to validate Dropbox credentials'.","triggerScenarios":"Token revoked from the Dropbox security page; app deleted or access disabled; token truncated or containing whitespace; legacy long-lived token for an app no longer permitted.","commonSituations":"User revoked app access; token rotated in the App Console without updating the connector; copy-paste errors.","solutions":["Generate a fresh token in the Dropbox App Console and update the connector credential","Confirm the token is complete (Dropbox tokens are long; check for truncation/line breaks)","Re-authorize the app if the end user revoked it (OAuth re-consent flow)","Verify the token type matches the app (scoped access token with files.metadata.read scope)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    connector.validate_connector_settings()\nexcept ConnectorValidationError as e:\n    # AuthError path: token invalid/revoked — regenerate, do not retry\n    notify_user('Dropbox token rejected; generate a new one in the App Console')","preventionTips":["Rotate Dropbox tokens on a schedule and store them in a secret manager","After changing app scopes or regenerating tokens, update the connector credential immediately"],"tags":["dropbox","auth","validation","token"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}