{"record":{"id":"25f14457fb816e8d","repo":"jdx/mise","slug":"incompatible-preset-name-data-in-stored-current-migrate-or","errorCode":null,"errorMessage":"incompatible {preset_name} data in {} (stored {}, current {}); migrate or reset it explicitly","messagePattern":"incompatible (.+?) data in (.+?) \\(stored (.+?), current (.+?)\\); migrate or reset it explicitly","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/daemons/presets.rs","lineNumber":198,"sourceCode":"        bail!(\"daemon presets are not supported on Windows yet\");\n    }\n    let preset = preset(preset_name)?;\n    let parent = data\n        .parent()\n        .ok_or_else(|| eyre::eyre!(\"daemon data must have a parent directory\"))?;\n    std::fs::create_dir_all(parent)?;\n    let _lock = crate::lock_file::LockFile::new(data).lock()?;\n    let output = Command::new(&preset.binary).arg(\"--version\").output()?;\n    if !output.status.success() {\n        bail!(\"unable to determine {} version\", preset.binary);\n    }\n    let major = major(preset_name, &String::from_utf8(output.stdout)?)?;\n    let marker = format!(\"{preset_name}:{major}\\n\");\n    if data.exists() {\n        let existing = std::fs::read_to_string(data.join(\".mise-daemon-version\"))\n            .wrap_err(\"daemon data was not initialized completely; inspect it and migrate or reset it explicitly\")?;\n        if existing != marker {\n            bail!(\n                \"incompatible {preset_name} data in {} (stored {}, current {}); migrate or reset it explicitly\",\n                data.display(),\n                existing.trim(),\n                marker.trim()\n            );\n        }\n        if preset_name == \"postgres\"\n            && std::fs::read_to_string(data.join(\"PG_VERSION\"))\n                .wrap_err(\"daemon data was not initialized completely; missing PG_VERSION\")?\n                .trim()\n                != major\n        {\n            bail!(\"Postgres data version does not match its initialization marker\");\n        }\n        return Ok(());\n    }\n    let staging = tempfile::Builder::new()\n        .prefix(\".mise-init-\")","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/daemons/presets.rs#L180-L216","documentation":"If the daemon data directory already exists, initialize compares its .mise-daemon-version marker (format 'preset:major') with the marker computed from the currently resolved binary. A mismatch means the existing data was created by an incompatible major/preset and mise refuses to proceed rather than corrupting it.","triggerScenarios":"Pointing a daemon at a data directory previously initialized with a different preset name or a different major version (e.g. postgres 15 data now used with postgres 16), during initialize.","commonSituations":"Upgrading the pinned postgres major in mise.toml while reusing the old data dir; renaming the preset; stale data dir left after a tool version change.","solutions":["Move or remove the old data directory and re-initialize fresh (dump/restore data first if needed)","Pin the tool back to the major matching the stored marker","Manually migrate the data (pg_dump/pg_upgrade) then reset the directory"],"exampleFix":"# before (marker stored postgres:15, binary now 16)\npostgres = \"16\"\n# after: either pin back\npostgres = \"15\"\n# or start fresh after dumping data\nrm -rf ~/.local/share/mise/daemons/postgres/data","handlingStrategy":"validation","validationCode":"cat ~/.local/share/mise/daemons/postgres/data/.mise-daemon-version 2>/dev/null # compare with pinned major in mise.toml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When bumping a tool major, plan a data migration/reset in the same change","Dump data before changing daemon data directories","Never hand-edit .mise-daemon-version"],"tags":["daemon","postgres","version-mismatch","data-migration"],"backgroundTag":"checksum-mismatch","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"}