{"record":{"id":"7f0e1e618cec0a23","repo":"infiniflow/ragflow","slug":"dingtalk-notable-credential-validation-failed-e","errorCode":null,"errorMessage":"DingTalk Notable credential validation failed: {e}","messagePattern":"DingTalk Notable credential validation failed: (.+?)","errorType":"validation","errorClass":"ConnectorValidationError","httpStatus":null,"severity":"error","filePath":"common/data_source/dingtalk_ai_table_connector.py","lineNumber":142,"sourceCode":"\n        try:\n            # Try to get sheets to validate credentials\n            headers = notable_models.GetAllSheetsHeaders()\n            headers.x_acs_dingtalk_access_token = self._access_token\n\n            request = notable_models.GetAllSheetsRequest(\n                operator_id=self.operator_id,\n            )\n\n            self.client.get_all_sheets_with_options(\n                self.table_id,\n                request,\n                headers,\n                util_models.RuntimeOptions(),\n            )\n        except Exception as e:\n            logger.exception(\"[DingTalk Notable]: Failed to validate credentials\")\n            raise ConnectorValidationError(f\"DingTalk Notable credential validation failed: {e}\")\n\n    def _get_all_sheets(self) -> list[dict[str, Any]]:\n        \"\"\"\n        Retrieve all sheets from the Notable table.\n\n        Returns:\n            List of sheet information dictionaries\n        \"\"\"\n        headers = notable_models.GetAllSheetsHeaders()\n        headers.x_acs_dingtalk_access_token = self._access_token\n\n        request = notable_models.GetAllSheetsRequest(\n            operator_id=self.operator_id,\n        )\n\n        try:\n            response = self.client.get_all_sheets_with_options(\n                self.table_id,","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/dingtalk_ai_table_connector.py#L124-L160","documentation":"Raised by validate_connector_settings() when the get_all_sheets_with_options SDK call throws any exception. The full stack is logged ('[DingTalk Notable]: Failed to validate credentials') and the original message is embedded in a ConnectorValidationError. Typical causes: expired/invalid access token (DingTalk tokens expire in ~2h), missing operator_id permissions, wrong table_id/unionId, or network failure.","triggerScenarios":"Expired access_token (they are short-lived); operator_id lacks read permission on the Notable base; table_id references a deleted base; Tea/TeaUtil SDK exceptions surfaced as generic Exception.","commonSituations":"Tokens cached too long in automation; DingTalk app scopes (AITable/Notable permissions) not granted; base shared with a different org.","solutions":["Refresh the access_token (enterprise tokens expire ~2 hours) and re-run load_credentials","Check the embedded {e} in the message and the logged stack for the specific DingTalk error code","Confirm the DingTalk app has the Notable/AITable read scope and the operator_id has access to table_id","Verify table_id and operator_id values against the DingTalk AITable console"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    connector.validate_connector_settings()\nexcept ConnectorValidationError as e:\n    if 'expired' in str(e).lower():\n        connector.load_credentials({'access_token': fetch_new_token()})\n        connector.validate_connector_settings()  # retry once","preventionTips":["Fetch DingTalk access tokens programmatically per run instead of caching past expiry (~2h)","Log the DingTalk error code embedded in {e} before retrying — permission errors are not retriable"],"tags":["dingtalk","validation","token-expiry","catch-all"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}