zed-industries/zed · error

Failed to get authenticated user. Status

Error message

Failed to get authenticated user.
Status: {:?}
Body: {body}

What it means

validate_credentials sent the authenticated user request with the supplied user_id/access_token and got a non-success, non-401 response; the status and body are embedded, meaning the check could not distinguish valid from invalid credentials because the server itself errored (5xx, rate limit, or gateway issue) rather than rejecting the token.

Solutions

  1. Retry validation after a backoff for transient server errors
  2. Inspect the embedded status/body to identify gateway or rate-limit issues
  3. Treat only 401 as invalid credentials; surface other statuses as connectivity problems
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/cloud_api_client/src/cloud_api_client.rs:264 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/7d6c84ec8f3c5a42. Report an issue: GitHub.

Appendix: source

Thrown at crates/cloud_api_client/src/cloud_api_client.rs:264

            ),
            AsyncBody::default(),
            Some(&Credentials {
                user_id,
                access_token: access_token.into(),
            }),
        )?;

        let mut response = self.http_client.send(request).await?;

        if response.status().is_success() {
            Ok(true)
        } else {
            let mut body = String::new();
            response.body_mut().read_to_string(&mut body).await?;
            if response.status() == StatusCode::UNAUTHORIZED {
                Ok(false)
            } else {
                Err(anyhow!(
                    "Failed to get authenticated user.\nStatus: {:?}\nBody: {body}",
                    response.status()
                ))
            }
        }
    }

    pub async fn submit_agent_feedback(&self, body: SubmitAgentThreadFeedbackBody) -> Result<()> {
        let request = Request::builder().method(Method::POST).uri(
            self.http_client
                .build_zed_cloud_url("/client/feedback/agent_thread")?
                .as_ref(),
        );

        self.send_authenticated_request(request, AsyncBody::from(serde_json::to_string(&body)?))
            .await?;
        Ok(())
    }

View on GitHub (pinned to f4178619ac)