Zackriya-Solutions/meetily · error

416 response is missing Content-Range

Error message

416 response is missing Content-Range

What it means

When the server does return 416 to the size-probe Range request, HTTP requires a Content-Range: bytes */<total> header declaring the full resource size. validate_unsatisfied_response throws this error when the 416 response arrives without that header, so the engine cannot confirm the file's exact byte length.

Source

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

                    content_length,
                    expected_length
                ));
            }
        }
        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>>,

View on GitHub (pinned to a2cb62e827)

Solutions

  1. Fix or replace the model server so 416 responses include Content-Range: bytes */<total> (RFC 9110 compliant).
  2. Test with curl -r <size>- -i <url> and inspect whether Content-Range is present.
  3. Bypass header-stripping gateways/proxies by using the upstream host directly.
  4. Delete the partial file and re-download from a compliant source (e.g. huggingface.co).

Example fix

// before (non-compliant server reply)
HTTP/1.1 416 Requested Range Not Satisfiable
// after (compliant)
HTTP/1.1 416 Requested Range Not Satisfiable
Content-Range: bytes */2439443128
Defensive patterns

Strategy: fallback

Validate before calling

// check a 416 reply carries Content-Range
curl -s -D - -o /dev/null -r 999999999- <base_url>/<filename> | grep -i content-range

Try / catch

if let Err(e) = download_result {
    if e.to_string().contains("missing Content-Range") {
        // server is RFC-noncompliant: force a full re-download instead of resume
        delete_partial(model_dir, filename)?;
        return retry_download_fresh().await;
    }
    return Err(e.into());
}

Prevention

When it happens

Trigger: A server (or intermediary) replies 416 to the Range: bytes=<exact_bytes>- probe but omits the Content-Range header entirely.

Common situations: Hand-rolled or minimal HTTP file servers that send 416 without Content-Range; misconfigured API gateways that drop headers on error responses; older or non-compliant static file servers.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@a2cb62e827 (2026-09-12). Data as JSON: /api/errors/e1c66d7396b397ad. Report an issue: GitHub.