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

Slack outbound attachment is empty: {}

Error message

Slack outbound attachment is empty: {}

What it means

Error "Slack outbound attachment is empty: {}" thrown in zeroclaw-labs/zeroclaw.

Source

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

            mime_type,
        })
    }

    async fn upload_outbound_attachment(
        &self,
        channel_id: &str,
        thread_ts: Option<&str>,
        attachment: &MediaAttachment,
    ) -> anyhow::Result<()> {
        if attachment.data.len() > SLACK_OUTBOUND_ATTACHMENT_MAX_BYTES {
            anyhow::bail!(
                "Slack outbound attachment exceeds {} bytes: {}",
                SLACK_OUTBOUND_ATTACHMENT_MAX_BYTES,
                attachment.file_name
            );
        }
        if attachment.data.is_empty() {
            anyhow::bail!(
                "Slack outbound attachment is empty: {}",
                attachment.file_name
            );
        }

        let file_name = Self::sanitize_attachment_filename(&attachment.file_name)
            .unwrap_or_else(|| "attachment.bin".to_string());
        let length = attachment.data.len().to_string();
        let upload_resp = self
            .http_client()
            .post(self.slack_api_url("files.getUploadURLExternal"))
            .bearer_auth(&self.bot_token)
            .form(&[
                ("filename", file_name.as_str()),
                ("length", length.as_str()),
            ])
            .send()
            .await?;

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Check that the file being attached is not empty before calling Slack upload; regenerate or select a non-empty file.

When it happens

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