{"record":{"id":"69903a82db9b0dfd","repo":"Zackriya-Solutions/meetily","slug":"whisper-transcription-failed-on-segment-69903a","errorCode":null,"errorMessage":"Whisper transcription failed on segment {}: {}","messagePattern":"Whisper transcription failed on segment (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/retranscription.rs","lineNumber":383,"sourceCode":"        if segment.samples.len() < 1600 {\n            debug!(\"Skipping short segment {} with {} samples\", i, segment.samples.len());\n            continue;\n        }\n\n        // Transcribe this segment\n        let (text, conf) = if use_parakeet {\n            let engine = parakeet_engine.as_ref().unwrap();\n            let text = engine\n                .transcribe_audio(segment.samples.clone())\n                .await\n                .map_err(|e| anyhow!(\"Parakeet transcription failed on segment {}: {}\", i, e))?;\n            (text, 0.9f32)\n        } else {\n            let engine = whisper_engine.as_ref().unwrap();\n            let (text, conf, _) = engine\n                .transcribe_audio_with_confidence(segment.samples.clone(), language.clone())\n                .await\n                .map_err(|e| anyhow!(\"Whisper transcription failed on segment {}: {}\", i, e))?;\n            (text, conf)\n        };\n\n        // Skip empty transcripts\n        let trimmed = text.trim();\n        if !trimmed.is_empty() {\n            debug!(\n                \"Segment {}/{}: {:.1}s, conf={:.2}, text='{}'\",\n                i + 1, processable_count, segment_duration_sec, conf,\n                if trimmed.len() > 80 { let mut end = 80; while !trimmed.is_char_boundary(end) { end -= 1; } &trimmed[..end] } else { trimmed }\n            );\n            all_transcripts.push((text, segment.start_timestamp_ms, segment.end_timestamp_ms));\n            total_confidence += conf;\n        } else {\n            debug!(\"Segment {}/{}: {:.1}s — empty transcription\", i + 1, processable_count, segment_duration_sec);\n        }\n    }\n","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/retranscription.rs#L365-L401","documentation":"WhisperEngine::transcribe_audio_with_confidence(samples, language) returned Err for segment i. The inner '{}' comes from whisper-rs/whisper.cpp: common causes are no model currently loaded on the engine, an unsupported language code, an invalid audio buffer, or out-of-memory loading context state for a long segment.","triggerScenarios":"Retranscribing with a language value whisper-rs rejects (not a valid ISO-639-1 code it supports); the Whisper model being unloaded mid-loop by another code path; a segment that still exceeds usable context after splitting; memory pressure with large-v3.","commonSituations":"User picks an explicit language in the retranscribe dialog that whisper rejects; running large models on machines with low VRAM/RAM; concurrent engine access from import or live pipeline.","solutions":["Read the inner error: if it mentions the language, pass a valid ISO-639-1 code or None for auto-detect.","Confirm the earlier 'Whisper model ... loaded successfully' log line appears - if not, the engine lost its model.","Switch to a smaller model (base/small) or free memory and retry.","If only one segment of many fails, a retry usually succeeds - transient state, not bad audio."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Validate language codes before passing them to whisper\nfn is_valid_whisper_language(lang: &Option<String>) -> bool {\n    match lang {\n        None => true,\n        Some(l) => l.len() == 2 && l.chars().all(|c| c.is_ascii_alphabetic()),\n    }\n}","typeGuard":null,"tryCatchPattern":"// Retry transient inference errors once; fail fast on language errors\nmatch engine.transcribe_audio_with_confidence(samples, language.clone()).await {\n    Ok(v) => v,\n    Err(e) if e.to_string().contains(\"language\") => return Err(anyhow!(\"invalid language {language:?}: {e}\")),\n    Err(e) => { /* one retry, then propagate with segment index */ }\n}","preventionTips":["Pass only valid ISO-639-1 language codes or None.","Do not unload or swap Whisper models while a retranscription loop is active.","Choose a model size that fits machine memory before batch jobs."],"tags":["whisper","whisper-cpp","transcription","audio"],"backgroundTag":"asr-engine-inference-failed","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}