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

Slack outbound attachment exceeds

Error message

Slack outbound attachment exceeds {} bytes: {}

What it means

Raised in upload_outbound_attachment when a file staged for Slack upload exceeds SLACK_OUTBOUND_ATTACHMENT_MAX_BYTES. Fires only on the disk-backed path where the attachment is a workspace file whose metadata length is checked before upload; the size guard exists because Slack rejects oversized uploads, so the failure is caught locally first.

Solutions

  1. Split the attachment into smaller files below the Slack size limit, or share it via a workspace link instead of uploading.
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

            );
        }

        let metadata = tokio::fs::metadata(&canonical_path)
            .await
            .with_context(|| {
                format!(
                    "failed to stat Slack outbound attachment {}",
                    canonical_path.display()
                )
            })?;
        if !metadata.is_file() {
            anyhow::bail!(
                "Slack outbound attachment target is not a file: {}",
                canonical_path.display()
            );
        }
        if metadata.len() > SLACK_OUTBOUND_ATTACHMENT_MAX_BYTES as u64 {
            anyhow::bail!(
                "Slack outbound attachment exceeds {} bytes: {}",
                SLACK_OUTBOUND_ATTACHMENT_MAX_BYTES,
                canonical_path.display()
            );
        }

        let data = tokio::fs::read(&canonical_path).await.with_context(|| {
            format!(
                "failed to read Slack outbound attachment {}",
                canonical_path.display()
            )
        })?;
        let file_name = canonical_path
            .file_name()
            .and_then(|name| name.to_str())
            .and_then(Self::sanitize_attachment_filename)
            .unwrap_or_else(|| "attachment.bin".to_string());
        let mime_type = match marker.kind {

View on GitHub (pinned to 88bb9c8533)