{"record":{"id":"ed5e9a26543f75a7","repo":"gitbutlerapp/gitbutler","slug":"failed-to-verify-bitbucket-repository-access","errorCode":null,"errorMessage":"Failed to verify Bitbucket repository access","messagePattern":"Failed to verify Bitbucket repository access","errorType":"http","errorClass":"HttpStatusError","httpStatus":null,"severity":"error","filePath":"crates/but-bitbucket/src/client.rs","lineNumber":570,"sourceCode":"        );\n        let response = self.client.get(&url).send().await?;\n        let status = response.status();\n        if status == reqwest::StatusCode::NOT_FOUND {\n            let repository_status = self.repository_status(workspace, repo_slug).await?;\n            if repository_status.is_success() {\n                return Ok(None);\n            }\n            if matches!(\n                repository_status,\n                reqwest::StatusCode::UNAUTHORIZED\n                    | reqwest::StatusCode::FORBIDDEN\n                    | reqwest::StatusCode::NOT_FOUND\n            ) {\n                return Err(self\n                    .classify_repository_access_error(repository_status, workspace, repo_slug)\n                    .await);\n            }\n            return Err(anyhow::Error::new(HttpStatusError {\n                status: repository_status,\n            })\n            .context(\"Failed to verify Bitbucket repository access\"));\n        }\n        if matches!(\n            status,\n            reqwest::StatusCode::UNAUTHORIZED | reqwest::StatusCode::FORBIDDEN\n        ) {\n            return Err(self\n                .classify_repository_access_error(status, workspace, repo_slug)\n                .await);\n        }\n        if !status.is_success() {\n            bail!(\"Bitbucket request failed: {status}\");\n        }\n\n        let page: Paginated<BitbucketApiBuildStatus> = response.json().await?;\n        let mut statuses = page.values;","sourceCodeStart":552,"sourceCodeEnd":588,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-bitbucket/src/client.rs#L552-L588","documentation":"Raised when verifying Bitbucket repository access fails with an HTTP status that is NOT one of the recognizable access-related codes (e.g. not 401/403/404), so it cannot be classified into a friendly access-denied message. The raw `HttpStatusError` is wrapped with a generic 'Failed to verify Bitbucket repository access' context.","triggerScenarios":"Calling an API path that verifies repository access (reachable via `list_checks_for_ref` and similar) when Bitbucket responds with an unhandled status such as 429 (rate limit), 500, or 502, or a network-level failure surfaces as an unusual status.","commonSituations":"Bitbucket Cloud incidents or partial outages; aggressive polling hitting the rate limit; a proxy or corporate gateway returning unexpected status codes; transient 5xx during CI.","solutions":["Check the HTTP status embedded in the error and look up its meaning (429 = rate limit, 5xx = server side).","Retry after a backoff — these statuses are usually transient.","Check the Bitbucket Cloud status page for ongoing incidents.","If a proxy is in play, verify it passes through Bitbucket API responses unchanged."],"exampleFix":"// before\nlet checks = client.list_checks_for_ref(&ref_name).await?;\n// after\nmatch client.list_checks_for_ref(&ref_name).await {\n    Err(e) if is_retryable_status(&e) => { tokio::time::sleep(Duration::from_secs(5)).await; retry().await }\n    other => other?,\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":"fn is_transient(status: Option<u16>) -> bool {\n    matches!(status, Some(429) | Some(500)..=Some(599))\n}","tryCatchPattern":"match verify_access().await {\n    Err(e) if is_transient(status_of(&e)) => schedule_retry_with_backoff(),\n    Err(e) => return Err(e),\n    Ok(v) => Ok(v),\n}","preventionTips":["Poll Bitbucket APIs at modest rates; respect Rate-Limit headers.","Check the Bitbucket status page before blaming configuration on 5xx.","Route API traffic around interfering corporate proxies."],"tags":["bitbucket","http","api","rate-limit"],"backgroundTag":"http-error-response","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}