Zackriya-Solutions/meetily · error · anyhow::Error

Unsupported model for download validation: {}

Error message

Unsupported model for download validation: {}

What it means

finish_download derives the minimum acceptable file size by looking the model name up in WHISPER_MODEL_CATALOG. If the name is not in the catalog, expected_min_size is None and this error is thrown: the app cannot validate a download for a model it has no size metadata for. Downloading via the public download_model() can't hit it (names are pre-validated against the URL match), so it indicates a name/catalog mismatch, typically via download_model_from_url or a stale catalog.

Source

Thrown at frontend/src-tauri/src/whisper_engine/whisper_engine.rs:990

                let expected_min_size = WHISPER_MODEL_CATALOG
                    .iter()
                    .find(|model| model.0 == model_name)
                    .map(|model| ((model.2 as f64 * 0.9) as u64) * 1024 * 1024);

                result = match expected_min_size {
                    Some(expected_min_size) => match fs::metadata(file_path).await {
                        Ok(metadata) if metadata.len() >= expected_min_size => Ok(()),
                        Ok(metadata) => Err(anyhow!(
                            "Downloaded model file is too small: {} bytes (expected at least {} bytes)",
                            metadata.len(),
                            expected_min_size
                        )),
                        Err(e) => Err(anyhow!(
                            "Failed to read downloaded model file metadata: {}",
                            e
                        )),
                    },
                    None => Err(anyhow!(
                        "Unsupported model for download validation: {}",
                        model_name
                    )),
                };
            }
        }

        if result.is_err() && !active_download.cancellation.is_cancelled() && file_path.exists() {
            if let Err(e) = fs::remove_file(file_path).await {
                log::warn!("Failed to clean up failed download file: {}", e);
            } else {
                log::info!("Cleaned up failed download file: {}", file_path.display());
            }
        }

        let (released_active_owner, cancellation_won) = {
            let mut active_downloads = self.active_downloads.lock().await;
            match active_downloads.get(model_name) {

View on GitHub (pinned to a2cb62e827)

Solutions

  1. Add an entry for the model name to WHISPER_MODEL_CATALOG (name, url/key, size in MB) so min-size validation can run.
  2. Ensure download_model()'s URL match and WHISPER_MODEL_CATALOG use identical names — make one the single source of truth.
  3. Verify the exact model_name string being passed (typos, old names like 'large' vs 'large-v3') — it must match a catalog key exactly.
  4. If the model genuinely has no known size, either skip validation for it explicitly or register a conservative minimum size.

Example fix

// before: URL table knows the name but catalog doesn't
"large-v3-turbo" => "https://huggingface.co/.../ggml-large-v3-turbo.bin",
// WHISPER_MODEL_CATALOG: missing ("large-v3-turbo", url, size) entry
// after: add the catalog entry so finish_download can validate
// WHISPER_MODEL_CATALOG
("large-v3-turbo", "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo.bin", 1620),
Defensive patterns

Strategy: validation

Validate before calling

fn is_downloadable_model(model_name: &str) -> bool {
    WHISPER_MODEL_CATALOG.iter().any(|(name, _, _)| *name == model_name)
}
// call before starting a download:
assert!(is_downloadable_model("large-v3-turbo"), "model not in catalog");

Type guard

fn catalog_entry(model_name: &str) -> Option<&( &'static str, &'static str, u64 )> {
    WHISPER_MODEL_CATALOG.iter().find(|(name, _, _)| *name == model_name)
}

Try / catch

match download_result {
    Err(e) if e.to_string().contains("Unsupported model for download validation") => {
        // name/catalog mismatch: surface which names ARE valid
        Err(anyhow!("unknown model '{}'; valid: {:?}", model_name,
            WHISPER_MODEL_CATALOG.iter().map(|(n, _, _)| *n).collect::<Vec<_>>()))
    }
    other => other,
}

Prevention

When it happens

Trigger: download_model_from_url() is called (directly or by a test/future code path) with a model_name string that has no entry in WHISPER_MODEL_CATALOG, or the catalog entry was removed/renamed while download_model()'s URL match arm still accepts the old name.

Common situations: Developer adds a new model to download_model()'s URL match but forgets to add it to WHISPER_MODEL_CATALOG; a model is renamed in the catalog but old UI/config still passes the old name; custom code or tests invoke download_model_from_url with an ad-hoc name.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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