{"record":{"id":"67f21b44776a2cdc","repo":"infiniflow/ragflow","slug":"dropbox-access-token-is-required","errorCode":null,"errorMessage":"Dropbox access token is required","messagePattern":"Dropbox access token is required","errorType":"validation","errorClass":"ConnectorMissingCredentialError","httpStatus":null,"severity":"error","filePath":"common/data_source/dropbox_connector.py","lineNumber":35,"sourceCode":"from common.data_source.interfaces import LoadConnector, PollConnector, SecondsSinceUnixEpoch, SlimConnectorWithPermSync\nfrom common.data_source.models import Document, GenerateDocumentsOutput, GenerateSlimDocumentOutput, SlimDocument\nfrom common.data_source.utils import get_file_ext\n\nlogger = logging.getLogger(__name__)\n\n\nclass DropboxConnector(LoadConnector, PollConnector, SlimConnectorWithPermSync):\n    \"\"\"Dropbox connector for accessing Dropbox files and folders\"\"\"\n\n    def __init__(self, batch_size: int = INDEX_BATCH_SIZE) -> None:\n        self.batch_size = batch_size\n        self.dropbox_client: Dropbox | None = None\n\n    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}\")","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/dropbox_connector.py#L17-L53","documentation":"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.","triggerScenarios":"Credential payload missing the key, empty string, or wrong key name ('access_token' vs 'dropbox_access_token').","commonSituations":"Form field left blank; automation templating the credentials dict; token key renamed between versions of a pipeline script.","solutions":["Pass credentials={'dropbox_access_token': '<token>'} with the exact key","Generate a token in the Dropbox App Console (scoped access app) with files.content.read and sharing permissions","Add a non-empty check in the caller so users get a form-level error instead of a connector exception"],"exampleFix":"// before\nconnector.load_credentials({'access_token': t})  # raises\n\n// after\nconnector.load_credentials({'dropbox_access_token': t})","handlingStrategy":"validation","validationCode":"if not credentials.get('dropbox_access_token'):\n    raise ValueError('credentials must include a non-empty dropbox_access_token')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the exact key 'dropbox_access_token'","Create scoped-access tokens in the App Console with files.metadata.read, files.content.read, sharing.read"],"tags":["dropbox","credentials","validation"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}