zed-industries/zed · warning
authentication canceled
Error message
authentication canceled
What it means
During interactive sign-in, the client races the credentials future against the client's own status event stream. If a new connection status arrives first (e.g. disconnect or error), sign-in is aborted with 'authentication canceled' — the credential flow never completed because the underlying connection state changed.
Source
Thrown at crates/client/src/client.rs:939
match authenticate {
Ok(creds) => {
if IMPERSONATE_LOGIN.is_none() {
self.credentials_provider
.write_credentials(creds.user_id, creds.access_token.clone(), cx)
.await
.log_err();
}
credentials = Some(creds);
},
Err(err) => {
self.set_status(Status::AuthenticationError, cx);
return Err(err);
}
}
}
_ = status_rx.next().fuse() => {
return Err(anyhow!("authentication canceled"));
}
}
}
let credentials = credentials.unwrap();
self.set_id(credentials.user_id);
self.cloud_client
.set_credentials(credentials.user_id as u32, credentials.access_token.clone());
self.state.write().credentials = Some(credentials.clone());
self.set_status(
if is_reauthenticating {
Status::Reauthenticated
} else {
Status::Authenticated
},
cx,
);
View on GitHub (pinned to bc538def45)
Solutions
- Check your network connection and retry sign-in
- Make sure only one sign-in attempt runs at a time (close other Zed windows mid-auth)
- If it repeats, check whether a proxy or VPN terminates the connection to zed.dev during auth
Defensive patterns
Strategy: retry
Try / catch
match client.sign_in(provider, cx).await {
Ok(creds) => Ok(creds),
Err(err) if err.to_string() == "authentication canceled" => {
// transient: connection status changed mid-flow; retry once after reconnect
client.wait_for_status(Status::Connected, cx).await?;
client.sign_in(provider, cx).await
}
Err(err) => Err(err),
} Prevention
- Do not trigger sign-in while the client is visibly reconnecting
- Keep a stable network path during browser-based auth flows
- Handle this error as retryable rather than fatal in wrappers
When it happens
Trigger: The status_rx stream yields while waiting for OAuth credentials: network drop mid sign-in, server closing the connection, the client reconnecting, or the sign-in prompt flow being torn down.
Common situations: Flaky Wi-Fi during browser-based sign-in; corporate proxies resetting long-lived connections; retrying sign-in while a previous attempt is still winding down.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- failed to bind callback port
- didn't receive login redirect
- No organization selected.
- Failed to parse UNIT_DATA as JSON: ${e.message}
- HTTP error! status: ${response.status}
AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16).
Data as JSON: /api/errors/f25cffbd98b6b363.
Report an issue: GitHub.