zeroclaw-labs/zeroclaw · error · anyhow::Error

No auth profile found. Run `zeroclaw auth login --model-prov

Error message

No auth profile found. Run `zeroclaw auth login --model-provider <provider>` first.

What it means

`zeroclaw auth refresh` asks the provider flow for refresh status; `RefreshStatus::NoProfile` means the auth store holds no profile for that model-provider (and profile name), so there is nothing to refresh and the CLI bails with a login hint.

Source

Thrown at src/main.rs:7593

            };
            let status = provider
                .flow()
                .refresh_status(&ctx, profile.as_deref())
                .await?;
            match status {
                auth::RefreshStatus::Refreshed { profile } => {
                    println!(
                        "{}",
                        ta(
                            "cli-auth-refresh-ok",
                            &[("profile", &profile)],
                            "Token refresh OK"
                        )
                    );
                    Ok(())
                }
                auth::RefreshStatus::NoProfile => {
                    bail!(
                        "No auth profile found. Run `zeroclaw auth login --model-provider <provider>` first.",
                    )
                }
            }
        }

        AuthCommands::Logout {
            model_provider,
            profile,
        } => {
            let model_provider = auth::normalize_model_provider(&model_provider)?;
            let removed = auth_service
                .remove_profile(&model_provider, &profile)
                .await?;
            if removed {
                println!(
                    "{}",
                    ta(

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Log in first: `zeroclaw auth login --model-provider <provider>` (add `--profile <name>` if you use named profiles)
  2. Check the provider slug and profile name — refresh must target the exact pair used at login
  3. If a raw token is all you have, `zeroclaw auth paste-token`/`setup-token` also creates the profile, after which refresh works

Example fix

# before
zeroclaw auth refresh --model-provider anthropic   # never logged in on this machine
# after
zeroclaw auth login --model-provider anthropic
zeroclaw auth refresh --model-provider anthropic
Defensive patterns

Strategy: fallback

Validate before calling

# verify a profile exists before refreshing
zeroclaw auth status --model-provider "$p" 2>/dev/null | grep -q . \
  || echo "no stored profile; login will be required" >&2

Try / catch

if ! zeroclaw auth refresh --model-provider "$p" 2>/tmp/auth_err; then
  grep -q "No auth profile found" /tmp/auth_err \
    && zeroclaw auth login --model-provider "$p" \
    && zeroclaw auth refresh --model-provider "$p" \
    || { cat /tmp/auth_err; exit 1; }
fi

Prevention

When it happens

Trigger: `zeroclaw auth refresh --model-provider <provider>` before any successful `auth login`/`paste-token`/`setup-token` for that provider, with a wrong --profile name, or after `auth logout` or a wiped credentials/data directory.

Common situations: Fresh machine or a new data dir (changed config/data location); typo'd provider slug or profile name ('default' vs a named profile); credentials removed by logout, OS cleanup, or a container rebuild.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/25eee136a0cc66a8. Report an issue: GitHub.