{"record":{"id":"a206d74344fa44b6","repo":"infiniflow/ragflow","slug":"dingtalk-access-token-is-required","errorCode":null,"errorMessage":"DingTalk access_token is required","messagePattern":"DingTalk access_token is required","errorType":"validation","errorClass":"ConnectorMissingCredentialError","httpStatus":null,"severity":"error","filePath":"common/data_source/dingtalk_ai_table_connector.py","lineNumber":100,"sourceCode":"        \"\"\"Create DingTalk Notable API client.\"\"\"\n        config = open_api_models.Config()\n        config.protocol = \"https\"\n        config.region_id = \"central\"\n        return NotableClient(config)\n\n    def load_credentials(self, credentials: dict[str, Any]) -> dict[str, Any] | None:\n        \"\"\"\n        Load DingTalk credentials.\n\n        Args:\n            credentials: Dictionary containing 'access_token'\n\n        Returns:\n            None\n        \"\"\"\n        access_token = credentials.get(\"access_token\")\n        if not access_token:\n            raise ConnectorMissingCredentialError(\"DingTalk access_token is required\")\n\n        self._access_token = access_token\n        self._client = self._create_client()\n        return None\n\n    @property\n    def client(self) -> NotableClient:\n        \"\"\"Get the DingTalk AITable client.\"\"\"\n        if self._client is None:\n            raise DingTalkAITableClientNotSetUpError()\n        return self._client\n\n    @property\n    def access_token(self) -> str:\n        \"\"\"Get the access token.\"\"\"\n        if self._access_token is None:\n            raise ConnectorMissingCredentialError(\"DingTalk access_token not loaded\")\n        return self._access_token","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/dingtalk_ai_table_connector.py#L82-L118","documentation":"Raised by DingTalkAITableConnector.load_credentials() when the credentials dict has no truthy 'access_token' entry. This is the explicit gate before any Notable client is constructed, so the connector fails fast at credential-load time instead of later during indexing.","triggerScenarios":"Building the connector via the API without providing an access_token in the credential payload, passing an empty string, or a key mismatch ('token' instead of 'access_token').","commonSituations":"Credential form submission dropped the token field; automation scripts that template the credentials dict and leave the placeholder empty; token stored under the wrong key name.","solutions":["Supply a valid DingTalk access_token in the credentials dict: credentials={'access_token': '<token>'}","Check for exact key name 'access_token' (no 'dingtalk_' prefix) and non-empty value","If the token is short-lived, ensure it is freshly obtained before each connector run"],"exampleFix":"// before\nconnector.load_credentials({'token': 'xxx'})  # raises\n\n// after\nconnector.load_credentials({'access_token': 'xxx'})","handlingStrategy":"validation","validationCode":"if not credentials.get('access_token'):\n    raise ValueError('credentials must include a non-empty access_token')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate credential dicts at the config/form layer before passing to load_credentials","Use exact key 'access_token' and assert non-empty in a shared helper"],"tags":["dingtalk","credentials","validation"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}