{"record":{"id":"00cfb6ddb949ae6e","repo":"infiniflow/ragflow","slug":"github-credentials-not-loaded","errorCode":null,"errorMessage":"GitHub credentials not loaded.","messagePattern":"GitHub credentials not loaded\\.","errorType":"validation","errorClass":"ConnectorMissingCredentialError","httpStatus":null,"severity":"error","filePath":"common/data_source/github/connector.py","lineNumber":671,"sourceCode":"        self,\n        start: SecondsSinceUnixEpoch,\n        end: SecondsSinceUnixEpoch,\n        checkpoint: GithubConnectorCheckpoint,\n    ) -> CheckpointOutput[GithubConnectorCheckpoint]:\n        return self._load_from_checkpoint(start, end, checkpoint, include_permissions=False)\n\n    @override\n    def load_from_checkpoint_with_perm_sync(\n        self,\n        start: SecondsSinceUnixEpoch,\n        end: SecondsSinceUnixEpoch,\n        checkpoint: GithubConnectorCheckpoint,\n    ) -> CheckpointOutput[GithubConnectorCheckpoint]:\n        return self._load_from_checkpoint(start, end, checkpoint, include_permissions=True)\n\n    def validate_connector_settings(self) -> None:\n        if self.github_client is None:\n            raise ConnectorMissingCredentialError(\"GitHub credentials not loaded.\")\n\n        if not self.repo_owner:\n            raise ConnectorValidationError(\"Invalid connector settings: 'repo_owner' must be provided.\")\n\n        try:\n            if self.repositories:\n                if \",\" in self.repositories:\n                    # Multiple repositories specified\n                    repo_names = [name.strip() for name in self.repositories.split(\",\")]\n                    if not repo_names:\n                        raise ConnectorValidationError(\"Invalid connector settings: No valid repository names provided.\")\n\n                    # Validate at least one repository exists and is accessible\n                    valid_repos = False\n                    validation_errors = []\n\n                    for repo_name in repo_names:\n                        if not repo_name:","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/github/connector.py#L653-L689","documentation":"validate_connector_settings() starts by checking self.github_client and raises ConnectorMissingCredentialError('GitHub credentials not loaded.') when no authenticated client exists. This is the settings-validation entry point, typically called from the UI/API when a user saves or tests a GitHub credential — the error means the credential object was never used to build a Github client.","triggerScenarios":"Calling validate_connector_settings() after constructing GithubConnector but before (or without a successful) load_credentials(), e.g. the token field was blank when the credential was saved.","commonSituations":"User saves a GitHub app/credential with an empty or missing access token; the credential-builder path raised earlier and validation was still invoked; API request creating the connector without the credential payload.","solutions":["Provide a valid GitHub access token and ensure load_credentials() runs before validate_connector_settings().","If using a GitHub App, confirm the app-level credential flow produced the token before validation is triggered.","Surface this error to the user as 're-enter credential' in the UI rather than retrying validation."],"exampleFix":"// before\nconnector = GithubConnector(...)\nconnector.validate_connector_settings()  # raises 'GitHub credentials not loaded.'\n\n# after\nconnector = GithubConnector(...)\nconnector.load_credentials({'github_access_token': token, 'repo_owner': owner, ...})\nconnector.validate_connector_settings()","handlingStrategy":"try-catch","validationCode":"if connector.github_client is None:\n    return {'valid': False, 'reason': 'missing credential'}","typeGuard":null,"tryCatchPattern":"try:\n    connector.validate_connector_settings()\nexcept ConnectorMissingCredentialError:\n    # prompt user to re-enter the GitHub credential\n    show_credential_form()","preventionTips":["Require a non-empty access token at the form/API layer before validation can be triggered.","Map ConnectorMissingCredentialError to a 're-enter credential' UX state, never a generic 500."],"tags":["github","credentials","validation"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}