{"record":{"id":"144c7c8c33b0fdfd","repo":"pbakaus/impeccable","slug":"could-not-write-the-impeccable-engine-v-version","errorCode":null,"errorMessage":"Could not write the impeccable engine v{version} ({os}-{arch}) into {}: {e}\n","messagePattern":"Could not write the impeccable engine v(.+?) \\((.+?)-(.+?)\\) into (.+?): (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/skills/src/engine_binary.rs","lineNumber":147,"sourceCode":"        if util::exists(&dest) {\n            continue;\n        }\n        let url = asset_url(&base, version, os, arch);\n        let fetched = cache\n            .entry(version.to_string())\n            .or_insert_with(|| fetch_binary(&url))\n            .clone();\n        match fetched {\n            Ok(bytes) => {\n                let written = util::mkdir_p(&jsp::dirname(&dest))\n                    .and_then(|_| util::write_bytes(&dest, &bytes))\n                    .and_then(|_| util::set_executable(&dest));\n                match written {\n                    Ok(()) => io.out(&format!(\n                        \"Installed impeccable engine v{version} ({os}-{arch}) into: {}\\n\",\n                        sys.format_path_for_display(&dest)\n                    )),\n                    Err(e) => io.err(&format!(\n                        \"Could not write the impeccable engine v{version} ({os}-{arch}) into {}: {e}\\n\",\n                        sys.format_path_for_display(&dest)\n                    )),\n                }\n            }\n            Err(e) => {\n                if !e.is_empty() {\n                    io.err(&format!(\n                        \"Could not download the impeccable engine v{version} for {os}-{arch} ({url}): {e}. The launcher fetches it on first run.\\n\"\n                    ));\n                    // Report once per version, then stay quiet for its siblings.\n                    cache.insert(version.to_string(), Err(String::new()));\n                }\n            }\n        }\n    }\n}\n","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/skills/src/engine_binary.rs#L129-L165","documentation":"After a successful download, `install_engine_binaries` failed to write the engine binary to the destination path or to mark it executable. The message includes the version, platform triple, destination path, and the underlying I/O error. Install/update continues but that platform's launcher binary is missing locally.","triggerScenarios":"`install` or `update` calls install_engine_binaries; the file write to `dest` fails (disk full, permission denied, path is a directory, antivirus lock) or util::set_executable fails, returning Err(e) from the write branch at crates/skills/src/engine_binary.rs:147.","commonSituations":"Read-only install directory; disk quota exceeded; dest path occupied by a directory or a locked running binary (Windows); user lacks execute-bit rights on the target filesystem (e.g. noexec mount).","solutions":["Read the trailing {e} to identify the OS error, then free disk space or fix permissions on the destination directory.","Ensure no running impeccable process is locking the destination file; close it and re-run install/update.","Install to a writable location (check install prefix / HOME) and re-run `impeccable install`.","If the filesystem is mounted noexec, remount or choose a different install path."],"exampleFix":"# before\n$ impeccable install\nCould not write the impeccable engine v1.2.3 (linux-x64) into ~/.local/share/impeccable/bin/impeccable: Permission denied (os error 13)\n# after\n$ chmod u+w ~/.local/share/impeccable/bin && impeccable install","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nfunction canWrite(dir) {\n  try { fs.accessSync(dir, fs.constants.W_OK | fs.constants.X_OK); return true; } catch { return false; }\n}\nif (!canWrite(destDir)) console.error('destination not writable:', destDir);","typeGuard":"function isWritableFilePath(p) {\n  return typeof p === 'string' && p.length > 0 && !require('fs').existsSync(p) === false\n    ? require('fs').statSync(p).isFile() || !require('fs').existsSync(p)\n    : true;\n}","tryCatchPattern":"try {\n  await installEngineBinaries(io);\n} catch (e) {\n  console.error('engine write failed; check disk space and permissions for the install dir:', e.message);\n  process.exit(1);\n}","preventionTips":["Check free disk space before installing","Verify the install directory is writable and not noexec-mounted","Stop running impeccable processes before updating binaries","Exclude the install directory from antivirus/backup file locks"],"tags":["file-write","filesystem","install"],"backgroundTag":"file-write-failed","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}