jdx/mise · error

bootstrap user ' ' must not contain ':', CR, or LF

Error message

bootstrap user '{name}' {field} must not contain ':', CR, or LF

What it means

Path fields for bootstrap users must not contain ':', CR, or LF. ':' is the field separator in /etc/passwd, and newlines would corrupt the line-oriented account database. mise validates the string form of the path and bails if any forbidden character is present.

Solutions

  1. Remove ':' from the path (use the POSIX mount path instead of a drive-letter form).
  2. Trim/normalize any CR/LF from the value before it reaches the config.
  3. Check template expansions for stray newlines and re-run `mise bootstrap plan`.

Example fix

// before
[[bootstrap.users]]
name = "alice"
home = "C:\\Users\\alice"

// after
[[bootstrap.users]]
name = "alice"
home = "/home/alice"
Defensive patterns

Strategy: validation

Validate before calling

function validatePathChars(user, field) {
  const p = user[field];
  if (typeof p === 'string' && /[:\r\n]/.test(p)) {
    throw new Error(`user '${user.name}': ${field} must not contain ':', CR, or LF`);
  }
}

Type guard

function isPasswdSafePath(p) {
  return typeof p === 'string' && !/[:\r\n]/.test(p);
}

Try / catch

try {
  await mise.bootstrap.apply(config);
} catch (e) {
  if (String(e).includes('must not contain')) {
    console.error('Strip :, CR, LF from the path value:', e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Setting a bootstrap user's home (or other validated path) to a value containing ':', '\n', or '\r' — e.g. a Windows-style 'C:\\Users' path or a templated value that expands with newlines.

Common situations: Porting configs from Windows with drive-letter paths; building paths via templates/env interpolation that capture multi-line values; accidental paste of multi-line content into a TOML string.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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

Appendix: source

Thrown at src/system/accounts.rs:734

        });
    if !valid {
        bail!(
            "invalid bootstrap {kind} name '{name}': use at most 32 ASCII letters, digits, '_' or '-', with an optional trailing '$'"
        );
    }
    Ok(())
}

fn validate_account_path(name: &str, field: &str, path: &std::path::Path) -> Result<()> {
    if !path.is_absolute() {
        bail!("bootstrap user '{name}' {field} must be an absolute path");
    }
    if path
        .to_string_lossy()
        .chars()
        .any(|character| character == ':' || character == '\n' || character == '\r')
    {
        bail!("bootstrap user '{name}' {field} must not contain ':', CR, or LF");
    }
    Ok(())
}

pub(crate) fn plans(requests: &AccountRequests) -> Vec<ResourcePlan> {
    requests
        .groups
        .iter()
        .map(GroupRequest::plan)
        .chain(requests.users.iter().map(UserRequest::plan))
        .collect()
}

pub(crate) fn apply(requests: &AccountRequests, dry_run: bool, yes: bool) -> Result<bool> {
    let mut actions = vec![];
    let mut unknown = vec![];
    for group in requests
        .groups

View on GitHub (pinned to 533346cc37)