infiniflow/ragflow · error · ConnectorMissingCredentialError

DingTalk access_token not loaded

Error message

DingTalk access_token not loaded

What it means

Raised by the access_token property when self._access_token is None, i.e. the property was read before load_credentials() stored the token. Unlike the load-time check (which validates the input dict), this fires on the read path whenever any method needs the token and it was never loaded.

Source

Thrown at common/data_source/dingtalk_ai_table_connector.py:117

        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

    def validate_connector_settings(self) -> None:
        """Validate DingTalk connector settings by trying to get all sheets."""
        if self._client is None or self._access_token is None:
            raise ConnectorMissingCredentialError("DingTalk Notable")

        try:
            # Try to get sheets to validate credentials
            headers = notable_models.GetAllSheetsHeaders()
            headers.x_acs_dingtalk_access_token = self._access_token

            request = notable_models.GetAllSheetsRequest(
                operator_id=self.operator_id,
            )

            self.client.get_all_sheets_with_options(
                self.table_id,

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Call load_credentials(...) successfully before any indexing or validate call
  2. If load_credentials raised, do not reuse the instance; rebuild it
  3. In orchestrating code, treat ConnectorMissingCredentialError as fatal for that run, not retriable

Example fix

// before
connector = DingTalkAITableConnector(...)
sheets = connector._get_all_sheets()  # raises

// after
connector.load_credentials({'access_token': token})
sheets = connector._get_all_sheets()
Defensive patterns

Strategy: validation

Validate before calling

if connector._access_token is None:
    connector.load_credentials({'access_token': fetch_token()})

Prevention

When it happens

Trigger: Calling _get_all_sheets or other indexing methods on a freshly constructed connector without load_credentials(); an earlier load_credentials call raised and the connector was reused anyway.

Common situations: Test code that skips credential setup; orchestrators that catch the load error but proceed to poll_source/load_from_state.

Related errors


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