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

Model {} is corrupted and cannot be loaded

Error message

Model {} is corrupted and cannot be loaded

What it means

load_model matched ModelStatus::Corrupted { file_size, expected_min_size }: the ggml file exists but its size is below the known minimum for that model, detected by the model scanner. Loading would make whisper.cpp fail or emit garbage, so it is refused. The status fields tell you how short the file is.

Source

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

                // Enhanced acceleration status reporting
                let acceleration_status = acceleration.status_label();

                log::info!("Successfully loaded model: {} with {} (Performance Tier: {:?}, Beam Size: {}, Threads: {:?})",
                          model_name, acceleration_status, hardware_profile.performance_tier,
                          adaptive_config.beam_size, adaptive_config.max_threads);
                Ok(())
            },
            ModelStatus::Missing => {
                Err(anyhow!("Model {} is not downloaded", model_name))
            },
            ModelStatus::Downloading { .. } => {
                Err(anyhow!("Model {} is currently downloading", model_name))
            },
            ModelStatus::Error(ref err) => {
                Err(anyhow!("Model {} has error: {}", model_name, err))
            },
            ModelStatus::Corrupted { .. } => {
                Err(anyhow!("Model {} is corrupted and cannot be loaded", model_name))
            }
        }
    }

    pub async fn unload_model(&self) -> bool  {
        let mut ctx_guard = self.current_context.write().await;
        let unloaded = ctx_guard.take().is_some();
        if unloaded {
            log::info!("📉Whisper model unloaded");
        }

        let mut model_name_guard = self.current_model.write().await;
        model_name_guard.take();

        unloaded
    }

    pub async fn get_current_model(&self) -> Option<String> {

View on GitHub (pinned to 0281737d87)

Solutions

  1. Call delete_model(model_name) — it has a dedicated branch for Corrupted that removes the file and resets status to Missing — then download_model again
  2. Verify free disk space is at least the expected model size plus margin before re-downloading
  3. As a fallback, remove ggml-<name>.bin from the models directory manually and rescan

Example fix

// before
await invoke('load_whisper_model', { modelName }); // 'corrupted and cannot be loaded'

// after
await invoke('delete_model', { modelName });      // clears the corrupted file
await invoke('download_model', { modelName });     // fresh copy
await invoke('load_whisper_model', { modelName });
Defensive patterns

Strategy: fallback

Validate before calling

const models = await invoke<ModelInfo[]>('get_whisper_models');
const m = models.find(x => x.name === modelName);
if (m?.status === 'Corrupted') {
  await invoke('delete_model', { modelName });     // removes the short file, sets Missing
  await invoke('download_model', { modelName });   // fetch a clean copy
}
await invoke('load_whisper_model', { modelName });

Type guard

const isCorrupted = (m: ModelInfo | undefined): boolean => m?.status === 'Corrupted';

Try / catch

try {
  await invoke('load_whisper_model', { modelName });
} catch (e) {
  if (String(e).includes('corrupted')) {
    await invoke('delete_model', { modelName });
    await invoke('download_model', { modelName });
    await invoke('load_whisper_model', { modelName });
  } else { throw e; }
}

Prevention

When it happens

Trigger: Download was interrupted so only part of the ggml file was written; disk filled mid-write and truncated the file; calling load_model on such a truncated artifact.

Common situations: App killed during download; power loss; copying models with a tool that silently truncates large files; disk quota enforcement on network home directories.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16). Data as JSON: /api/errors/878debd69bd506a7. Report an issue: GitHub.