{"record":{"id":"89eb8547a76165b7","repo":"jdx/mise","slug":"cannot-upgrade-because-no-configured-tools-were","errorCode":null,"errorMessage":"cannot upgrade {} because no configured tools were resolved","messagePattern":"cannot upgrade (.+?) because no configured tools were resolved","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/lock.rs","lineNumber":418,"sourceCode":"                        .lock()?;\n                    let original_content = read_optional_file(&lockfile_path)?;\n                    let mut lockfile = Lockfile::read(&lockfile_path)?;\n                    if self.json {\n                        all_changes.extend(self.compute_version_changes(\n                            &lockfile,\n                            &tools,\n                            &lockfile_path,\n                        ));\n                    }\n                    let pruned_tools = self.prune_stale_entries_if_needed(\n                        &mut lockfile,\n                        configured_selectors.as_ref(),\n                    );\n                    let format_changed = if self.upgrade {\n                        if lockfile.tools().is_empty() {\n                            self.prepare_lockfile_format(&lockfile_path, &mut lockfile)\n                        } else {\n                            bail!(\n                                \"cannot upgrade {} because no configured tools were resolved\",\n                                display_path(&lockfile_path)\n                            );\n                        }\n                    } else {\n                        self.report_lockfile_format(&lockfile_path, &lockfile, false)?;\n                        false\n                    };\n                    if format_changed || !pruned_tools.is_empty() {\n                        if self.upgrade {\n                            staged_upgrade_writes.push(StagedUpgradeWrite {\n                                path: lockfile_path.clone(),\n                                original_content,\n                                lockfile,\n                                summary: None,\n                                format_changed,\n                                stale_tools: pruned_tools.clone(),\n                                stale_versions: BTreeMap::new(),","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/lock.rs#L400-L436","documentation":"`mise lock --upgrade` upgrades a lockfile to the newest format, which requires re-resolving every configured tool request. This error is thrown when the upgrade path is taken but the resolved tool set is empty — i.e. no tools from the mise configuration could be resolved at all, so there is nothing to write into the upgraded lockfile.","triggerScenarios":"Run `mise lock --upgrade` on a lockfile whose configured tool selectors (from mise.toml/.tool-versions) all fail to resolve — e.g. the config has no [tools] entries, or every selector fails resolution so `configured_selectors` yields an empty resolved tool list, while `lockfile.tools()` is empty.","commonSituations":"Running `--upgrade` against a lockfile that was generated from a config whose tools section was removed or renamed; typos in tool names so nothing resolves; a mise.toml with only env/task config and no tools at all.","solutions":["Check that your mise.toml/[tools] config actually declares tools and that each tool name is spelled correctly (`mise ls` to see resolved tools).","Re-resolve tools first (`mise install`) so the lockfile has entries before running `mise lock --upgrade`.","If the lockfile should be empty, delete it and regenerate with `mise lock` instead of `--upgrade`.","If resolution failures are the cause, fix the underlying errors printed during resolution (bad registry names, network failures, unsupported versions)."],"exampleFix":"// before (mise.toml missing tools section, lockfile empty)\n[env]\nFOO = \"1\"\n\n// after\n[tools]\nnode = \"22\"\npython = \"3.12\"","handlingStrategy":"validation","validationCode":"# before running: mise lock --upgrade\n[ -s mise.lock ] && mise ls --tools | grep -q . && echo ok || echo \"no resolved tools — fix config first\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the [tools] section in mise.toml in sync with the lockfile.","Run `mise ls` to confirm all configured tools resolve before upgrading the lockfile format.","Validate tool name spellings against `mise registry`.","Regenerate the lockfile fresh instead of upgrading one that lost all tool entries."],"tags":["lockfile","cli","upgrade","resolution"],"backgroundTag":"empty-result-set","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}