Zackriya-Solutions/meetily · error

Invalid Content-Range end: {}

Error message

Invalid Content-Range end: {}

What it means

Thrown by parse_content_range when the end component of the Content-Range byte range fails integer parsing (u64). The header splits correctly but the end offset is not a plain unsigned integer, so the received byte count cannot be validated.

Source

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

    if let Some(total) = value.strip_prefix("*/") {
        return total
            .parse()
            .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),

View on GitHub (pinned to a2cb62e827)

Solutions

  1. Inspect the malformed header echoed in the error message
  2. Fix the mirror to emit decimal end offsets in the form 'bytes start-end/total'
  3. Ensure the client does not pass 416-style 'bytes */total' values into the partial-response parser (those go through validate_unsatisfied_response instead)
  4. Trim stray whitespace/quotes from the header before parsing

Example fix

// before: header 'bytes 0-*/2048' routed to partial validation
// after: route '*' end values to the unsatisfied-range parser
if end_raw == "*" { return validate_unsatisfied_response(response); }
Defensive patterns

Strategy: validation

Validate before calling

fn end_is_numeric(v: &str) -> bool { v.trim().trim_start_matches("bytes ").split('/').next().and_then(|r| r.split('-').nth(1)).map_or(false, |s| s.trim().parse::<u64>().is_ok()) }

Try / catch

match parse_content_range(v) { Err(e) if e.to_string().contains("end") => { log::error!("malformed end offset: {v}"); restart_download() }, other => other }

Prevention

When it happens

Trigger: A 206 response Content-Range such as 'bytes 0-1k/2048' or 'bytes 0-/2048' (missing or non-numeric end) encountered while validate_partial_response checks a resumed Parakeet model download.

Common situations: Wildcard end values in a 206 (only legal in 416 Unsatisfied-Range forms); corrupted headers through proxies; hand-crafted mock server responses used in local testing.

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/d65ca3eb729d2e75. Report an issue: GitHub.