infiniflow/ragflow · error · UnexpectedValidationError

Unexpected error while validating Confluence settings: {e}

Error message

Unexpected error while validating Confluence settings: {e}

What it means

Catch-all raised by validate_connector_settings() when the spaces probe throws anything other than a recognizable HTTPError (network refusal, DNS failure, SSL error, timeout, SDK parsing error). UnexpectedValidationError preserves the original exception text; the message is an f-string, so {e} is the underlying exception's string form.

Source

Thrown at common/data_source/confluence_connector.py:1847

                if callback and callback.should_stop():
                    raise RuntimeError("retrieve_all_slim_docs_perm_sync: Stop signal detected")
                if callback:
                    callback.progress("retrieve_all_slim_docs_perm_sync", 1)

        yield doc_metadata_list

    def validate_connector_settings(self) -> None:
        try:
            spaces = self.low_timeout_confluence_client.get_all_spaces(limit=1)
        except HTTPError as e:
            status_code = e.response.status_code if e.response else None
            if status_code == 401:
                raise CredentialExpiredError("Invalid or expired Confluence credentials (HTTP 401).")
            elif status_code == 403:
                raise InsufficientPermissionsError("Insufficient permissions to access Confluence resources (HTTP 403).")
            raise UnexpectedValidationError(f"Unexpected Confluence error (status={status_code}): {e}")
        except Exception as e:
            raise UnexpectedValidationError(f"Unexpected error while validating Confluence settings: {e}")

        if self.space:
            try:
                self.low_timeout_confluence_client.get_space(self.space)
            except ApiError as e:
                raise ConnectorValidationError("Invalid Confluence space key provided") from e

        if not spaces or not spaces.get("results"):
            raise ConnectorValidationError("No Confluence spaces found. Either your credentials lack permissions, or there truly are no spaces in this Confluence instance.")


if __name__ == "__main__":
    import os

    # base url
    wiki_base = os.environ["CONFLUENCE_URL"]

    # auth stuff

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Read the embedded {e} text: ConnectionError/DNS points at the URL or network, SSLError at certificates
  2. curl -v <wiki_base>/rest/api/space?limit=1 from the same host to confirm reachability
  3. Fix wiki_base to the exact base URL shown in Confluence's own link (no /wiki suffix needed for cloud handling, correct scheme)
  4. For self-signed certs, install the CA on the connector host rather than disabling verification
Defensive patterns

Strategy: try-catch

Validate before calling

import socket, urllib.parse
host = urllib.parse.urlparse(wiki_base).hostname
socket.gethostbyname(host)  # fail early on DNS problems

Try / catch

try:
    connector.validate_connector_settings()
except UnexpectedValidationError as e:
    logger.error('confluence validation failed: %s', e)
    # inspect cause: network vs SDK; do not blind-retry network errors

Prevention

When it happens

Trigger: wiki_base unreachable (wrong hostname, VPN required, on-prem Confluence not exposed), TLS certificate verification failure, proxy interference, atlassian library throwing a non-HTTPError (e.g. connection pool error) during get_all_spaces.

Common situations: Internal Confluence Data Center reachable only from inside a network; self-signed certs; corporate MITM proxies; typo in wiki_base such as https://confluence (no TLD).

Related errors


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