{"record":{"id":"59d21d2e3e6cefbe","repo":"Zackriya-Solutions/meetily","slug":"source-file-not-found","errorCode":null,"errorMessage":"Source file not found: {}","messagePattern":"Source file not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/import.rs","lineNumber":323,"sourceCode":"    }\n\n    result\n}\n\n/// Internal function to run import\nasync fn run_import<R: Runtime>(\n    app: AppHandle<R>,\n    source_path: String,\n    title: String,\n    language: Option<String>,\n    model: Option<String>,\n    provider: Option<String>,\n) -> Result<ImportResult> {\n    let source = PathBuf::from(&source_path);\n\n    // Validate source file\n    if !source.exists() {\n        return Err(anyhow!(\"Source file not found: {}\", source.display()));\n    }\n\n    info!(\n        \"Starting import for '{}' from {} with language {:?}, model {:?}, provider {:?}\",\n        title, source_path, language, model, provider\n    );\n\n    // Determine which provider to use (default to whisper)\n    let use_parakeet = provider.as_deref() == Some(\"parakeet\");\n\n    emit_progress(&app, \"copying\", 5, \"Creating meeting folder...\");\n\n    // Check for cancellation\n    if IMPORT_CANCELLED.load(Ordering::SeqCst) {\n        return Err(anyhow!(\"Import cancelled\"));\n    }\n\n    // Create meeting folder","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/import.rs#L305-L341","documentation":"run_import (import.rs:323) re-checks Path::exists() on the source file at the start of the actual import, after start_import acquired the guard. This is a second, deeper existence check than validate_audio_file's - the file may have passed validation earlier (or validation was skipped) and then vanished before the copy stage. It fails fast before creating the meeting folder or copying anything.","triggerScenarios":"The file passed the earlier validate call but was deleted/renamed in between (sync eviction, quarantine, user cleanup); the frontend invoked import_audio_file directly with a stale path persisted from a previous session, without validating first; the removable drive holding the file was ejected between selection and import; a download still in progress rotated the .part file.","commonSituations":"Users picking a file, leaving the dialog open a long time, then clicking Import after the file moved; cloud-sync placeholders dehydrated; re-using last session's path via stored state; antivirus quarantine removing the file post-scan.","solutions":["Re-select the file with the picker and import immediately - closes the race in the common case.","Validate-then-import in one user action; do not stage the path across long waits or app restarts.","Check removable media is still mounted; copy large imports to local disk first if the source is a flaky network share.","If it recurs with the file visibly present, compare the logged path.display() against the real path for Unicode normalization or trailing-space differences.","Code-level: run validate_audio_file inside run_import too so both layers report the friendlier File-does-not-exist message consistently."],"exampleFix":"// frontend: before - path stored from a previous session\nawait invoke('import_audio_file', { sourcePath: lastSession.path, ... });\n\n// frontend: after - revalidate existence right before invoking\nimport { open } from '@tauri-apps/plugin-dialog';\nconst picked = await open({ multiple: false });\nif (!picked) return;\nawait invoke('validate_audio_file', { path: picked }); // throws if gone\nawait invoke('import_audio_file', { sourcePath: picked, ... });","handlingStrategy":"validation","validationCode":"// Frontend: existence check immediately before the import invoke\nimport { open } from '@tauri-apps/plugin-dialog';\nconst picked = await open({ multiple: false });\nif (!picked) return;\nawait invoke('validate_audio_file', { path: picked }); // throws if the file vanished\nawait invoke('import_audio_file', { sourcePath: picked });","typeGuard":null,"tryCatchPattern":"try { await invoke('import_audio_file', { sourcePath }); }\ncatch (e) {\n  if (String(e).includes('Source file not found')) promptRepickFile();\n  else throw e;\n}","preventionTips":["Validate and import in one user action; never stage source paths across restarts.","Keep removable media mounted through the whole import, or copy to local disk first.","Re-pick files after long dialog-idle periods.","Compare the logged path with the real one for Unicode/trailing-space differences."],"tags":["file","import","file-not-found","toctou","filesystem"],"backgroundTag":"file-not-found","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}