infiniflow/ragflow · error · ConnectorMissingCredentialError

Dropbox access token is required

Error message

Dropbox access token is required

What it means

Raised by DropboxConnector.load_credentials() when credentials lacks a truthy 'dropbox_access_token'. Fail-fast guard before the Dropbox SDK client is constructed, so no client exists in a half-initialized state.

Source

Thrown at common/data_source/dropbox_connector.py:35

from common.data_source.interfaces import LoadConnector, PollConnector, SecondsSinceUnixEpoch, SlimConnectorWithPermSync
from common.data_source.models import Document, GenerateDocumentsOutput, GenerateSlimDocumentOutput, SlimDocument
from common.data_source.utils import get_file_ext

logger = logging.getLogger(__name__)


class DropboxConnector(LoadConnector, PollConnector, SlimConnectorWithPermSync):
    """Dropbox connector for accessing Dropbox files and folders"""

    def __init__(self, batch_size: int = INDEX_BATCH_SIZE) -> None:
        self.batch_size = batch_size
        self.dropbox_client: Dropbox | None = None

    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}")

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Pass credentials={'dropbox_access_token': '<token>'} with the exact key
  2. Generate a token in the Dropbox App Console (scoped access app) with files.content.read and sharing permissions
  3. Add a non-empty check in the caller so users get a form-level error instead of a connector exception

Example fix

// before
connector.load_credentials({'access_token': t})  # raises

// after
connector.load_credentials({'dropbox_access_token': t})
Defensive patterns

Strategy: validation

Validate before calling

if not credentials.get('dropbox_access_token'):
    raise ValueError('credentials must include a non-empty dropbox_access_token')

Prevention

When it happens

Trigger: Credential payload missing the key, empty string, or wrong key name ('access_token' vs 'dropbox_access_token').

Common situations: Form field left blank; automation templating the credentials dict; token key renamed between versions of a pipeline script.

Related errors


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