{"record":{"id":"e36e5c3035d1ed9d","repo":"infiniflow/ragflow","slug":"unexpected-github-error-status-e-status-e-da","errorCode":null,"errorMessage":"Unexpected GitHub error (status={e.status}): {e.data}","messagePattern":"Unexpected GitHub error \\(status=(.+?)\\): (.+?)","errorType":"validation","errorClass":"ConnectorValidationError","httpStatus":null,"severity":"error","filePath":"common/data_source/github/connector.py","lineNumber":754,"sourceCode":"\n        except RateLimitExceededException:\n            raise UnexpectedValidationError(\"Validation failed due to GitHub rate-limits being exceeded. Please try again later.\")\n\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","sourceCodeStart":736,"sourceCodeEnd":772,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/github/connector.py#L736-L772","documentation":"ConnectorValidationError catch-all for GithubException statuses other than 401/403/404: it wraps the raw status and e.data payload so the caller sees exactly what GitHub returned. Typical statuses are 422, 5xx, or 403 variants that slipped past earlier handling.","triggerScenarios":"GitHub API probe returns an unexpected status — server errors (5xx), 422 validation responses, or abuse/secondary-limit 403s whose body lacks the SSO text — hitting the final else branch of the status ladder.","commonSituations":"Transient GitHub incidents; secondary rate limits reported as 403 with a different message; API changes returning new status codes to older PyGithub versions.","solutions":["Read the embedded status and e.data — the GitHub error message names the actual cause.","For 5xx or secondary-limit 403s, back off (exponential, respect Retry-After) and revalidate later.","Upgrade PyGithub if the payload shows an unrecognized/changed error shape."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    connector.validate_connector_settings()\nexcept ConnectorValidationError as e:\n    if is_transient_github_status(e):  # inspect wrapped status (5xx, secondary limits)\n        schedule_retry_with_backoff()\n    else:\n        return 400, str(e)","preventionTips":["Inspect the embedded status/e.data before choosing retry vs fail.","Respect Retry-After headers and use exponential backoff for 5xx responses."],"tags":["github","api-error","catch-all","http-5xx"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}