jdx/mise · error

--connect-timeout must be greater than zero

Error message

--connect-timeout must be greater than zero

What it means

The `--connect-timeout` option for remote bootstrap must be a positive number of seconds. Zero would mean the SSH/relay connection never gets a timeout budget, so mise validates and rejects it up front.

Solutions

  1. Pass a positive value, e.g. --connect-timeout 30
  2. Omit the flag to use the default timeout
  3. Fix templating that substitutes 0 as a sentinel for 'disabled'

Example fix

// before
mise bootstrap remote --connect-timeout 0 --all
// after
mise bootstrap remote --connect-timeout 30 --all
Defensive patterns

Strategy: validation

Validate before calling

if (connectTimeout <= 0) throw new Error('--connect-timeout must be > 0')

Prevention

When it happens

Trigger: Running remote bootstrap with `--connect-timeout 0` explicitly supplied.

Common situations: Copy-pasted flags from a script where the value is templated to 0; user misunderstanding that 0 means 'no timeout' (it doesn't — use a large positive value instead).

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/1e98b1d5261fd35c. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/bootstrap.rs:3036

        normalize_adopt_alias(&mut self.adopt, self.from_git.take());
        crate::ui::ctrlc::exit_on_ctrl_c(false);
        let relay = crate::github_relay::Scope::from_flags(
            self.github_relay_read_only,
            &self.github_relay_repo,
            self.github_relay_all_repos,
        )?;
        let relay = crate::github_relay::configure(
            relay,
            self.github_relay_log_requests,
            self.github_relay_no_log_requests,
            self.github_relay_log_format.as_deref(),
            self.github_relay_max_duration.as_deref(),
        )?;
        if relay.is_some() && !cfg!(unix) {
            bail!("GitHub relay requires Linux or macOS");
        }
        if self.connect_timeout == 0 {
            bail!("--connect-timeout must be greater than zero");
        }
        let config = Config::get().await?;
        let config_excludes = system::remote::excludes_from_config(&config);
        let inventory = system::remote::hosts_from_config(&config, &config_excludes)?;
        let mut selected = select_remote_inventory(&inventory, &self.targets, self.all, &self.tag)?;
        let ad_hoc_source = self.source.clone().unwrap_or(std::env::current_dir()?);
        for destination in &self.host {
            let host =
                system::remote::ad_hoc_host(destination, ad_hoc_source.clone(), &config_excludes)?;
            if selected.insert(host.name.clone(), host).is_some() {
                bail!("remote target '{destination}' was selected more than once");
            }
        }
        if selected.is_empty() {
            if inventory.is_empty() {
                bail!(
                    "no remote targets configured; pass --host [user@]host or add [bootstrap.remote.hosts]"
                );

View on GitHub (pinned to 533346cc37)