infiniflow/ragflow · error · ConnectorMissingCredentialError

DingTalk access_token is required

Error message

DingTalk access_token is required

What it means

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.

Source

Thrown at common/data_source/dingtalk_ai_table_connector.py:100

        """Create DingTalk Notable API client."""
        config = open_api_models.Config()
        config.protocol = "https"
        config.region_id = "central"
        return NotableClient(config)

    def load_credentials(self, credentials: dict[str, Any]) -> dict[str, Any] | None:
        """
        Load DingTalk credentials.

        Args:
            credentials: Dictionary containing 'access_token'

        Returns:
            None
        """
        access_token = credentials.get("access_token")
        if not access_token:
            raise ConnectorMissingCredentialError("DingTalk access_token is required")

        self._access_token = access_token
        self._client = self._create_client()
        return None

    @property
    def client(self) -> NotableClient:
        """Get the DingTalk AITable client."""
        if self._client is None:
            raise DingTalkAITableClientNotSetUpError()
        return self._client

    @property
    def access_token(self) -> str:
        """Get the access token."""
        if self._access_token is None:
            raise ConnectorMissingCredentialError("DingTalk access_token not loaded")
        return self._access_token

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Supply a valid DingTalk access_token in the credentials dict: credentials={'access_token': '<token>'}
  2. Check for exact key name 'access_token' (no 'dingtalk_' prefix) and non-empty value
  3. If the token is short-lived, ensure it is freshly obtained before each connector run

Example fix

// before
connector.load_credentials({'token': 'xxx'})  # raises

// after
connector.load_credentials({'access_token': 'xxx'})
Defensive patterns

Strategy: validation

Validate before calling

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

Prevention

When it happens

Trigger: 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').

Common situations: 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.

Related errors


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