infiniflow/ragflow · error · ConnectorMissingCredentialError

Confluence

Error message

Confluence

What it means

Raised by the ConfluenceConnector.confluence_client property when self._confluence_client is None, i.e. _initialize_connection was never run or failed before building the client. The connector keeps two clients (a normal one and a low-timeout one for cheap calls); both properties raise ConnectorMissingCredentialError('Confluence') on the same not-initialized condition. Any code touching the property before initialization hits this.

Source

Thrown at common/data_source/confluence_connector.py:1278

    def _adjust_start_for_query(self, start: SecondsSinceUnixEpoch | None) -> SecondsSinceUnixEpoch | None:
        if not start or start <= 0:
            return start
        if self.time_buffer_seconds <= 0:
            return start
        return max(0.0, start - self.time_buffer_seconds)

    def _is_newer_than_start(self, doc_time: datetime | None, start: SecondsSinceUnixEpoch | None) -> bool:
        if not start or start <= 0:
            return True
        if doc_time is None:
            return True
        return doc_time.timestamp() > start

    @property
    def confluence_client(self) -> OnyxConfluence:
        if self._confluence_client is None:
            raise ConnectorMissingCredentialError("Confluence")
        return self._confluence_client

    @property
    def low_timeout_confluence_client(self) -> OnyxConfluence:
        if self._low_timeout_confluence_client is None:
            raise ConnectorMissingCredentialError("Confluence")
        return self._low_timeout_confluence_client

    def set_credentials_provider(self, credentials_provider: CredentialsProviderInterface) -> None:
        self.credentials_provider = credentials_provider

        # raises exception if there's a problem
        confluence_client = OnyxConfluence(
            is_cloud=self.is_cloud,
            url=self.wiki_base,
            credentials_provider=credentials_provider,
            scoped_token=self.scoped_token,
        )

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Run the full initialization sequence before any use: set_credentials_provider(provider) then _initialize_connection(...) (it renews credentials and builds both clients)
  2. Verify the Atlassian credentials up front — email + API token for cloud, PAT for server — so _initialize_connection does not fail midway
  3. Do not catch-and-continue on errors from _initialize_connection; the connector is unusable without its clients
  4. In tests, stub set_credentials_provider with a fake provider and call _initialize_connection before assertions that touch the client

Example fix

// before
connector = ConfluenceConnector(...)
spaces = connector.confluence_client.get_all_spaces()  # raises
// after
connector = ConfluenceConnector(...)
connector.set_credentials_provider(provider)
connector._initialize_connection()
spaces = connector.confluence_client.get_all_spaces()
Defensive patterns

Strategy: validation

Validate before calling

connector.set_credentials_provider(provider)
connector._initialize_connection()
if connector._confluence_client is None:
    raise RuntimeError('Confluence client failed to initialize — check credentials')

Type guard

def is_confluence_ready(c: ConfluenceConnector) -> bool:
    return c._confluence_client is not None and c._low_timeout_confluence_client is not None

Try / catch

from common.data_source.exceptions import ConnectorMissingCredentialError
try:
    client = connector.confluence_client
except ConnectorMissingCredentialError:
    connector.set_credentials_provider(provider)
    connector._initialize_connection()
    client = connector.confluence_client

Prevention

When it happens

Trigger: Accessing connector.confluence_client (directly or via methods that fetch spaces/pages) before _initialize_connection completed; a failed credential load (bad API token / expired OAuth) leaving both clients None; using a connector after a re-initialization error.

Common situations: Building ConfluenceConnector and immediately exercising it in tests without set_credentials_provider + _initialize_connection; an indexing run whose credential provider raised (e.g. expired Atlassian API token) with the error swallowed, then later code touches confluence_client; ordering bugs in orchestrators that poll before connecting.

Related errors


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