zeroclaw-labs/zeroclaw · error · anyhow::Error

Slack apps.connections.open failed ({status}): {sanitized}

Error message

Slack apps.connections.open failed ({status}): {sanitized}

What it means

Error "Slack apps.connections.open failed ({status}): {sanitized}" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-channels/src/slack.rs:4010

            anyhow::Error::msg("Slack Socket Mode requires app_token")
        })?;

        let resp = self
            .http_client()
            .post("https://slack.com/api/apps.connections.open")
            .bearer_auth(app_token)
            .send()
            .await?;

        let status = resp.status();
        let body = resp
            .text()
            .await
            .unwrap_or_else(|e| format!("<failed to read response body: {e}>"));

        if !status.is_success() {
            let sanitized = zeroclaw_providers::sanitize_api_error(&body);
            anyhow::bail!("Slack apps.connections.open failed ({status}): {sanitized}");
        }

        let parsed: serde_json::Value = serde_json::from_str(&body).unwrap_or_default();
        if parsed.get("ok") == Some(&serde_json::Value::Bool(false)) {
            let err = parsed
                .get("error")
                .and_then(|e| e.as_str())
                .unwrap_or("unknown");
            anyhow::bail!("Slack apps.connections.open failed: {err}");
        }

        parsed
            .get("url")
            .and_then(|v| v.as_str())
            .map(ToOwned::to_owned)
            .ok_or_else(|| {
                ::zeroclaw_log::record!(
                    WARN,

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Verify the Slack app-level token (xapp-*) is valid and has connections:write scope; check the status/body returned.

When it happens

Trigger: Thrown at crates/zeroclaw-channels/src/slack.rs:4010 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/058984dc290ccc73. Report an issue: GitHub.