{"record":{"id":"d29ff0d18108cebd","repo":"gitbutlerapp/gitbutler","slug":"no-authenticated-github-users-found-nrun-but-con","errorCode":null,"errorMessage":"No authenticated GitHub users found.\\nRun 'but config forge auth' to authenticate with GitHub.","messagePattern":"No authenticated GitHub users found\\.\\\\nRun 'but config forge auth' to authenticate with GitHub\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/but-github/src/client.rs","lineNumber":1969,"sourceCode":"            repo_owner: pr\n                .head\n                .repo\n                .as_ref()\n                .and_then(|r| r.owner.as_ref().map(|o| o.login.clone())),\n            head_repo_is_fork: pr.head.repo.as_ref().map(|r| r.fork).unwrap_or(false),\n            requested_reviewers,\n            auto_merge_enabled: pr.auto_merge.is_some(),\n        }\n    }\n}\n\npub(crate) fn resolve_account(\n    preferred_account: Option<&crate::GithubAccountIdentifier>,\n    storage: &but_forge_storage::Controller,\n) -> Result<crate::GithubAccountIdentifier, anyhow::Error> {\n    let known_accounts = crate::token::list_known_github_accounts(storage)?;\n    let Some(default_account) = known_accounts.first() else {\n        bail!(\n            \"No authenticated GitHub users found.\\nRun 'but config forge auth' to authenticate with GitHub.\"\n        );\n    };\n    let account = if let Some(account) = preferred_account {\n        if known_accounts.contains(account) {\n            account\n        } else {\n            bail!(\n                \"Preferred GitHub account '{account}' has not authenticated yet.\\nRun 'but config forge auth' to authenticate, or choose another account.\"\n            );\n        }\n    } else {\n        default_account\n    };\n\n    Ok(account.to_owned())\n}\n","sourceCodeStart":1951,"sourceCodeEnd":1987,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-github/src/client.rs#L1951-L1987","documentation":"resolve_account queried the stored GitHub accounts and found none, so there is no credential to pick - not even a default. Every forge operation that talks to GitHub needs at least one authenticated user first; the message itself names the remedy.","triggerScenarios":"First run before any `but config forge auth`; the auth storage is missing or wiped (fresh home directory, CI container); all accounts were previously logged out.","commonSituations":"Fresh installs; CI containers without persisted config directories; running as a different user than the one who authenticated.","solutions":["Run `but config forge auth` and complete the device flow","Verify the config/storage location is the one the CLI actually uses (same user, same home)","Re-run the original forge command"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if crate::token::list_known_github_accounts(storage)?.is_empty() {\n    anyhow::bail!(\"no GitHub account on this machine - run `but config forge auth` first\");\n}","typeGuard":null,"tryCatchPattern":"match do_forge_operation().await {\n    Err(e) if e.to_string().contains(\"No authenticated GitHub users\") => {\n        launch_auth_flow().await?; // then retry the operation\n        do_forge_operation().await\n    }\n    other => other,\n}","preventionTips":["Authenticate once during setup: `but config forge auth`","Persist the but config directory in CI between runs","Run the CLI as the same user that authenticated"],"tags":["github","authentication","cli","first-run"],"backgroundTag":"missing-credentials","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-09-01T03:17:15.561Z"}