jdx/mise · error

invalid bootstrap name ' ': use at most 32 ASCII letters…

Error message

invalid bootstrap {kind} name '{name}': use at most 32 ASCII letters, digits, '_' or '-', with an optional trailing '$'

What it means

validate_name enforces bootstrap account naming rules: at most 32 characters, ASCII letters, digits, '_' and '-' only, with an optional single trailing '$' (Samba machine-account convention). Names violating these rules would break useradd/groupadd or /etc/passwd parsing, so mise rejects them up front. This applies to both users and groups (the kind placeholder).

Solutions

  1. Shorten the name to 32 characters or fewer using only [A-Za-z0-9_-], optionally ending in '$'.
  2. Use a comment field to record the full/email-like identity instead of encoding it in the name.
  3. Split an interior '$' out or drop it unless it is the required trailing machine-account marker.

Example fix

// before
[[bootstrap.users]]
name = "svc.build@corp.example.com"

// after
[[bootstrap.users]]
name = "svc-build"
comment = "svc.build@corp.example.com"
Defensive patterns

Strategy: validation

Validate before calling

function validateAccountName(name) {
  const re = /^[A-Za-z0-9_-]{0,31}\$?$/;
  if (!re.test(name)) throw new Error(`invalid bootstrap account name: '${name}'`);
}

Type guard

function isValidAccountName(name) {
  return typeof name === 'string' && /^[A-Za-z0-9_-]{0,31}\$?$/.test(name);
}

Try / catch

try {
  await mise.bootstrap.apply(config);
} catch (e) {
  if (String(e).includes('invalid bootstrap') && String(e).includes('name')) {
    console.error('Rename to <=32 chars of [A-Za-z0-9_-] with optional trailing $:', e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Declaring a bootstrap user or group whose name exceeds 32 chars, contains spaces, dots, '@', non-ASCII characters, uppercase-hostile conventions, or an interior '$'.

Common situations: Using email addresses or FQDNs as usernames; AD-style names like 'CORP\\bob' or 'bob@corp.example'; machine account names with '$' not at the end; names longer than the classic 32-char limit.

Understand the failure class

Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.

Related errors


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

Appendix: source

Thrown at src/system/accounts.rs:718

    )
}

fn validate_name(kind: &str, name: &str) -> Result<()> {
    let base = name.strip_suffix('$').unwrap_or(name);
    let mut characters = base.chars();
    let valid = !name.is_empty()
        && name.len() <= 32
        && characters
            .next()
            .is_some_and(|character| character == '_' || character.is_ascii_alphabetic())
        && characters.all(|character| {
            character == '_'
                || character == '-'
                || character.is_ascii_digit()
                || character.is_ascii_alphabetic()
        });
    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(())

View on GitHub (pinned to 533346cc37)