jdx/mise · error

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

Error message

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

What it means

Bootstrap user comments (GECOS field) are written to /etc/passwd, where ':' is the field separator and newlines would corrupt the line-based file. mise validates the comment field and rejects any comment containing ':', carriage return, or line feed before making system changes.

Solutions

  1. Remove ':' characters from the comment (use a space, dash, or semicolon instead).
  2. Collapse any newlines/CRs into a single-line comment.
  3. Re-run `mise bootstrap plan` after editing to confirm the comment validates.

Example fix

// before
[[bootstrap.users]]
name = "svc"
comment = "CI: build agent"

// after
[[bootstrap.users]]
name = "svc"
comment = "CI - build agent"
Defensive patterns

Strategy: validation

Validate before calling

function validateComment(user) {
  if (user.comment && /[:\r\n]/.test(user.comment)) {
    throw new Error(`user '${user.name}': comment must not contain ':', CR, or LF`);
  }
}

Type guard

function hasSafeComment(user) {
  return typeof user.comment !== 'string' || !/[:\r\n]/.test(user.comment);
}

Try / catch

try {
  await mise.bootstrap.apply(config);
} catch (e) {
  if (String(e).includes('comment must not contain')) {
    console.error('Sanitize the GECOS comment field:', e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Setting comment on a bootstrap user to a string containing ':', '\n', or '\r' — e.g. 'Work: admin' or a multi-line description.

Common situations: Using 'Name: Role' style descriptions; templating comments that expand to multi-line values; building the comment from environment data containing CR/LF.

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/e300c62f71aeaa9b. Report an issue: GitHub.

Appendix: source

Thrown at src/system/accounts.rs:372

        }
        if config.move_home && config.home.is_none() {
            bail!("bootstrap user '{name}' sets move_home without home");
        }
        if let Some(group) = &config.group {
            validate_name("group", group)?;
        }
        if let Some(path) = &config.home {
            validate_account_path(&name, "home", path)?;
        }
        if let Some(path) = &config.shell {
            validate_account_path(&name, "shell", path)?;
        }
        if config
            .comment
            .as_ref()
            .is_some_and(|comment| comment.contains([':', '\n', '\r']))
        {
            bail!("bootstrap user '{name}' comment must not contain ':', CR, or LF");
        }
        let mut groups = config
            .groups
            .map(|groups| {
                groups
                    .into_iter()
                    .map(|group| {
                        validate_name("group", &group)?;
                        Ok(group)
                    })
                    .collect::<Result<BTreeSet<_>>>()
            })
            .transpose()?;
        if let (Some(groups), Some(primary_group)) = (&mut groups, &config.group) {
            groups.remove(primary_group);
        }
        let inspection = inspect_user(&name, config.uid)?;
        Ok(Self {

View on GitHub (pinned to 533346cc37)