{"record":{"id":"05708f305d997858","repo":"jdx/mise","slug":"remote-target-destination-was-selected-more-th","errorCode":null,"errorMessage":"remote target '{destination}' was selected more than once","messagePattern":"remote target '(.+?)' was selected more than once","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/bootstrap.rs","lineNumber":3047,"sourceCode":"            self.github_relay_log_format.as_deref(),\n            self.github_relay_max_duration.as_deref(),\n        )?;\n        if relay.is_some() && !cfg!(unix) {\n            bail!(\"GitHub relay requires Linux or macOS\");\n        }\n        if self.connect_timeout == 0 {\n            bail!(\"--connect-timeout must be greater than zero\");\n        }\n        let config = Config::get().await?;\n        let config_excludes = system::remote::excludes_from_config(&config);\n        let inventory = system::remote::hosts_from_config(&config, &config_excludes)?;\n        let mut selected = select_remote_inventory(&inventory, &self.targets, self.all, &self.tag)?;\n        let ad_hoc_source = self.source.clone().unwrap_or(std::env::current_dir()?);\n        for destination in &self.host {\n            let host =\n                system::remote::ad_hoc_host(destination, ad_hoc_source.clone(), &config_excludes)?;\n            if selected.insert(host.name.clone(), host).is_some() {\n                bail!(\"remote target '{destination}' was selected more than once\");\n            }\n        }\n        if selected.is_empty() {\n            if inventory.is_empty() {\n                bail!(\n                    \"no remote targets configured; pass --host [user@]host or add [bootstrap.remote.hosts]\"\n                );\n            }\n            bail!(\n                \"select a remote target by name, --tag, or --all (configured: {})\",\n                inventory.keys().cloned().collect::<Vec<_>>().join(\", \")\n            );\n        }\n\n        let overrides = system::remote::RemoteOverrides {\n            from_git: self.adopt.is_some(),\n            source: self.source,\n            mise_env: self.remote_env,","sourceCodeStart":3029,"sourceCodeEnd":3065,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/bootstrap.rs#L3029-L3065","documentation":"Each `--host [user@]host` value passed to remote bootstrap maps to an inventory entry keyed by host name. If two --host values resolve to the same host name (including duplicates of one value, or a host also selected via --tag/--all), mise detects the duplicate key collision in the `selected` map and errors.","triggerScenarios":"Passing the same --host twice (`--host a --host a`), or passing --host for a machine already matched by --tag or --all, so `HashMap::insert` returns Some.","commonSituations":"Scripting bootstrap with both an ad-hoc --host and a --tag that includes that host; redundant CLI args accumulated from config expansion.","solutions":["Remove the duplicate --host entry","Drop the --host when --tag or --all already selects that host","Check the generated command line in scripts for repeated flags"],"exampleFix":"// before\nmise bootstrap remote --host web1 --host web1 --all\n// after\nmise bootstrap remote --host web1","handlingStrategy":"validation","validationCode":"const hosts = [...allHostArgValues]; if (new Set(hosts).size !== hosts.length) throw new Error('duplicate --host');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Deduplicate --host values when building commands programmatically","Don't combine --host with --tag/--all for the same machine","Review generated CLI lines in CI logs"],"tags":["cli","bootstrap","duplicate","ssh"],"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"}