Zackriya-Solutions/meetily · error

Invalid Content-Range total: {}

Error message

Invalid Content-Range total: {}

What it means

Thrown by parse_content_range when the total-size component after '/' in the Content-Range header fails integer parsing. The range bounds parsed but the total file size is not a valid unsigned integer, preventing verification that the resumed download matches the expected artifact size.

Source

Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:224

            .map(|total| ContentRange::Unsatisfied { total })
            .map_err(|e| anyhow!("Invalid unsatisfied Content-Range total: {}", e));
    }

    let (range, total) = value
        .split_once('/')
        .ok_or_else(|| anyhow!("Malformed Content-Range: {}", value))?;
    let (start, end) = range
        .split_once('-')
        .ok_or_else(|| anyhow!("Malformed Content-Range range: {}", value))?;
    let start = start
        .parse()
        .map_err(|e| anyhow!("Invalid Content-Range start: {}", e))?;
    let end = end
        .parse()
        .map_err(|e| anyhow!("Invalid Content-Range end: {}", e))?;
    let total = total
        .parse()
        .map_err(|e| anyhow!("Invalid Content-Range total: {}", e))?;
    if start > end {
        return Err(anyhow!("Content-Range start exceeds end: {}", value));
    }

    Ok(ContentRange::Range { start, end, total })
}

#[derive(Debug)]
pub enum ParakeetEngineError {
    ModelNotLoaded,
    ModelNotFound(String),
    TranscriptionFailed(String),
    DownloadFailed(String),
    IoError(std::io::Error),
    Other(String),
}

impl std::fmt::Display for ParakeetEngineError {

View on GitHub (pinned to a2cb62e827)

Solutions

  1. Fix the server to emit a numeric total, or 'bytes */total' only in 416 responses
  2. Treat total '*' as unknown in the parser and skip total-based verification
  3. Compare downloaded bytes against artifact.exact_bytes from the ArtifactSpec instead of the header total
  4. Test the mirror with curl -r and check the header directly

Example fix

// before: total must parse or error
let total: u64 = total_raw.parse().map_err(|e| anyhow!("Invalid Content-Range total: {}", e))?;
// after: tolerate '*' unknown total
let total: u64 = if total_raw == "*" { artifact.exact_bytes } else { total_raw.parse().map_err(|e| anyhow!("Invalid Content-Range total: {}", e))? };
Defensive patterns

Strategy: fallback

Validate before calling

fn total_is_numeric(v: &str) -> bool { v.trim().rsplit('/').next().map_or(false, |t| t == "*" || t.parse::<u64>().is_ok()) }

Try / catch

match parse_content_range(v) { Err(e) if e.to_string().contains("total") => { log::warn!("unknown total, verify against spec size"); verify_against_artifact_spec(downloaded_len) }, other => other }

Prevention

When it happens

Trigger: Content-Range like 'bytes 0-1023/unknown' or 'bytes 0-1023/' from the model server while validate_partial_response validates a partial Parakeet artifact download.

Common situations: Servers that legally send '*' for unknown totals on other endpoints but whose responses reach this strict parser; misconfigured CDNs; custom mirrors that write textual sizes ('2.2GB').

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@a2cb62e827 (2026-09-12). Data as JSON: /api/errors/90c82aa1db78aaaa. Report an issue: GitHub.