{"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":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/bootstrap.rs","lineNumber":2332,"sourceCode":"        }\n    }\n}\n\nimpl BootstrapRemote {\n    async fn run(self) -> Result<()> {\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            source: self.source,\n            port: self.port,\n            identity_file: self.identity_file,","sourceCodeStart":2314,"sourceCodeEnd":2350,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/bootstrap.rs#L2314-L2350","documentation":"While assembling the fan-out set, BootstrapRemote::run inserts each --host entry into the selected-hosts map keyed by host name; if the key was already present - chosen from inventory by name, --tag, or --all, or an earlier duplicate --host - it bails (src/cli/bootstrap.rs:2332) rather than run the same machine twice with merged overrides.","triggerScenarios":"'mise bootstrap remote --all --host user@host1' where host1 also resolves from [bootstrap.remote.hosts]; the same --host given twice; --host whose normalized name equals a configured inventory name; a --tag that selects a host also passed explicitly.","commonSituations":"Wrapper scripts that always append --host on top of a configured fleet; loops emitting duplicated entries; tags that overlap explicit host names.","solutions":["Drop the redundant selection: remove the --host entry that overlaps the name/tag/--all pick","Deduplicate the host list in the calling script (sort -u) before invoking mise","Rename the ad-hoc host or the inventory entry if the collision is accidental","Review [bootstrap.remote.hosts] names to see which one collides"],"exampleFix":"# before\nmise bootstrap remote --all --host deploy@web1   # web1 already in inventory\n# Error: remote target 'web1' was selected more than once\n\n# after\nmise bootstrap remote --all   # or just: mise bootstrap remote --host deploy@web1","handlingStrategy":"validation","validationCode":"# bash: dedupe hosts and reject overlap with configured inventory names\nhosts=$(printf '%s\\n' \"${HOSTS[@]}\" | sort -u)\nfor h in $hosts; do\n  grep -F \"bootstrap.remote.hosts.$h\" mise.toml >/dev/null 2>&1 && { echo \"duplicate target: $h\" >&2; exit 1; }\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Dedupe host lists (sort -u) in wrapper scripts","Do not mix --all/--tag with an explicit --host for the same machine"],"tags":["mise","bootstrap","remote","duplicate","host-selection"],"backgroundTag":"duplicate-target-selection","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}