wasmerio/wasmer · error
The backend did not return any nonce to auth the login!
Error message
The backend did not return any nonce to auth the login!
What it means
Browser-based login starts by calling `create_nonce` on the Wasmer backend to obtain a `Nonce` containing an `auth_url`. If the backend's response resolves to `None` (no nonce created), the CLI raises this error because it cannot proceed to open an auth URL. It signals the backend refused or failed to start the OAuth-style login flow.
Source
Thrown at lib/cli/src/commands/auth/login/mod.rs:99
&self,
client: &WasmerClient,
) -> anyhow::Result<AuthorizationState> {
let (listener, server_url) = setup_listener().await?;
let (server_shutdown_tx, mut server_shutdown_rx) = tokio::sync::mpsc::channel::<bool>(1);
let (token_tx, mut token_rx) = tokio::sync::mpsc::channel::<AuthorizationState>(1);
// Create a new AppContext
let app_context = BrowserAuthContext {
server_shutdown_tx,
token_tx,
};
let Nonce { auth_url, .. } =
wasmer_backend_api::query::create_nonce(client, "wasmer-cli".to_string(), server_url)
.await?
.ok_or_else(|| {
anyhow::anyhow!("The backend did not return any nonce to auth the login!")
})?;
// if failed to open the browser, then don't error out just print the auth_url with a message
println!("Opening auth link in your default browser: {}", &auth_url);
println!(
"{}: If browser driven login does not work, manually create a token at https://wasmer.io/settings/access-tokens and log in with `wasmer login <TOKEN>`",
"NOTE".yellow().bold()
);
opener::open_browser(&auth_url).unwrap_or_else(|_| {
println!(
"⚠️ Failed to open the browser.\n
Please open the url: {}",
&auth_url
);
});
// Jump through hyper 1.0's hoops...
let graceful = GracefulShutdown::new();View on GitHub (pinned to 8c4b9ee9d3)
Solutions
- Retry `wasmer login` after checking https://wasmer.io status / your connectivity.
- Verify the registry endpoint is the official backend (wasmer.wasmer.wtf/graphql or similar) and supports nonce creation.
- Fall back to token login: create a token at https://wasmer.io/settings/access-tokens and run `wasmer login <TOKEN>`.
- Check whether a corporate proxy is mangling GraphQL responses.
Example fix
// fallback for users in restricted environments // before $ wasmer login // error: The backend did not return any nonce to auth the login! // after: use a manually created token $ wasmer login eyJhbGciOi... # token from https://wasmer.io/settings/access-tokens
Defensive patterns
Strategy: fallback
Validate before calling
// check backend reachability before attempting browser login
curl -fsS https://registry.wasmer.io/graphql -X POST \
-H 'content-type: application/json' \
-d '{"query":"{ __typename }"}' > /dev/null && echo backend-ok Prevention
- Prefer token-based login (`wasmer login <TOKEN>`) in CI or restricted networks.
- Check backend status before interactive login sessions.
- Ensure the configured registry endpoint supports nonce creation (official backend, not a proxy).
When it happens
Trigger: `wasmer login` (browser flow) → `get_token_from_browser` → `create_nonce(client, "wasmer-cli", server_url)` returns `None`.
Common situations: Backend outage or degraded GraphQL API; pointing the CLI at a registry endpoint that does not support nonce creation (custom/proxy registry); network middleware stripping the response payload.
Related errors
- ❌ Failed to receive token from localhost
- Not logged in!
- Not logged into registry {host_str}: {e}
- user agent must not be empty
- invalid value for {} - expected 0/false|1/true: '{other}'
AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01).
Data as JSON: /api/errors/e065819a91f1c78b.
Report an issue: GitHub.