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

files.completeUploadExternal failed

Error message

files.completeUploadExternal failed: {err}

What it means

Raised when the final files.completeUploadExternal call that commits an uploaded file to a Slack channel returns ok=false. By this point the bytes were already uploaded; this error means the upload was staged but never finalized, so the message with the attachment is not delivered.

Solutions

  1. Ensure the upload session from files.getUploadURLExternal is still valid and complete it before expiry; retry the upload.
Defensive patterns

Strategy: retry

When it happens

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

Appendix: source

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

            }],
        });
        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()
            .await?;
        let complete_body: serde_json::Value = complete_resp.json().await?;
        if complete_body.get("ok") != Some(&serde_json::Value::Bool(true)) {
            let err = complete_body
                .get("error")
                .and_then(|value| value.as_str())
                .unwrap_or("unknown");
            anyhow::bail!("files.completeUploadExternal failed: {err}");
        }

        Ok(())
    }

    async fn upload_outbound_attachments(
        &self,
        channel_id: &str,
        thread_ts: Option<&str>,
        attachments: &[MediaAttachment],
    ) -> anyhow::Result<()> {
        for attachment in attachments
            .iter()
            .take(SLACK_ATTACHMENT_MAX_FILES_PER_MESSAGE)
        {
            self.upload_outbound_attachment(channel_id, thread_ts, attachment)
                .await?;
        }

View on GitHub (pinned to 88bb9c8533)