Zackriya-Solutions/meetily · warning
Invalid unsatisfied Content-Range total: {}
Error message
Invalid unsatisfied Content-Range total: {} What it means
For an unsatisfied range ('*/N' form), parse_content_range parses the total as u64. A non-numeric total after '*/' produces 'Invalid unsatisfied Content-Range total: {}'. This validates 416 responses so the client knows the resource size.
Source
Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:207
enum ContentRange {
Range { start: u64, end: u64, total: u64 },
Unsatisfied { total: u64 },
}
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 {View on GitHub (pinned to a2cb62e827)
Solutions
- Log the full header value and fix the server to emit a numeric total (Content-Range: bytes */123456).
- Check whether the server is actually an error/HTML page and handle that status separately.
- Fall back to re-downloading the whole file when the total cannot be trusted.
- Add a server-side test asserting the 416 response format.
Defensive patterns
Strategy: fallback
Try / catch
match parse_content_range(&header) {
Ok(ContentRange::Unsatisfied { total }) => set_resume_total(total),
Err(_) => {
warn!("unparseable 416 Content-Range; restarting download from scratch");
restart_full_download(url).await;
}
Ok(other) => handle(other),
} Prevention
- Confirm the 416 body is an HTTP error page, not the model file, before parsing.
- Require numeric totals in your model-server implementation; add tests.
- When the total is untrustworthy, restart the download from byte 0.
- Log the raw header for support diagnostics.
When it happens
Trigger: Server returns Content-Range: */<non-numeric> (e.g. '*/unknown' or '*/abc') on a 416, and validate_unsatisfied_response passes it to parse_content_range.
Common situations: Non-conforming or hand-rolled model server emitting placeholder totals; template-rendered header left unfilled ('*/{total}'); proxy error page masquerading as a 416 with junk header.
Related errors
- Content-Range must use bytes: {}
- Invalid Content-Range header encoding: {}
- Malformed Content-Range: {}
- Malformed Content-Range range: {}
- Invalid Content-Range start: {}
AI-assisted analysis of Zackriya-Solutions/meetily@a2cb62e827 (2026-09-12).
Data as JSON: /api/errors/384f14547f549a01.
Report an issue: GitHub.