wasmerio/wasmer · warning
Not logged into registry {host_str}
Error message
Not logged into registry {host_str} What it means
`wasmer logout` needs an authenticated client for the registry to identify the current user. If `env.client()` fails — meaning there is no stored login token for this registry — the CLI raises `Not logged into registry {host_str}`. The same message is reused when the `current_user` query succeeds but returns no user.
Source
Thrown at lib/cli/src/commands/auth/logout.rs:40
#[async_trait::async_trait]
impl AsyncCliCommand for Logout {
type Output = ();
async fn run_async(self) -> Result<Self::Output, anyhow::Error> {
let registry = self.env.registry_endpoint()?.to_string();
let host_str = self
.env
.registry_public_url()
.map_err(|_| anyhow::anyhow!("No registry not specified!"))?
.host_str()
.unwrap()
.bold();
let client = self
.env
.client()
.map_err(|_| anyhow::anyhow!("Not logged into registry {host_str}"))?;
let user = wasmer_backend_api::query::current_user(&client)
.await
.map_err(|e| anyhow::anyhow!("Not logged into registry {host_str}: {e}"))?
.ok_or_else(|| anyhow::anyhow!("Not logged into registry {host_str}"))?;
let theme = dialoguer::theme::ColorfulTheme::default();
let prompt = dialoguer::Confirm::with_theme(&theme).with_prompt(format!(
"Log user {} out of registry {host_str}?",
user.username
));
if prompt.interact()? || self.non_interactive {
let mut config = self.env.config()?;
let token = config
.registry
.get_login_token_for_registry(®istry)
.unwrap();View on GitHub (pinned to 8c4b9ee9d3)
Solutions
- Log in first: `wasmer login` (or `wasmer login <TOKEN>`), then retry logout.
- Confirm you are targeting the registry you actually logged into (`wasmer config get-registry`).
- Check ~/.wasmer/wasmer.toml for a login token entry for {host_str}.
- If already logged out, no action is needed — this error just indicates there is nothing to log out of.
Example fix
// before $ wasmer logout # never logged in // error: Not logged into registry registry.wasmer.io // after $ wasmer login $ wasmer logout
Defensive patterns
Strategy: validation
Validate before calling
# check for a stored token before attempting logout
[ -n "$(grep 'token' ~/.wasmer/wasmer.toml 2>/dev/null)" ] || {
echo "not logged in - logout not needed";
exit 0;
} Try / catch
// treat 'Not logged into registry' as an idempotent no-op in scripts if wasmer logout 2>&1 | grep -q 'Not logged into registry'; then echo "already logged out; continuing" fi
Prevention
- Make logout idempotent in scripts: tolerate 'not logged in' outcomes.
- Check `wasmer whoami` before logout to confirm an active session.
- Ensure the target registry matches the one you logged into.
When it happens
Trigger: `wasmer logout` when no token is stored for the registry host (env.client() errors), or `current_user(&client)` returns `None` despite a client being constructible.
Common situations: Running logout without ever having logged in; logging out of registry A while the token is stored for registry B; cleared ~/.wasmer dir removing the stored token; expired token that backend rejects as anonymous.
Related errors
- No registry not specified!
- Not logged into registry {host_str}: {e}
- Could not find package with hash '{h}'
- Template '{template}' not found in the registry
- The backend did not return any nonce to auth the login!
AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01).
Data as JSON: /api/errors/114d0913e2fa1e42.
Report an issue: GitHub.