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

Slack file byte upload failed ({status}): {sanitized}

Error message

Slack file byte upload failed ({status}): {sanitized}

What it means

Error "Slack file byte upload failed ({status}): {sanitized}" thrown in zeroclaw-labs/zeroclaw.

Source

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

        let file_id = upload_body
            .get("file_id")
            .and_then(|value| value.as_str())
            .context("files.getUploadURLExternal response missing file_id")?;

        let upload_status = self
            .http_client()
            .post(upload_url)
            .body(attachment.data.clone())
            .send()
            .await?;
        let status = upload_status.status();
        if !status.is_success() {
            let raw = upload_status
                .text()
                .await
                .unwrap_or_else(|e| format!("<failed to read response body: {e}>"));
            let sanitized = zeroclaw_providers::sanitize_api_error(&raw);
            anyhow::bail!("Slack file byte upload failed ({status}): {sanitized}");
        }

        let mut complete_request = serde_json::json!({
            "channel_id": channel_id,
            "files": [{
                "id": file_id,
                "title": file_name,
            }],
        });
        if let Some(ts) = thread_ts {
            complete_request["thread_ts"] = serde_json::json!(ts);
        }
        let complete_resp = self
            .http_client()
            .post(self.slack_api_url("files.completeUploadExternal"))
            .bearer_auth(&self.bot_token)
            .json(&complete_request)
            .send()

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Inspect the returned status and body for the Slack upload URL failure; check network access to Slack and retry.

When it happens

Trigger: Thrown at crates/zeroclaw-channels/src/slack.rs:1177 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/10e62b8bde316f2e. Report an issue: GitHub.