{"record":{"id":"8f9f15ed2dc5a71b","repo":"NousResearch/hermes-agent","slug":"write-bootstrap-marker-failed-err","errorCode":null,"errorMessage":"write bootstrap marker failed: {err:#}","messagePattern":"write bootstrap marker failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/bootstrap-installer/src-tauri/src/bootstrap.rs","lineNumber":801,"sourceCode":"        .hermes_home\n        .clone()\n        .unwrap_or_else(|| crate::paths::hermes_home().to_string_lossy().into_owned());\n    let install_root = PathBuf::from(&hermes_home).join(\"hermes-agent\");\n\n    // Marker publish is terminal for this run: a write failure must emit Failed\n    // so the UI leaves the progress state (it does not poll get_bootstrap_status).\n    let marker = match write_bootstrap_complete_marker(&install_root, &pin) {\n        Ok(marker) => marker,\n        Err(err) => {\n            let msg = format!(\"write bootstrap marker failed: {err:#}\");\n            emit_event(\n                &app,\n                BootstrapEvent::Failed {\n                    stage: None,\n                    error: msg.clone(),\n                },\n            );\n            return Err(anyhow!(msg));\n        }\n    };\n\n    // Copy ourselves to HERMES_HOME/hermes-setup.exe so the desktop app can\n    // re-invoke us with `--update` and shortcuts have a stable target. This is\n    // a one-shot install concern; an `--update` re-invocation no-ops because\n    // we're already running from that path. Best-effort — a failure here must\n    // not fail an otherwise-successful install.\n    if let Err(err) = crate::paths::copy_self_to_hermes_home() {\n        tracing::warn!(?err, \"failed to copy installer into HERMES_HOME (non-fatal)\");\n        emit_log(&format!(\n            \"[bootstrap] warning: could not stage updater binary: {err}\"\n        ));\n    }\n\n    emit_event(\n        &app,\n        BootstrapEvent::Complete {","sourceCodeStart":783,"sourceCodeEnd":819,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/bootstrap-installer/src-tauri/src/bootstrap.rs#L783-L819","documentation":"Raised when write_bootstrap_complete_marker() fails to persist the completion marker JSON under the install root (create the marker directory, serialize the JSON, or write the file failed). The marker records schemaVersion, pinned commit/branch, and completion time, and doubles as the cross-process update lock shared with `hermes update` (hermes_cli/update_lock.py). Because the UI relies on the marker to leave the progress state, the installer treats an unwritable marker as a hard failure of an otherwise-finished install.","triggerScenarios":"Calling the bootstrap finish path when HERMES_HOME or the install root is on a read-only/full disk, when the marker's parent directory cannot be created (permission denied), when serde_json serialization of the marker value fails (practically never), or when antivirus/another process holds the marker file open with an exclusive lock on Windows.","commonSituations":"Disk full on the drive holding HERMES_HOME; running the installer without write permission to the user profile dir; a stale marker file with restrictive ACLs from a previous run under a different account; OneDrive/antivirus locking .json files in the home directory.","solutions":["Free disk space and verify write access to the marker path shown in the error's install root (create the directory by hand as a test).","Delete the stale marker file so the installer can recreate it with fresh permissions.","Re-run the installer elevated (Windows) or fix ownership of HERMES_HOME (chmod/chown on macOS/Linux).","Temporarily disable/reconfigure antivirus real-time scanning for HERMES_HOME and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"use std::path::Path;\nuse std::fs;\n\nfn marker_writable(install_root: &Path) -> std::io::Result<()> {\n    let marker = crate::paths::likely_bootstrap_marker(install_root);\n    if let Some(parent) = marker.parent() {\n        fs::create_dir_all(parent)?;\n        let probe = parent.join(\".write-probe\");\n        fs::write(&probe, b\"x\")?;\n        let _ = fs::remove_file(&probe);\n    }\n    Ok(())\n}\n\n// Run before install: bail early with a clear message if the marker can't be written.\nif let Err(e) = marker_writable(&install_root) {\n    eprintln!(\"HERMES_HOME not writable: {e}\");\n}","typeGuard":null,"tryCatchPattern":"match write_bootstrap_complete_marker(&install_root, &pin) {\n    Ok(m) => m,\n    Err(err) => {\n        // Install itself succeeded; surface as recoverable, point user at permissions/disk.\n        emit_event(&app, BootstrapEvent::Failed { stage: None,\n            error: format!(\"install finished but the completion marker could not be written: {err:#}. Check disk space and permissions on the install root.\") });\n        return Err(anyhow!(\"write bootstrap marker failed: {err:#}\"));\n    }\n}","preventionTips":["Pre-flight check disk space and write access to HERMES_HOME before starting the install.","Ensure the installer runs as the same user that owns HERMES_HOME.","Clean stale marker files from failed prior runs before installing."],"tags":["filesystem","bootstrap-installer","windows","marker"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}