{"record":{"id":"1c61267063b20f37","repo":"BoundaryML/baml","slug":"disk-error-0","errorCode":null,"errorMessage":"disk error: {0}","messagePattern":"disk error: (.+?)","errorType":"exception","errorClass":"FetchError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_release/src/lib.rs","lineNumber":101,"sourceCode":"        status: reqwest::StatusCode,\n    },\n    #[error(\"manifest 404 for version {version} (not released yet?)\")]\n    ManifestNotFound { version: String },\n    #[error(\"manifest schema {got} not supported (max {max}); run `baml self-update`\")]\n    ManifestSchemaTooNew { got: u32, max: u32 },\n    #[error(\"target {target} not built for version {version}\")]\n    TargetNotInManifest { target: String, version: String },\n    #[error(\"sha256 mismatch for {url}: expected {expected}, got {got}\")]\n    ChecksumMismatch {\n        url: String,\n        expected: String,\n        got: String,\n    },\n    #[error(\"archive missing expected binary {name}\")]\n    BinaryNotInArchive { name: String },\n    #[error(\"archive contains unsafe path {path}\")]\n    UnsafeArchivePath { path: String },\n    #[error(\"disk error: {0}\")]\n    Io(#[from] std::io::Error),\n    #[error(\"zip archive error: {0}\")]\n    Zip(#[from] zip::result::ZipError),\n}\n\n#[derive(Debug, Clone)]\npub struct Fetcher {\n    pub spec: ReleaseSpec,\n    pub product: Product,\n    pub manifest_base_url: String,\n    pub release_repo: String,\n    artifact: Option<Artifact>,\n}\n\nimpl Fetcher {\n    pub fn default_for(spec: ReleaseSpec, product: Product) -> Self {\n        Self {\n            spec,","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_release/src/lib.rs#L83-L119","documentation":"FetchError::Io wraps a std::io::Error (via #[from]) raised during the non-network parts of a release operation — writing the downloaded archive to disk, creating directories, or extracting files. The underlying OS error message is interpolated so the developer sees the real cause (permissions, disk full, etc.).","triggerScenarios":"Any baml_release install/self-update call where writing the temp archive, creating the install directory, or extracting entries fails with an OS-level I/O error (EACCES, ENOSPC, ENOENT).","commonSituations":"Installing into a directory without write permission (e.g. a system path without sudo), a full disk or full /tmp, the install target being read-only in containers, or antivirus locking the destination file on Windows.","solutions":["Read the wrapped io::Error message for the exact OS cause (permission, no space, etc.)","Check free disk space (df -h) if the message indicates ENOSPC","Fix permissions on the install directory or choose a user-writable prefix","Ensure the destination isn't read-only (container/CI volume mounts)","Retry if the failure was transient (e.g. AV briefly locking the file)"],"exampleFix":"# before\n$ sudo baml self-update --install-dir /usr/local/bin  # runs as root, fine\n$ baml self-update --install-dir /usr/local/bin  # EACCES\ndisk error: Permission denied (os error 13)\n# after\n$ baml self-update --install-dir ~/.local/bin && export PATH=~/.local/bin:$PATH","handlingStrategy":"try-catch","validationCode":"// pre-check writability and space before install\nlet dir = install_dir();\nlet probe = dir.join(\".baml-write-test\");\nstd::fs::write(&probe, b\"\").map_err(|e| eprintln!(\"{dir} not writable: {e}\"))?;\nlet _ = std::fs::remove_file(&probe);","typeGuard":"fn is_io_err(e: &FetchError) -> Option<&std::io::Error> {\n    if let FetchError::Io(io) = e { Some(io) } else { None }\n}","tryCatchPattern":"match install(v) {\n    Err(FetchError::Io(e)) if e.kind() == std::io::ErrorKind::PermissionDenied => {\n        eprintln!(\"no write access to install dir; use --install-dir ~/.local/bin\");\n        std::process::exit(1);\n    }\n    Err(FetchError::Io(e)) => {\n        warn!(\"transient disk error: {e}; retrying\");\n        retry_once_or_fail()\n    }\n    other => other,\n}","preventionTips":["Install to a user-writable prefix (e.g. ~/.local/bin) instead of system paths","Check free disk space before large updates","Avoid read-only container filesystems for install targets","Probe directory writability with a temp file before starting installs"],"tags":["io","filesystem","rust"],"backgroundTag":"file-write-failed","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}