{"record":{"id":"4cd381c95df42902","repo":"Zackriya-Solutions/meetily","slug":"content-range-start-exceeds-end","errorCode":null,"errorMessage":"Content-Range start exceeds end: {}","messagePattern":"Content-Range start exceeds end: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":226,"sourceCode":"    }\n\n    let (range, total) = value\n        .split_once('/')\n        .ok_or_else(|| anyhow!(\"Malformed Content-Range: {}\", value))?;\n    let (start, end) = range\n        .split_once('-')\n        .ok_or_else(|| anyhow!(\"Malformed Content-Range range: {}\", value))?;\n    let start = start\n        .parse()\n        .map_err(|e| anyhow!(\"Invalid Content-Range start: {}\", e))?;\n    let end = end\n        .parse()\n        .map_err(|e| anyhow!(\"Invalid Content-Range end: {}\", e))?;\n    let total = total\n        .parse()\n        .map_err(|e| anyhow!(\"Invalid Content-Range total: {}\", e))?;\n    if start > end {\n        return Err(anyhow!(\"Content-Range start exceeds end: {}\", value));\n    }\n\n    Ok(ContentRange::Range { start, end, total })\n}\n\n#[derive(Debug)]\npub enum ParakeetEngineError {\n    ModelNotLoaded,\n    ModelNotFound(String),\n    TranscriptionFailed(String),\n    DownloadFailed(String),\n    IoError(std::io::Error),\n    Other(String),\n}\n\nimpl std::fmt::Display for ParakeetEngineError {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        match self {","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L208-L244","documentation":"A semantic validation in parse_content_range: after successful parsing, the start offset of the Content-Range byte range is greater than the end offset, which is impossible for a valid partial-content response. The server's resume response claims a reversed/inconsistent range.","triggerScenarios":"A 206 response header like 'bytes 1023-0/2048' reaches validate_partial_response while resuming a Parakeet model download, or a buggy server echoes the requested range in the wrong order.","commonSituations":"Server bugs in range handling; proxies rewriting Range requests incorrectly; custom mirror implementations that compute offsets with swapped arguments.","solutions":["Log the full Content-Range value (echoed in the error) to confirm the reversal","Fix or replace the mirror/server emitting reversed ranges","Delete the partial download file and restart the model download from scratch","Send an explicit Range header from the client and verify the server echoes it correctly"],"exampleFix":"// before: trust server range blindly\n// server sent: Content-Range: bytes 1023-0/2048 -> error\n// after: clamp by re-requesting from the actual file size\nlet resume_from = std::fs::metadata(&partial_path)?.len();\nrequest.header(\"Range\", format!(\"bytes={}-\", resume_from));","handlingStrategy":"retry","validationCode":"fn range_is_ordered(v: &str) -> bool { v.trim().trim_start_matches(\"bytes \").split('/').next().and_then(|r| r.split_once('-')).map_or(false, |(s, e)| s.trim().parse::<u64>().ok().zip(e.trim().parse::<u64>().ok()).map_or(false, |(s, e)| s <= e)) }","typeGuard":null,"tryCatchPattern":"match parse_content_range(v) { Err(e) if e.to_string().contains(\"exceeds end\") => { log::warn!(\"server sent reversed range, restarting download\"); delete_partial_file(); start_full_download() }, other => other }","preventionTips":["Always send an explicit Range header and verify the server echoes it correctly","Delete the partial file when resume validation fails instead of trusting the server","Pin to well-tested mirrors/static file servers"],"tags":["http","content-range","validation","resumable-download"],"backgroundTag":"value-out-of-range","analyzedSha":"a2cb62e827da7ef59f65064c97233efb2313878e","analyzedAt":"2026-09-12T11:12:14.152Z","contentChangedAt":"2026-09-12T11:12:14.152Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}