{"record":{"id":"25eee136a0cc66a8","repo":"zeroclaw-labs/zeroclaw","slug":"no-auth-profile-found-run-zeroclaw-auth-login","errorCode":null,"errorMessage":"No auth profile found. Run `zeroclaw auth login --model-provider <provider>` first.","messagePattern":"No auth profile found\\. Run `zeroclaw auth login --model-provider <provider>` first\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":7593,"sourceCode":"            };\n            let status = provider\n                .flow()\n                .refresh_status(&ctx, profile.as_deref())\n                .await?;\n            match status {\n                auth::RefreshStatus::Refreshed { profile } => {\n                    println!(\n                        \"{}\",\n                        ta(\n                            \"cli-auth-refresh-ok\",\n                            &[(\"profile\", &profile)],\n                            \"Token refresh OK\"\n                        )\n                    );\n                    Ok(())\n                }\n                auth::RefreshStatus::NoProfile => {\n                    bail!(\n                        \"No auth profile found. Run `zeroclaw auth login --model-provider <provider>` first.\",\n                    )\n                }\n            }\n        }\n\n        AuthCommands::Logout {\n            model_provider,\n            profile,\n        } => {\n            let model_provider = auth::normalize_model_provider(&model_provider)?;\n            let removed = auth_service\n                .remove_profile(&model_provider, &profile)\n                .await?;\n            if removed {\n                println!(\n                    \"{}\",\n                    ta(","sourceCodeStart":7575,"sourceCodeEnd":7611,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/src/main.rs#L7575-L7611","documentation":"`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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Log in first: `zeroclaw auth login --model-provider <provider>` (add `--profile <name>` if you use named profiles)","Check the provider slug and profile name — refresh must target the exact pair used at login","If a raw token is all you have, `zeroclaw auth paste-token`/`setup-token` also creates the profile, after which refresh works"],"exampleFix":"# before\nzeroclaw auth refresh --model-provider anthropic   # never logged in on this machine\n# after\nzeroclaw auth login --model-provider anthropic\nzeroclaw auth refresh --model-provider anthropic","handlingStrategy":"fallback","validationCode":"# verify a profile exists before refreshing\nzeroclaw auth status --model-provider \"$p\" 2>/dev/null | grep -q . \\\n  || echo \"no stored profile; login will be required\" >&2","typeGuard":null,"tryCatchPattern":"if ! zeroclaw auth refresh --model-provider \"$p\" 2>/tmp/auth_err; then\n  grep -q \"No auth profile found\" /tmp/auth_err \\\n    && zeroclaw auth login --model-provider \"$p\" \\\n    && zeroclaw auth refresh --model-provider \"$p\" \\\n    || { cat /tmp/auth_err; exit 1; }\nfi","preventionTips":["Bootstrap scripts should run login before any refresh, idempotently","Pin the ZeroClaw config/data directory in CI so profiles are not silently missing","Verify provider slug and profile name match the ones used at login"],"tags":["auth","refresh","profile","credentials","zeroclaw"],"backgroundTag":"missing-auth-credentials","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}