{"record":{"id":"209654f4852b8dd2","repo":"infiniflow/ragflow","slug":"found-no-repos-for-user-self-repo-owner-does-t","errorCode":null,"errorMessage":"Found no repos for user: {self.repo_owner}. Does the credential have the right scopes?","messagePattern":"Found no repos for user: (.+?)\\. Does the credential have the right scopes\\?","errorType":"validation","errorClass":"ConnectorValidationError","httpStatus":null,"severity":"error","filePath":"common/data_source/github/connector.py","lineNumber":735,"sourceCode":"                except GithubException as e:\n                    # Check for missing SSO\n                    MISSING_SSO_ERROR_MESSAGE = \"You must grant your Personal Access token access to this organization\".lower()\n                    if MISSING_SSO_ERROR_MESSAGE in str(e).lower():\n                        SSO_GUIDE_LINK = (\n                            \"https://docs.github.com/en/enterprise-cloud@latest/authentication/\"\n                            \"authenticating-with-saml-single-sign-on/\"\n                            \"authorizing-a-personal-access-token-for-use-with-saml-single-sign-on\"\n                        )\n                        raise ConnectorValidationError(\n                            f\"Your GitHub token is missing authorization to access the `{self.repo_owner}` organization. Please follow the guide to authorize your token: {SSO_GUIDE_LINK}\"\n                        )\n                    # If not an org, try as a user\n                    user = self.github_client.get_user(self.repo_owner)\n\n                    # Check if we can access any repos\n                    total_count = user.get_repos().totalCount\n                    if total_count == 0:\n                        raise ConnectorValidationError(f\"Found no repos for user: {self.repo_owner}. Does the credential have the right scopes?\")\n\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:","sourceCodeStart":717,"sourceCodeEnd":753,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/github/connector.py#L717-L753","documentation":"ConnectorValidationError raised on the fallback path: repo_owner is not an accessible organization, so the connector tries get_user(repo_owner); if user.get_repos().totalCount == 0 it refuses to index nothing. Like the org variant, it points at token scopes — the owner exists as a user but the credential can see none of their repos.","triggerScenarios":"repo_owner is a personal account, the token authenticates, but every repo that account owns is private (or the token lacks access), so the public/visible repo count is zero.","commonSituations":"Indexing your own account with all-private repos using a PAT without 'repo' scope; owner name that is actually an empty org but resolves as a user; fork-only accounts with hidden visibility.","solutions":["Re-issue the token with the 'repo' scope (classic) or grant the fine-grained PAT access to those repositories.","Or explicitly set 'repositories' to named repos instead of relying on whole-owner enumeration.","Confirm the owner string is the intended account (not a same-named org)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"user = gh.get_user(owner)\nif user.get_repos().totalCount == 0 and not explicit_repositories:\n    warn('zero visible repos for this owner — check token scopes')","typeGuard":null,"tryCatchPattern":"try:\n    connector.validate_connector_settings()\nexcept ConnectorValidationError as e:\n    return 400, str(e)","preventionTips":["Set explicit 'repositories' when indexing a private-repo-only account rather than whole-owner sync.","Grant the PAT 'repo' scope before enabling user-wide indexing."],"tags":["github","permissions","scopes","user","validation"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}