{"record":{"id":"7c81936c1a316d53","repo":"infiniflow/ragflow","slug":"unexpected-error-while-validating-confluence-setti","errorCode":null,"errorMessage":"Unexpected error while validating Confluence settings: {e}","messagePattern":"Unexpected error while validating Confluence settings: (.+?)","errorType":"validation","errorClass":"UnexpectedValidationError","httpStatus":null,"severity":"error","filePath":"common/data_source/confluence_connector.py","lineNumber":1847,"sourceCode":"                if callback and callback.should_stop():\n                    raise RuntimeError(\"retrieve_all_slim_docs_perm_sync: Stop signal detected\")\n                if callback:\n                    callback.progress(\"retrieve_all_slim_docs_perm_sync\", 1)\n\n        yield doc_metadata_list\n\n    def validate_connector_settings(self) -> None:\n        try:\n            spaces = self.low_timeout_confluence_client.get_all_spaces(limit=1)\n        except HTTPError as e:\n            status_code = e.response.status_code if e.response else None\n            if status_code == 401:\n                raise CredentialExpiredError(\"Invalid or expired Confluence credentials (HTTP 401).\")\n            elif status_code == 403:\n                raise InsufficientPermissionsError(\"Insufficient permissions to access Confluence resources (HTTP 403).\")\n            raise UnexpectedValidationError(f\"Unexpected Confluence error (status={status_code}): {e}\")\n        except Exception as e:\n            raise UnexpectedValidationError(f\"Unexpected error while validating Confluence settings: {e}\")\n\n        if self.space:\n            try:\n                self.low_timeout_confluence_client.get_space(self.space)\n            except ApiError as e:\n                raise ConnectorValidationError(\"Invalid Confluence space key provided\") from e\n\n        if not spaces or not spaces.get(\"results\"):\n            raise ConnectorValidationError(\"No Confluence spaces found. Either your credentials lack permissions, or there truly are no spaces in this Confluence instance.\")\n\n\nif __name__ == \"__main__\":\n    import os\n\n    # base url\n    wiki_base = os.environ[\"CONFLUENCE_URL\"]\n\n    # auth stuff","sourceCodeStart":1829,"sourceCodeEnd":1865,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/confluence_connector.py#L1829-L1865","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Read the embedded {e} text: ConnectionError/DNS points at the URL or network, SSLError at certificates","curl -v <wiki_base>/rest/api/space?limit=1 from the same host to confirm reachability","Fix wiki_base to the exact base URL shown in Confluence's own link (no /wiki suffix needed for cloud handling, correct scheme)","For self-signed certs, install the CA on the connector host rather than disabling verification"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import socket, urllib.parse\nhost = urllib.parse.urlparse(wiki_base).hostname\nsocket.gethostbyname(host)  # fail early on DNS problems","typeGuard":null,"tryCatchPattern":"try:\n    connector.validate_connector_settings()\nexcept UnexpectedValidationError as e:\n    logger.error('confluence validation failed: %s', e)\n    # inspect cause: network vs SDK; do not blind-retry network errors","preventionTips":["Verify wiki_base reachability from the connector host before configuring","Keep UnexpectedValidationError messages in logs — the embedded {e} identifies the real cause"],"tags":["confluence","network","validation","catch-all"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}