{"record":{"id":"bf411ae5e80248c5","repo":"jdx/mise","slug":"dotfiles-cannot-save-the-baseline-reason","errorCode":null,"errorMessage":"dotfiles: cannot save the baseline: {reason}","messagePattern":"dotfiles: cannot save the baseline: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/track.rs","lineNumber":411,"sourceCode":"    }\n    Ok(())\n}\n\n/// Resolve link chains using the same path representation as tracked entries.\nfn resolve_symlink_source(target: &Path) -> Result<PathBuf> {\n    file::atomic_write_target(target).map(|source| normalize_target(&source))\n}\n\n/// Saves the baseline checkpoint of newly tracked paths; a failure fails\n/// the enrollment, since an untracked file must never look protected.\nasync fn baseline(tracked: &TrackedSet, declared: &[(String, PathBuf)]) -> Result<()> {\n    if !crate::config::Settings::get().history.enabled {\n        warn!(\"dotfiles: history is disabled (history.enabled = false); no baseline saved\");\n        return Ok(());\n    }\n    let store = Store::open()?;\n    if let Some(reason) = store.unavailable() {\n        bail!(\"dotfiles: cannot save the baseline: {reason}\");\n    }\n    // A capture wrapper owns the operation lock until this child exits. It\n    // reloads enrollment and explicitly saves all current tracked files in\n    // its outcome (including manual entries), or during interruption recovery.\n    if inside_capture()? {\n        info!(\n            \"dotfiles: enrolled; the enclosing capture will save the baseline when the command finishes\"\n        );\n        return Ok(());\n    }\n    let names = declared\n        .iter()\n        .map(|(key, _)| key.as_str())\n        .collect::<Vec<_>>()\n        .join(\", \");\n    let mut draft = Draft::new(Trigger::Baseline);\n    draft.explicit_paths = declared\n        .iter()","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/track.rs#L393-L429","documentation":"baseline() persists an initial checkpoint of tracked files into the history Store. If the store reports itself permanently unavailable (via store.unavailable()), saving the baseline is impossible and the command fails, surfacing the store's reason to the user prefixed with 'dotfiles: cannot save the baseline:'.","triggerScenarios":"Running `mise dot track` with history enabled, where Store::open() succeeds but unavailable() returns a reason — e.g. the history store directory is missing/unwritable, corrupted, or on an unsupported filesystem.","commonSituations":"MISE_DATA_DIR/HOME on a read-only mount; disk full; corrupted history database after an interrupted write; restrictive permissions on the mise data directory.","solutions":["Read the embedded {reason} and fix it (permissions, disk space, repair the history store)","Check and fix permissions on the mise data/history directory (typically ~/.local/share/mise)","If the store is corrupted, remove/reinitialize the history store (accepting loss of history)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"store_dir=\"${MISE_DATA_DIR:-$HOME/.local/share/mise}/history\"; test -w \"$(dirname \"$store_dir\")\" || echo 'history store directory not writable — fix permissions or disk space before dot track'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the mise data directory writable and on a normal (non-read-only) filesystem","Monitor disk space where mise stores history","Repair/remove a corrupted history store before enrolling encrypted paths"],"tags":["dotfiles","history","storage","baseline"],"backgroundTag":"file-write-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}