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

User 'zeroclaw' exists but has unexpected shell '{}'. Expect

Error message

User 'zeroclaw' exists but has unexpected shell '{}'.
Expected nologin/false for security. Fix with: sudo {} && sudo {}

What it means

Error "User 'zeroclaw' exists but has unexpected shell '{}'. Expected nologin/false for security. Fix with: sudo {} && sudo {}" thrown in zeroclaw-labs/zeroclaw.

Source

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

            let parts: Vec<&str> = passwd_entry.split(':').collect();
            if parts.len() >= 7 {
                let uid = parts[2];
                let gid = parts[3];
                let home = parts[5];
                let shell = parts[6];

                if uid.parse::<u32>().unwrap_or(999) >= 1000 {
                    bail!(
                        "User 'zeroclaw' exists but has unexpected UID {} (expected system UID < 1000).\n\
                         Recreate with: sudo {} && sudo {}",
                        uid,
                        del_cmd,
                        add_cmd
                    );
                }

                if !shell.contains("nologin") && !shell.contains("false") {
                    bail!(
                        "User 'zeroclaw' exists but has unexpected shell '{}'.\n\
                         Expected nologin/false for security. Fix with: sudo {} && sudo {}",
                        shell,
                        del_cmd,
                        add_cmd
                    );
                }

                if home != "/var/lib/zeroclaw" && home != "/nonexistent" {
                    eprintln!(
                        "⚠️  Warning: zeroclaw user has home directory '{}' (expected /var/lib/zeroclaw or /nonexistent)",
                        home
                    );
                }

                let _ = gid;
            }
            Ok(())

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Set the zeroclaw user's shell to nologin/false with the printed sudo commands.

When it happens

Trigger: Thrown at crates/zeroclaw-runtime/src/service/mod.rs:1450 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/9f12d40343ecd645. Report an issue: GitHub.