Zackriya-Solutions/meetily · error
Malformed Content-Range: {}
Error message
Malformed Content-Range: {} What it means
This error is thrown by parse_content_range in the Parakeet model downloader when the HTTP Content-Range header value returned by the model server cannot be split into 'start-end/total' form: split_once('/') found no '/' separator. It indicates the server's resume/range response header is structurally malformed or missing the expected syntax.
Source
Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:212
fn parse_content_range(value: &reqwest::header::HeaderValue) -> Result<ContentRange> {
let value = value
.to_str()
.map_err(|e| anyhow!("Invalid Content-Range header encoding: {}", e))?;
let value = value
.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 })
}View on GitHub (pinned to a2cb62e827)
Solutions
- Verify the model download URL points at a server that returns RFC 7233-compliant Content-Range headers on 206 responses
- Log the raw Content-Range value to see what the server actually returned
- Test with curl -r 0-99 <url> -D - to inspect the header the mirror sends
- Use a different mirror/source_base_url for the Parakeet model artifacts
- Check for proxies/CDNs that strip Content-Range and bypass them
Example fix
// before (server sends malformed header, hard failure)
let (range, total) = value.split_once('/').ok_or_else(|| anyhow!("Malformed Content-Range: {}", value))?;
// after (tolerate missing total as unknown)
let (range, total) = match value.split_once('/') { Some(p) => p, None => (value.as_str(), "*") }; Defensive patterns
Strategy: validation
Validate before calling
fn looks_like_content_range(v: &str) -> bool { let main = v.trim().trim_start_matches("bytes "); main.contains('/') && main.split('/').next().map_or(false, |r| r.contains('-')) } Type guard
fn is_valid_content_range(v: &Option<String>) -> bool { v.as_deref().map(looks_like_content_range).unwrap_or(false) } Prevention
- Use mirrors known to emit RFC 7233 Content-Range headers
- Probe the download URL with a curl range request before wiring it into config
- Log raw headers on 206 responses during integration testing
When it happens
Trigger: A model-download resume/probe response (validate_partial_response or validate_unsatisfied_response path) supplies a Content-Range header without a '/' character, e.g. 'bytes 0-1023' instead of 'bytes 0-1023/2048', or an empty/garbage header value.
Common situations: A reverse proxy or CDN strips or rewrites the Content-Range header; the server returns an error body with a partial header; a non-compliant static file server is used as the model mirror.
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.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Malformed Content-Range range: {}
- Invalid Content-Range total: {}
- Invalid Content-Range start: {}
- Invalid Content-Range end: {}
- Content-Range start exceeds end: {}
AI-assisted analysis of Zackriya-Solutions/meetily@a2cb62e827 (2026-09-12).
Data as JSON: /api/errors/4e3cd9827c7b6d50.
Report an issue: GitHub.