{"record":{"id":"85ea474d82adae58","repo":"gitbutlerapp/gitbutler","slug":"github-graphql-repository-not-found-for-owner-r","errorCode":null,"errorMessage":"GitHub GraphQL repository not found for {owner}/{repo}","messagePattern":"GitHub GraphQL repository not found for (.+?)/(.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/but-github/src/client.rs","lineNumber":1227,"sourceCode":"\n        #[derive(Deserialize)]\n        struct GraphQlPullRequest {\n            id: String,\n        }\n\n        let data: QueryData = self\n            .graphql_query(\n                GQL_GET_PR_NODE_ID,\n                &Variables {\n                    owner,\n                    repo,\n                    number: pr_number,\n                },\n            )\n            .await?;\n\n        let Some(repository) = data.repository else {\n            bail!(\"GitHub GraphQL repository not found for {owner}/{repo}\");\n        };\n\n        let Some(pull_request) = repository.pull_request else {\n            bail!(\"GitHub GraphQL pull request #{pr_number} not found for {owner}/{repo}\",);\n        };\n\n        if pull_request.id.is_empty() {\n            bail!(\n                \"GitHub GraphQL pull request #{pr_number} in {owner}/{repo} returned an empty node id\",\n            );\n        }\n\n        Ok(PullRequestNodeId::from_string(pull_request.id))\n    }\n\n    async fn graphql_query<T, V>(&self, query: &str, variables: &V) -> Result<T>\n    where\n        T: for<'de> Deserialize<'de>,","sourceCodeStart":1209,"sourceCodeEnd":1245,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-github/src/client.rs#L1209-L1245","documentation":"A GraphQL query that looks up {owner}/{repo} (used when resolving a pull request node id) received a null `repository` field. GitHub answers this way when no repository with that name is visible to the authenticated account.","triggerScenarios":"Wrong owner/repo spelling or case in the remote; the repo is private and the token has no access; an expired or invalid token makes every repo invisible; a GitHub App that is not installed on the repo; a base_url pointing at the wrong GitHub host.","commonSituations":"Renamed or transferred repositories; org repos behind SAML the token never authorized; CI environments with no stored credentials; typos in URL-derived owner/repo pairs.","solutions":["Open https://github.com/{owner}/{repo} in a browser as the same account to confirm the repo exists and is visible","Re-authenticate with `but config forge auth`","Check the forge/remote configuration for the intended owner, repo, and base URL","For SAML-protected orgs, authorize the token for that organization"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let resp = reqwest::Client::new()\n    .get(format!(\"https://api.github.com/repos/{owner}/{repo}\"))\n    .bearer_auth(token)\n    .send().await?;\nmatch resp.status().as_u16() {\n    200 => {}\n    404 => anyhow::bail!(\"repo {owner}/{repo} not visible to this token - re-auth or check name\"),\n    s => anyhow::bail!(\"repo lookup failed with HTTP {s}\"),\n}","typeGuard":null,"tryCatchPattern":"match client.get_pull_request_node_id(owner, repo, n).await {\n    Err(e) if e.to_string().contains(\"repository not found\") => prompt_reauth_or_fix_remote(),\n    other => other?,\n}","preventionTips":["Derive owner/repo from the actual git remote instead of hand-typed config","Re-authenticate after org/permission changes","Pre-check repo visibility with a cheap REST call in setup steps"],"tags":["github","graphql","repository","not-found","permissions"],"backgroundTag":"github-repository-not-found","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}