Kuberwastaken/claurst · error

Upload failed with status

Error message

Upload failed with status {}

What it means

Catch-all for the team-memory batch upload: the server answered with a status outside the handled set (2xx/412/413/401/403) — the formatted code is the unclassified status, typically a 5xx or proxy error. The batch was not accepted.

Solutions

  1. Retry the push after a short delay; transient errors usually clear
  2. Capture the status and response body if it persists to classify the failure
  3. Local checksums are unchanged, so the next successful push re-uploads the same batch safely
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src-rust/crates/core/src/team_memory_sync.rs:339 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10). Data as JSON: /api/errors/ae386a33c8075a52. Report an issue: GitHub.

Appendix: source

Thrown at src-rust/crates/core/src/team_memory_sync.rs:339

                if let Some(etag) = response
                    .headers()
                    .get("etag")
                    .and_then(|v| v.to_str().ok())
                {
                    state.last_known_etag = Some(etag.to_string());
                }
                // Update local checksum map to reflect uploaded state
                for entry in &batch {
                    state
                        .server_checksums
                        .insert(entry.key.clone(), entry.checksum.clone());
                }
                Ok(())
            }
            412 => anyhow::bail!("Conflict (412 Precondition Failed): ETag mismatch, retry needed"),
            413 => anyhow::bail!("Payload too large (413)"),
            401 | 403 => anyhow::bail!("Authentication error ({})", status),
            _ => anyhow::bail!("Upload failed with status {}", status),
        }
    }

    /// Recursively scan `team_dir` for `.md` files, returning entries sorted by key.
    async fn scan_local_files(&self) -> Result<Vec<TeamMemoryEntry>> {
        let mut entries = Vec::new();

        if !self.team_dir.exists() {
            return Ok(entries);
        }

        // Iterative DFS using an explicit stack to avoid deep recursion
        let mut stack = vec![self.team_dir.clone()];

        while let Some(dir) = stack.pop() {
            let mut read_dir = tokio::fs::read_dir(&dir)
                .await
                .with_context(|| format!("read_dir {:?}", dir))?;

View on GitHub (pinned to b0637c97ec)