{"record":{"id":"0c6f24970b8ffd53","repo":"Zackriya-Solutions/meetily","slug":"failed-to-preserve-after-overlong-response","errorCode":null,"errorMessage":"Failed to preserve {} after overlong response: {}","messagePattern":"Failed to preserve (.+?) after overlong response: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":1038,"sourceCode":"                        writer.flush().await.map_err(|flush_error| {\n                            anyhow!(\n                                \"Failed to preserve {} after stream error: {}\",\n                                artifact.filename,\n                                flush_error\n                            )\n                        })?;\n                        return Err(anyhow!(\"Download stream failed for {}: {}\", artifact.filename, error));\n                    }\n                    Ok(Some(Ok(chunk))) => chunk,\n                };\n\n                let chunk_bytes = chunk.len() as u64;\n                let next_artifact_bytes = artifact_bytes\n                    .checked_add(chunk_bytes)\n                    .ok_or_else(|| anyhow!(\"{} size overflow\", artifact.filename))?;\n                if next_artifact_bytes > artifact.exact_bytes {\n                    writer.flush().await.map_err(|error| {\n                        anyhow!(\"Failed to preserve {} after overlong response: {}\", artifact.filename, error)\n                    })?;\n                    return Err(anyhow!(\n                        \"{} response exceeds its exact {} byte size\",\n                        artifact.filename,\n                        artifact.exact_bytes\n                    ));\n                }\n                let next_confirmed_bytes = confirmed_bytes\n                    .checked_add(chunk_bytes)\n                    .ok_or_else(|| anyhow!(\"Progress overflow while downloading {}\", artifact.filename))?;\n                if next_confirmed_bytes > total_bytes {\n                    return Err(anyhow!(\"Download progress exceeds the catalog total\"));\n                }\n\n                writer\n                    .write_all(&chunk)\n                    .await\n                    .map_err(|error| anyhow!(\"Failed to write {}: {}\", artifact.filename, error))?;","sourceCodeStart":1020,"sourceCodeEnd":1056,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L1020-L1056","documentation":"When the download server sends more bytes than the artifact's declared exact_bytes, the code flushes the writer (to preserve what was written) before failing with the 'response exceeds exact size' error. This specific message is the flush failure — i.e. the OS/disk could not flush the partial file, masking the original overlong-response problem.","triggerScenarios":"Server sent a body larger than artifact.exact_bytes (next_artifact_bytes > exact_bytes) AND the subsequent writer.flush().await failed at parakeet_engine.rs:1037-1039 — disk full, I/O error, file handle invalidated, or the underlying file was removed/locked.","commonSituations":"Disk full while buffering an oversized response; antivirus or backup software locking the partial model file; network share disconnect; server misconfigured to serve wrong/larger file than catalog declares.","solutions":["Free disk space (the flush failure is usually ENOSPC) and retry the download","Check the target models directory is writable and not locked by antivirus/backup tools","Verify the model server is serving the correct file matching the catalog's exact_bytes","Report the server-side size mismatch to whoever publishes the model catalog"],"exampleFix":"// before\n// no pre-check\nwriter.flush().await.map_err(|e| anyhow!(\"Failed to preserve {} after overlong response: {}\", f, e))?;\n// after\n// check space up front to make flush failures rare\nanyhow::ensure!(free_space(models_dir)? > artifact.exact_bytes, \"insufficient disk space for {}\", artifact.filename);","handlingStrategy":"validation","validationCode":"// check disk space before starting download\nlet free = fs2::free_space(&models_dir)?;\nanyhow::ensure!(free > artifact.exact_bytes + margin, \"not enough disk space for {}\", artifact.filename);","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"Failed to preserve\") => {\n        // flush failed: check disk space and file locks, then retry\n        ensure_disk_space_and_unlock(models_dir)?;\n        retry_download()\n    }\n    other => other,\n}","preventionTips":["Keep several GB free on the drive holding the models directory","Exclude the models directory from antivirus/backup scanners that lock files","Avoid writing model downloads to network shares","Verify server file sizes match the catalog before publishing"],"tags":["filesystem","disk-full","download","io"],"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"}