{"record":{"id":"4e806e5e9319fc12","repo":"gitbutlerapp/gitbutler","slug":"no-authenticated-forge-users-found-run-to-au","errorCode":null,"errorMessage":"No authenticated forge users found.\nRun '{}' to authenticate with {}.","messagePattern":"No authenticated forge users found\\.\nRun '(.+?)' to authenticate with (.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/forge/review.rs","lineNumber":416,"sourceCode":"        but_forge::check_forge_account_is_valid(preferred_forge_user, &forge_repo_info, &storage)\n            .await?;\n\n    let forge_display_name = match forge_repo_info.forge {\n        but_forge::ForgeName::Azure => {\n            anyhow::bail!(\"Azure is unsupported at the minute. Sorry 😞.\");\n        }\n        but_forge::ForgeName::GitHub => \"GitHub\",\n        but_forge::ForgeName::GitLab => \"GitLab\",\n        but_forge::ForgeName::Bitbucket => \"Bitbucket\",\n    };\n\n    match account_validity {\n        but_forge::ForgeAccountValidity::Invalid => Err(anyhow::anyhow!(\n            \"Known account is not correctly authenticated.\\nRun '{}' to authenticate with {}.\",\n            \"but config forge auth\",\n            forge_display_name\n        )),\n        but_forge::ForgeAccountValidity::NoCredentials => Err(anyhow::anyhow!(\n            \"No authenticated forge users found.\\nRun '{}' to authenticate with {}.\",\n            \"but config forge auth\",\n            forge_display_name\n        )),\n        but_forge::ForgeAccountValidity::Valid => {\n            // All good, continue\n            Ok(())\n        }\n    }\n}\n\n/// Get list of branch names that don't have PRs yet.\nfn get_branches_without_prs(\n    review_map: &std::collections::HashMap<String, Vec<but_forge::ForgeReview>>,\n    applied_stacks: &[HeadInfoStack],\n) -> anyhow::Result<Vec<String>> {\n    let mut branches_without_prs = Vec::new();\n    for stack_entry in applied_stacks {","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/forge/review.rs#L398-L434","documentation":"This error is thrown by ensure_forge_authentication when no forge account credentials exist at all (ForgeAccountValidity::NoCredentials). GitButler knows the repository targets a forge but has no authenticated user to act on behalf of, so review/merge commands abort with the remediation command in the message.","triggerScenarios":"Calling enable_auto_merge, set_draftiness, or create_review before ever running forge authentication on this machine, or after credentials were cleared/removed from GitButler's config.","commonSituations":"Fresh installs or new machines, CI containers without interactive auth, users who cleared app data, or contributors who cloned a repo whose forge differs from their previously authenticated one.","solutions":["Run `but config forge auth` to authenticate with the forge","Confirm the detected forge (GitHub/GitLab/Bitbucket) matches the repository's remote and that you authenticated against that forge","In non-interactive environments, run the auth command once interactively so credentials are stored, then retry"],"exampleFix":"// before\nbut forge review create ...\n// error: No authenticated forge users found.\n// after\nbut config forge auth\nbut forge review create ...","handlingStrategy":"validation","validationCode":"// ensure credentials exist before forge operations\nif !but config forge status 2>/dev/null; then\n  but config forge auth\nfi","typeGuard":"function isNoCredentialsError(e: Error): boolean {\n  return /No authenticated forge users found/i.test(e.message);\n}","tryCatchPattern":"try {\n  await runBut(['forge', 'review', 'create']);\n} catch (e) {\n  if (/No authenticated forge users/.test(e.message)) {\n    throw new Error('Run `but config forge auth` first', { cause: e });\n  }\n  throw e;\n}","preventionTips":["Authenticate once per machine before using forge commands","In CI, provision credentials as a setup step","Verify the authenticated forge matches the repo remote's forge"],"tags":["forge","authentication","cli","credentials"],"backgroundTag":"missing-credentials","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"}