gitbutlerapp/gitbutler · error

No authenticated forge users found. Run '{}' to authenticate

Error message

No authenticated forge users found.
Run '{}' to authenticate with {}.

What it means

Same `but forge review` preflight as the Invalid case, but for `ForgeAccountValidity::NoCredentials`: the credential store has no authenticated forge user for the remote's forge at all. The command stops before any forge request and points to `but config forge auth`, with the display name derived from the repo's forge.

Source

Thrown at crates/but/src/command/legacy/forge/review.rs:416

        but_forge::check_forge_account_is_valid(preferred_forge_user, &forge_repo_info, &storage)
            .await?;

    let forge_display_name = match forge_repo_info.forge {
        but_forge::ForgeName::Azure => {
            anyhow::bail!("Azure is unsupported at the minute. Sorry 😞.");
        }
        but_forge::ForgeName::GitHub => "GitHub",
        but_forge::ForgeName::GitLab => "GitLab",
        but_forge::ForgeName::Bitbucket => "Bitbucket",
    };

    match account_validity {
        but_forge::ForgeAccountValidity::Invalid => Err(anyhow::anyhow!(
            "Known account is not correctly authenticated.\nRun '{}' to authenticate with {}.",
            "but config forge auth",
            forge_display_name
        )),
        but_forge::ForgeAccountValidity::NoCredentials => Err(anyhow::anyhow!(
            "No authenticated forge users found.\nRun '{}' to authenticate with {}.",
            "but config forge auth",
            forge_display_name
        )),
        but_forge::ForgeAccountValidity::Valid => {
            // All good, continue
            Ok(())
        }
    }
}

/// Get list of branch names that don't have PRs yet.
fn get_branches_without_prs(
    review_map: &std::collections::HashMap<String, Vec<but_forge::ForgeReview>>,
    applied_stacks: &[HeadInfoStack],
) -> anyhow::Result<Vec<String>> {
    let mut branches_without_prs = Vec::new();
    for stack_entry in applied_stacks {

View on GitHub (pinned to caf1f223d3)

Solutions

  1. Run `but config forge auth`, pick the forge shown in the error, and finish the authentication flow
  2. Confirm the intended user was added (re-run auth if the wrong account was selected)
  3. Re-run `but forge review`

Example fix

# before
but forge review
# error: No authenticated forge users found.

# after
but config forge auth   # authenticate with the forge named in the message
but forge review
Defensive patterns

Strategy: validation

Validate before calling

# Provision credentials as part of onboarding, before review commands
but setup              # workspace onboarding
but config forge auth  # ensure a forge user exists for the remote's forge

Type guard

fn has_forge_credentials(v: &but_forge::ForgeAccountValidity) -> bool {
    !matches!(v, but_forge::ForgeAccountValidity::NoCredentials)
}

Try / catch

let out = Command::new("but").args(["forge", "review"]).output()?;
if !out.status.success()
    && String::from_utf8_lossy(&out.stderr).contains("No authenticated forge users")
{
    eprintln!("run `but config forge auth` first");
}

Prevention

When it happens

Trigger: Running `but forge review` on an install where `but config forge auth` was never completed, the credential store was cleared, or the repo's remote is served by a forge that has no authenticated user.

Common situations: Fresh `but` install or new workstation; review attempted on a newly cloned repo before onboarding; CI runner with a clean home directory; user authenticated only with GitHub while the remote is GitLab or Bitbucket.

Understand the failure class

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20). Data as JSON: /api/errors/4e806e5e9319fc12. Report an issue: GitHub.