{"record":{"id":"e717eeb34e6cff71","repo":"infiniflow/ragflow","slug":"unexpected-error-during-github-settings-validation","errorCode":null,"errorMessage":"Unexpected error during GitHub settings validation: {exc}","messagePattern":"Unexpected error during GitHub settings validation: (.+?)","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"common/data_source/github/connector.py","lineNumber":757,"sourceCode":"\n        except GithubException as e:\n            if e.status == 401:\n                raise CredentialExpiredError(\"GitHub credential appears to be invalid or expired (HTTP 401).\")\n            elif e.status == 403:\n                raise InsufficientPermissionsError(\"Your GitHub token does not have sufficient permissions for this repository (HTTP 403).\")\n            elif e.status == 404:\n                if self.repositories:\n                    if \",\" in self.repositories:\n                        raise ConnectorValidationError(f\"None of the specified GitHub repositories could be found for owner: {self.repo_owner}\")\n                    else:\n                        raise ConnectorValidationError(f\"GitHub repository not found with name: {self.repo_owner}/{self.repositories}\")\n                else:\n                    raise ConnectorValidationError(f\"GitHub user or organization not found: {self.repo_owner}\")\n            else:\n                raise ConnectorValidationError(f\"Unexpected GitHub error (status={e.status}): {e.data}\")\n\n        except Exception as exc:\n            raise Exception(f\"Unexpected error during GitHub settings validation: {exc}\")\n\n    def validate_checkpoint_json(self, checkpoint_json: str) -> GithubConnectorCheckpoint:\n        return GithubConnectorCheckpoint.model_validate_json(checkpoint_json)\n\n    def retrieve_slim_document(\n        self,\n        start: SecondsSinceUnixEpoch | None = None,\n        end: SecondsSinceUnixEpoch | None = None,\n        callback: Any = None,\n    ) -> GenerateSlimDocumentOutput:\n        start_value = 0.0 if start is None else start\n        end_value = datetime.now(timezone.utc).timestamp() if end is None else end\n        checkpoint = self.build_dummy_checkpoint()\n        slim_batch: list[SlimDocument] = []\n\n        while checkpoint.has_more:\n            wrapper = CheckpointOutputWrapper[GithubConnectorCheckpoint]()\n            for document, failure, next_checkpoint in wrapper(self.load_from_checkpoint(start_value, end_value, checkpoint)):","sourceCodeStart":739,"sourceCodeEnd":775,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/github/connector.py#L739-L775","documentation":"A bare Exception (not a connector error class) raised when anything other than RateLimitExceededException/GithubException escapes the try body of validate_connector_settings(). It re-wraps the original message with 'Unexpected error during GitHub settings validation:' but discards the traceback chain (no 'from exc').","triggerScenarios":"Non-GitHub exceptions inside the probe: AttributeError from an unexpected PyGithub response shape, network-layer errors (requests exceptions) not wrapped as GithubException, or bugs like a None response attribute.","commonSituations":"PyGithub/network version mismatches; proxies or TLS interception raising requests exceptions; intermittent DNS failures during validation.","solutions":["Inspect the wrapped message (or add 'from exc' locally) to identify the underlying exception, then fix that root cause.","Verify network egress to api.github.com (proxy/firewall) from the service running validation.","Pin/upgrade PyGithub to a version compatible with the installed requests version."],"exampleFix":"// before\n        except Exception as exc:\n            raise Exception(f\"Unexpected error during GitHub settings validation: {exc}\")\n\n// after\n        except Exception as exc:\n            raise UnexpectedValidationError(\n                f\"Unexpected error during GitHub settings validation: {exc}\"\n            ) from exc","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    connector.validate_connector_settings()\nexcept Exception as e:  # this path raises bare Exception\n    log_full_traceback(e)\n    diagnose_network_or_dependency(e)","preventionTips":["Pin PyGithub and requests to tested versions; upgrade them together.","Verify proxy/TLS egress to api.github.com from the validating service.","Patch the raise to use 'from exc' so future occurrences keep their traceback."],"tags":["github","unexpected","catch-all","network"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}