Zackriya-Solutions/meetily · error

Invalid Content-Range start: {}

Error message

Invalid Content-Range start: {}

What it means

Thrown by parse_content_range when the start component of the Content-Range byte range fails integer parsing (u64). The header is structurally splitable but the start offset is not a valid unsigned integer.

Source

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

        .strip_prefix("bytes ")
        .ok_or_else(|| anyhow!("Content-Range must use bytes: {}", value))?;

    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),

View on GitHub (pinned to a2cb62e827)

Solutions

  1. Log the offending header value (included in the anyhow error context)
  2. Fix the server/proxy to emit plain decimal offsets
  3. Trim whitespace and any 'bytes ' prefix from the header before calling parse_content_range
  4. Verify the mirror with curl -r 0-99 <url> -D -

Example fix

// before
let start: u64 = start_raw.trim().parse().map_err(|e| anyhow!("Invalid Content-Range start: {}", e))?;
// after (strip 'bytes ' unit prefix first)
let start: u64 = start_raw.trim().trim_start_matches("bytes ").parse().map_err(|e| anyhow!("Invalid Content-Range start: {}", e))?;
Defensive patterns

Strategy: validation

Validate before calling

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

Try / catch

match parse_content_range(v) { Err(e) if e.to_string().contains("start") => { log::error!("server sent non-numeric start in Content-Range: {v}"); fall_back_to_full_download() }, other => other }

Prevention

When it happens

Trigger: Content-Range like 'bytes abc-1023/2048', a value containing whitespace or a '+' sign, or an 'unknown'-style placeholder where a number is expected, during download resume validation.

Common situations: Proxy-injected headers with units or comments; non-numeric placeholders from custom servers; locale or encoding issues corrupting digits; hand-edited test fixtures.

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