zeroclaw-labs/zeroclaw · error · anyhow::Error

Failed to create zeroclaw group

Error message

Failed to create zeroclaw group: {}

What it means

On Alpine, the `addgroup -S zeroclaw` command spawned by the service installer could not be executed at all (the context wraps the process spawn/IO failure, not a non-zero exit). Typically means the addgroup binary is missing or PATH is broken in the installation environment.

Solutions

  1. Run the service install with sudo and check groupadd error detail.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/zeroclaw-runtime/src/service/mod.rs:1496 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/6199dc1f6c83c58e. Report an issue: GitHub.

Appendix: source

Thrown at crates/zeroclaw-runtime/src/service/mod.rs:1496

    {
        return check_zeroclaw_user();
    }

    let is_alpine = Path::new("/etc/alpine-release").exists();

    if is_alpine {
        let group_output = Command::new("getent").args(["group", "zeroclaw"]).output();
        let group_exists = group_output.map(|o| o.status.success()).unwrap_or(false);

        if !group_exists {
            let output = Command::new("addgroup")
                .args(["-S", "zeroclaw"])
                .output()
                .context("Failed to create zeroclaw group")?;

            if !output.status.success() {
                let stderr = String::from_utf8_lossy(&output.stderr);
                bail!("Failed to create zeroclaw group: {}", stderr.trim());
            }
            println!("✅ Created system group: zeroclaw");
        }

        let output = Command::new("adduser")
            .args([
                "-S",
                "-s",
                "/sbin/nologin",
                "-H",
                "-D",
                "-G",
                "zeroclaw",
                "zeroclaw",
            ])
            .output()
            .context("Failed to create zeroclaw user")?;

View on GitHub (pinned to 88bb9c8533)