{"record":{"id":"1272eef6fe90f490","repo":"infiniflow/ragflow","slug":"your-dropbox-token-does-not-have-sufficient-permis","errorCode":null,"errorMessage":"Your Dropbox token does not have sufficient permissions.","messagePattern":"Your Dropbox token does not have sufficient permissions\\.","errorType":"validation","errorClass":"InsufficientPermissionsError","httpStatus":null,"severity":"error","filePath":"common/data_source/dropbox_connector.py","lineNumber":52,"sourceCode":"        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\")\n\n        try:\n            shared_links = self.dropbox_client.sharing_list_shared_links(path=path)","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/dropbox_connector.py#L34-L70","documentation":"Raised by validate_connector_settings() when files_list_folder throws an ApiError whose string contains 'insufficient_permissions'. The token authenticates but lacks the OAuth scope (files.metadata.read) or team-level permission needed to list the root folder. Mapped to InsufficientPermissionsError so the caller can surface an authorization rather than authentication problem.","triggerScenarios":"Scoped-access token created without files.metadata.read; team member token restricted by team policies; app in development status requesting scopes beyond its allowed set.","commonSituations":"Token generated before scopes were selected in the App Console; team admins restricting third-party apps; scope set trimmed during token rotation.","solutions":["In the Dropbox App Console Permissions tab, grant files.metadata.read (and files.content.read/sharing.read for indexing), then generate a NEW token — scope changes do not apply to existing tokens","Confirm the app has production status if it needs broader access","Team admins: verify the app is allow-listed under team API/permission policies"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    connector.validate_connector_settings()\nexcept InsufficientPermissionsError:\n    notify_user('Dropbox token lacks required scopes; grant them in the App Console and generate a NEW token')","preventionTips":["Select all needed scopes BEFORE generating a token — scope edits do not affect existing tokens","Prefer short-lived tokens generated via OAuth code flow so scope changes apply on next authorization"],"tags":["dropbox","permissions","scopes","validation"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}