{"record":{"id":"b4e75aff4a041f92","repo":"jdx/mise","slug":"from-was-provided","errorCode":null,"errorMessage":"--from was provided","messagePattern":"--from was provided","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/bootstrap.rs","lineNumber":1921,"sourceCode":"            if !outcome.durable_access {\n                warn!(\"ongoing synchronization still needs credentials on this host (see above)\");\n            }\n            return Ok(());\n        }\n        let (url, checkout) = if let Some(url) = expanded.as_deref() {\n            let checkout = crate::env::MISE_GLOBAL_CONFIG_FILE\n                .as_deref()\n                .map(|path| {\n                    path.parent()\n                        .filter(|parent| !parent.as_os_str().is_empty())\n                        .unwrap_or_else(|| Path::new(\".\"))\n                })\n                .unwrap_or(*dirs::CONFIG)\n                .to_path_buf();\n            (url, checkout)\n        } else {\n            (\n                self.from.as_deref().expect(\"--from was provided\"),\n                self.from_dir\n                    .clone()\n                    .unwrap_or_else(|| dirs::DATA.join(\"bootstrap-repo\")),\n            )\n        };\n\n        let checkout_is_empty = checkout.is_dir() && checkout.read_dir()?.next().is_none();\n        let reuse_checkout = checkout.exists() && !checkout_is_empty;\n        if reuse_checkout {\n            validate_bootstrap_checkout(&checkout, url)?;\n        }\n        // The clone or pull changes the config checkout before the child\n        // process records the bootstrap itself, so it is a generation of its\n        // own. A checkout reused as-is changes nothing and records nothing.\n        let mutates_checkout = !reuse_checkout || self.update;\n        let generation = if mutates_checkout {\n            Some(OperationScope::begin(\"bootstrap --from\", self.dry_run).await?)\n        } else {","sourceCodeStart":1903,"sourceCodeEnd":1939,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/bootstrap.rs#L1903-L1939","documentation":"A `.expect()` panic in mise's bootstrap repo source resolution (src/cli/bootstrap.rs:1921). The code resolves the bootstrap source either from a configured URL or from the `--from` CLI flag; the else branch asserts `--from` was provided. Panicking means neither the URL path nor `--from` was present, breaking the argument-parsing invariant.","triggerScenarios":"Running `mise bootstrap` without `--from` and without a config that selects a URL source, reaching the else branch with `self.from == None`.","commonSituations":"Invoking bootstrap from a config file path that lacks the source URL while omitting --from on the command line; older configs after a CLI change that made the URL source conditional.","solutions":["Pass `--from <url-or-path>` when no bootstrap source URL is configured","Add the bootstrap source URL to the mise config so the first branch is taken","Validate args at clap level: require --from unless a config URL is set (make it a clap-required group)"],"exampleFix":"// before\nself.from.as_deref().expect(\"--from was provided\")\n// after\nself.from.as_deref().with_context(|| \"--from is required when no bootstrap source URL is configured\")?","handlingStrategy":"validation","validationCode":"if bootstrap_source_url.is_none() && cli.from.is_none() { return Err(anyhow!(\"--from is required when no bootstrap source URL is configured\")); }","typeGuard":"let from = cli.from.as_deref().or(config.bootstrap_source_url.as_deref());","tryCatchPattern":"let from = match self.from.as_deref() { Some(f) => f, None => return Err(anyhow!(\"missing --from\")), };","preventionTips":["Use clap's required_unless_present to encode the --from/URL mutual dependency","Document in `mise bootstrap --help` when --from is mandatory","Check bootstrap config for a source URL before running the command"],"tags":["cli","bootstrap","missing-argument","panic"],"backgroundTag":"missing-required-argument","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}