{"record":{"id":"1aab4527df07a3fa","repo":"gitbutlerapp/gitbutler","slug":"github-graphql-pull-request-pr-number-in-owner","errorCode":null,"errorMessage":"GitHub GraphQL pull request #{pr_number} in {owner}/{repo} returned an empty node id","messagePattern":"GitHub GraphQL pull request #(.+?) in (.+?)/(.+?) returned an empty node id","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/but-github/src/client.rs","lineNumber":1235,"sourceCode":"                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>,\n        V: Serialize,\n    {\n        #[derive(Serialize)]\n        struct GraphQlRequest<'a, V> {\n            query: &'a str,\n            variables: &'a V,\n        }\n","sourceCodeStart":1217,"sourceCodeEnd":1253,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-github/src/client.rs#L1217-L1253","documentation":"The pullRequest object resolved but its node id came back as an empty string. Node ids are what subsequent GraphQL mutations (auto-merge enable/disable) require, so the client refuses instead of handing on a useless id. This shape is not something github.com normally returns.","triggerScenarios":"A proxy or gateway rewriting or truncating the GraphQL response; exotic GitHub Enterprise Server versions; a transient GitHub-side serialization anomaly.","commonSituations":"Rare against github.com; more likely with custom base URLs, misconfigured GHE instances, or API gateways that inspect and rewrite JSON.","solutions":["Retry the lookup once - transient response anomalies happen","Verify the configured base URL reaches a real GitHub GraphQL endpoint","If persistent, capture the raw response body and report it upstream"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"let node_id = match client.get_pull_request_node_id(owner, repo, n).await {\n    Err(e) if e.to_string().contains(\"empty node id\") => {\n        tokio::time::sleep(Duration::from_secs(2)).await;\n        client.get_pull_request_node_id(owner, repo, n).await? // one retry\n    }\n    other => other?,\n};","preventionTips":["Keep one retry around node-id lookups since the shape is anomalous","Ensure base URLs point at genuine GitHub API endpoints","Avoid API gateways that rewrite GraphQL JSON bodies"],"tags":["github","graphql","pull-request","node-id"],"backgroundTag":"graphql-null-response-field","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}