{"record":{"id":"a513c8b6337dc9e9","repo":"jdx/mise","slug":"locked-mode-requires-lockfile-to-be-enabled-hint","errorCode":null,"errorMessage":"locked mode requires lockfile to be enabled\nhint: Remove `lockfile = false` or set `lockfile = true`, or disable locked mode","messagePattern":"locked mode requires lockfile to be enabled\nhint: Remove `lockfile = false` or set `lockfile = true`, or disable locked mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/mod.rs","lineNumber":3368,"sourceCode":"            }\n            if let Some(graph) = &tv.aube_lock {\n                graph.warn_if_missing();\n            }\n            tv\n        } else {\n            self.prepare_install_version(&ctx, tv).await?\n        };\n        // Toolset installs preflight these options before doing any work, but\n        // direct callers such as `install-into` must be protected here too.\n        tv.request.ensure_safe_install_options()?;\n\n        // Check for --locked mode: if enabled and no lockfile URL exists, fail early\n        // Exempt tool stubs from lockfile requirements since they are ephemeral\n        // Also exempt backends that don't support URL locking (e.g., Rust uses rustup)\n        // This must run before the dry-run check so that --locked --dry-run still validates\n        let settings = Settings::get();\n        if ctx.locked && settings.lockfile == Some(false) {\n            bail!(\n                \"locked mode requires lockfile to be enabled\\n\\\n                hint: Remove `lockfile = false` or set `lockfile = true`, or disable locked mode\"\n            );\n        }\n        if ctx.locked && !tv.request.source().is_tool_stub() && self.supports_lockfile_url() {\n            let platform_key = self.get_platform_key();\n            let has_lockfile_url = tv\n                .lock_platforms\n                .get(&platform_key)\n                .and_then(|p| p.url.as_ref())\n                .is_some();\n            if !has_lockfile_url {\n                bail!(\n                    \"No lockfile URL found for {} on platform {} (--locked mode)\\n\\\n                    hint: Run `mise lock` to generate lockfile URLs, or disable locked mode\",\n                    tv.style(),\n                    platform_key\n                );","sourceCodeStart":3350,"sourceCodeEnd":3386,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/mod.rs#L3350-L3386","documentation":"The `--locked` flag requires mise's lockfile feature to record and verify install URLs, but the setting `lockfile = false` disables that feature. The two are mutually exclusive, so mise fails early — before even the dry-run check — rather than silently performing an unlocked install.","triggerScenarios":"Running any install/lock operation with locked=true (CLI --locked or locked config) while `lockfile = false` is set in settings (mise.toml [settings], settings.toml, or MISE_LOCKFILE=false).","commonSituations":"CI script passes --locked but repo settings disable lockfiles; user previously disabled lockfiles to avoid lockfile churn and later adopted --locked.","solutions":["Remove `lockfile = false` or set `lockfile = true` in settings","Drop the --locked flag / locked=true setting if you don't want pinned installs","Check for a conflicting MISE_LOCKFILE env var overriding the config"],"exampleFix":"// before (mise.toml)\n[settings]\nlockfile = false\n// after\n[settings]\nlockfile = true","handlingStrategy":"validation","validationCode":"// bash: refuse to pass --locked when lockfiles are disabled\n[[ \"$(mise settings get lockfile)\" != \"false\" ]] || unset LOCKED_FLAG","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --locked and lockfile=false as mutually exclusive in scripts/CI","Centralize lockfile settings in one committed mise.toml to avoid env drift","Grep CI configs for MISE_LOCKFILE=false when enabling --locked"],"tags":["locked-mode","lockfile","settings","conflict"],"backgroundTag":"conflicting-config-options","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"}