DeterminateSystems / nix-installer

Install Nix and flakes with the fast and reliable Determinate Nix Installer, with over 7 million installs.
https://determinate.systems
GNU Lesser General Public License v2.1
2.15k stars 53 forks source link

Fresh installation failing right up-front #1229

Open rbhanot4739 opened 1 week ago

rbhanot4739 commented 1 week ago

Error

Error: 
   0: Install failure
   1: Error executing action
   2: Action `create_users_and_group` errored
   3: Action `create_user` errored
   4: Failed to execute command with status 4 `"useradd" "--home-dir" "/var/empty" "--comment" "Nix build user 1" "--gid" "30000" "--groups" "30000" "--no-user-group" "--system" "--shell" "/sbin/nologin" "--uid" "30001" "--password" "!" "nixbld1"`, stdout: 
      stderr: useradd: UID 30001 is not unique

Metadata

key value
version 0.27.0
os linux
arch x86_64

Backtrace

Installation failure, offering to revert...
Nix uninstall plan (v0.27.0)

Planner: linux (with default settings)

Planned actions:
* Remove Nix users and group
* Remove the directory tree in `/nix`
* Remove the directory `/nix`

Proceed? ([Y]es/[n]o/[e]xplain): yes
 INFO Revert: Remove directory `/nix/temp-install-dir`
 INFO Revert: Configure upstream Nix daemon service
 INFO Revert: Create directory `/etc/tmpfiles.d`
 INFO Revert: Configure Nix
 INFO Revert: Create build users (UID 30001-30032) and group (GID 30000)
 INFO Revert: Provision Nix
 INFO Revert: Create directory `/nix`
Error:
   0: Multiple errors

Location:
   src/cli/subcommand/install.rs:285

Error:
   0: Action `create_user` errored
   1: Failed to execute command with status 6 `"userdel" "nixbld1"`, stdout:
      stderr: userdel: user 'nixbld1' does not exist

   1:

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
cole-h commented 1 week ago

This means you already have a user that's taking up UID 30001. You may want to pick a different user ID base by passing the --nix-build-user-id-base flag to the install command; by default it's 30000 (so first user will try 30001, which is failing).

rbhanot4739 commented 1 week ago

There is no such user on the system, i verified by looking at /etc/passwd. Also nix isn't even installed on the machine, so there is no nix users/groups on the machine.

cole-h commented 1 week ago

What distribution are you running?

What is the output of the following commands?

$ id 30001
$ getent passwd 30001
$ sudo pwck
$ sudo grpck

What happens if you try the install again?