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

  1. Check your network connection and retry sign-in
  2. Make sure only one sign-in attempt runs at a time (close other Zed windows mid-auth)
  3. 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

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

Related errors


AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16). Data as JSON: /api/errors/f25cffbd98b6b363. Report an issue: GitHub.