infiniflow/ragflow · error · ConnectorValidationError

Dropbox credential is invalid: {e}

Error message

Dropbox credential is invalid: {e}

What it means

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'.

Source

Thrown at common/data_source/dropbox_connector.py:49

    def load_credentials(self, credentials: dict[str, Any]) -> dict[str, Any] | None:
        """Load Dropbox credentials"""
        access_token = credentials.get("dropbox_access_token")
        if not access_token:
            raise ConnectorMissingCredentialError("Dropbox access token is required")

        self.dropbox_client = Dropbox(access_token)
        return None

    def validate_connector_settings(self) -> None:
        """Validate Dropbox connector settings"""
        if self.dropbox_client is None:
            raise ConnectorMissingCredentialError("Dropbox")

        try:
            self.dropbox_client.files_list_folder(path="", limit=1)
        except AuthError as e:
            logger.exception("[Dropbox]: Failed to validate Dropbox credentials")
            raise ConnectorValidationError(f"Dropbox credential is invalid: {e}")
        except ApiError as e:
            if e.error is not None and "insufficient_permissions" in str(e.error).lower():
                raise InsufficientPermissionsError("Your Dropbox token does not have sufficient permissions.")
            raise ConnectorValidationError(f"Unexpected Dropbox error during validation: {e.user_message_text or e}")
        except Exception as e:
            raise ConnectorValidationError(f"Unexpected error during Dropbox settings validation: {e}")

    def _download_file(self, path: str) -> bytes:
        """Download a single file from Dropbox."""
        if self.dropbox_client is None:
            raise ConnectorMissingCredentialError("Dropbox")
        _, resp = self.dropbox_client.files_download(path)
        return resp.content

    def _get_shared_link(self, path: str) -> str:
        """Create a shared link for a file in Dropbox."""
        if self.dropbox_client is None:
            raise ConnectorMissingCredentialError("Dropbox")

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Generate a fresh token in the Dropbox App Console and update the connector credential
  2. Confirm the token is complete (Dropbox tokens are long; check for truncation/line breaks)
  3. Re-authorize the app if the end user revoked it (OAuth re-consent flow)
  4. Verify the token type matches the app (scoped access token with files.metadata.read scope)
Defensive patterns

Strategy: try-catch

Try / catch

try:
    connector.validate_connector_settings()
except ConnectorValidationError as e:
    # AuthError path: token invalid/revoked — regenerate, do not retry
    notify_user('Dropbox token rejected; generate a new one in the App Console')

Prevention

When it happens

Trigger: 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.

Common situations: User revoked app access; token rotated in the App Console without updating the connector; copy-paste errors.

Related errors


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