Zackriya-Solutions/meetily · error
416 response reports {} total bytes, expected {}
Error message
416 response reports {} total bytes, expected {} What it means
After receiving a 416 with a Content-Range: bytes */<total> header, the engine checks that the server's declared total file size matches the artifact's known exact_bytes. This error fires when the sizes disagree, meaning the remote file differs from what the local artifact spec expects (changed, truncated, or wrong file).
Source
Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:803
}
}
Ok(())
}
fn validate_unsatisfied_response(response: &reqwest::Response, exact_bytes: u64) -> Result<()> {
if response.status() != reqwest::StatusCode::RANGE_NOT_SATISFIABLE {
return Err(anyhow!(
"Expected range-not-satisfiable 416 response, received {}",
response.status()
));
}
let content_range = response
.headers()
.get(reqwest::header::CONTENT_RANGE)
.ok_or_else(|| anyhow!("416 response is missing Content-Range"))?;
match parse_content_range(content_range)? {
ContentRange::Unsatisfied { total } if total == exact_bytes => Ok(()),
ContentRange::Unsatisfied { total } => Err(anyhow!(
"416 response reports {} total bytes, expected {}",
total,
exact_bytes
)),
ContentRange::Range { .. } => Err(anyhow!("416 response has a satisfied Content-Range")),
}
}
async fn download_model_detailed_from_source(
&self,
model_name: &str,
model_dir: &Path,
base_url: &str,
artifacts: &[ArtifactSpec],
progress_callback: Option<Box<dyn Fn(DownloadProgress) + Send>>,
) -> Result<()> {
let active_download = self.reserve_active_download(model_name).await?;
self.set_downloading_status(model_name, 0).await;View on GitHub (pinned to a2cb62e827)
Solutions
- Pin the download to the exact upstream revision/commit the artifact sizes were generated from.
- Update the artifact manifest (filename/exact_bytes) to match the current remote files.
- Clear the model cache directory and re-download from the canonical source.
- Verify with curl -sI <url> that Content-Length matches exact_bytes.
Example fix
// before: stale manifest after upstream re-upload
ArtifactSpec { filename: "model.int8.onnx", exact_bytes: 1_203_331_072 }
// after: refreshed to match current remote file
ArtifactSpec { filename: "model.int8.onnx", exact_bytes: 1_208_552_448 } Defensive patterns
Strategy: validation
Validate before calling
// confirm remote size matches the expected artifact size before download
const expected: u64 = 1_203_331_072; // artifact.exact_bytes
let len: u64 = reqwest::head(url).await?.headers()[CONTENT_LENGTH]
.to_str()?.parse()?;
assert_eq!(len, expected, "remote artifact size drifted; pin a revision"); Try / catch
match download_result {
Err(e) if e.to_string().contains("total bytes, expected") => {
// upstream changed: pin the exact revision or refresh the manifest
refresh_artifact_manifest().await?;
retry_download().await
}
other => other,
} Prevention
- Pin downloads to an immutable upstream revision/commit hash.
- Keep artifact exact_bytes in sync when bumping model versions.
- Verify Content-Length with a HEAD request before large downloads.
- Clear CDN caches for the model host after upstream updates.
When it happens
Trigger: The remote model artifact at base_url has a different byte length than the hardcoded artifact.exact_bytes — typically because the upstream file was updated/re-uploaded, the mirror serves a different variant, or the artifact manifest is stale.
Common situations: Upstream model repo updated to a new revision while the app still ships old expected sizes; a mirror serving quantized vs full variant; manually edited artifact specs; CDN serving a stale cached copy.
Understand the failure class
Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.
Related errors
- Full response declared {} bytes, expected {}
- Expected partial 206 response, received {}
- Partial response range {}-{} / {} does not match {}-{} / {}
- Expected range-not-satisfiable 416 response, received {}
- 416 response is missing Content-Range
AI-assisted analysis of Zackriya-Solutions/meetily@a2cb62e827 (2026-09-12).
Data as JSON: /api/errors/49f7888e53cd2892.
Report an issue: GitHub.