{"record":{"id":"024437a906b78049","repo":"Zackriya-Solutions/meetily","slug":"failed-to-flush","errorCode":null,"errorMessage":"Failed to flush {}: {}","messagePattern":"Failed to flush (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":1094,"sourceCode":"                    };\n                    if let Some(callback) = &progress_callback {\n                        callback(Self::in_flight_progress(\n                            confirmed_bytes,\n                            total_bytes,\n                            speed_mbps,\n                        ));\n                    }\n                    self.set_downloading_status(model_name, progress.percent).await;\n                    last_percent = progress.percent;\n                    last_report = Instant::now();\n                    bytes_since_report = 0;\n                }\n            }\n\n            writer\n                .flush()\n                .await\n                .map_err(|error| anyhow!(\"Failed to flush {}: {}\", artifact.filename, error))?;\n            drop(writer);\n\n            if active_download.cancellation.is_cancelled() {\n                return Err(DownloadCancelled.into());\n            }\n            let stored_bytes = fs::metadata(&file_path)\n                .await\n                .map_err(|error| anyhow!(\"Failed to read {} after download: {}\", artifact.filename, error))?\n                .len();\n            if stored_bytes != artifact.exact_bytes {\n                return Err(anyhow!(\n                    \"{} stored {} bytes, expected exactly {} bytes\",\n                    artifact.filename,\n                    stored_bytes,\n                    artifact.exact_bytes\n                ));\n            }\n        }","sourceCodeStart":1076,"sourceCodeEnd":1112,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L1076-L1112","documentation":"After all chunks are written, the engine flushes the buffered async file writer with `writer.flush().await`. Any io::Error from the flush is mapped to `Failed to flush <filename>: <io error>` and aborts the download, since an unflushed file would be incomplete/corrupt on disk. Flush failures are typically deferred disk errors (ENOSPC, EIO) surfacing at flush time.","triggerScenarios":"`writer.flush().await` returns Err at the end of the artifact download loop — OS-level buffered-write failures reported when data is pushed to the filesystem.","commonSituations":"Disk filled up mid-download (writes buffered fine, fail on flush); network drive/synced folder (OneDrive, Dropbox, NFS) dropping connection; antivirus interfering at close; disk I/O errors.","solutions":["Free disk space — buffered data that silently fit the page cache often fails at flush when the disk is full.","Avoid downloading to cloud-synced or network-mounted folders; keep the models dir on a local disk.","Check disk health / system logs for I/O errors and run filesystem repair if EIO is reported.","Disable/quarantine-check antivirus real-time scanning of the models directory and retry.","Retry the download after resolving the storage issue; the partial file should be cleaned up and re-downloaded."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure target volume is local and has headroom before download\nlet free = fs2::free_space(&models_dir)?;\nif free < artifact.exact_bytes + 64 * 1024 * 1024 {\n    return Err(\"insufficient disk space for model download\".into());\n}","typeGuard":null,"tryCatchPattern":"match download_result {\n    Err(e) if e.to_string().contains(\"Failed to flush\") => {\n        // Deferred I/O error: check space (ENOSPC), disk health (EIO),\n        // or path on a synced/network volume; delete partial file and retry once\n        cleanup_partial_file();\n        eprintln!(\"Flush failed after download: {e}\");\n    }\n    Err(e) => return Err(e),\n    Ok(()) => {}\n}","preventionTips":["Keep the models directory on a local disk with ample free space.","Verify free space before and monitor during large downloads.","Exclude the download path from antivirus and sync tools.","Always delete partial files on failure so retries start clean."],"tags":["io","filesystem","flush","parakeet","disk-space"],"backgroundTag":"file-write-failed","analyzedSha":"a2cb62e827da7ef59f65064c97233efb2313878e","analyzedAt":"2026-09-12T11:12:14.152Z","contentChangedAt":"2026-09-12T11:12:14.152Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}