nix icon indicating copy to clipboard operation
nix copied to clipboard

Darwin: install script fails on user with conflicting UniqueID (multi-user mode)

Open singles opened this issue 6 years ago • 3 comments

Looks like install script doesn't check for UniqueID in multi-user mode

How to reproduce:

  1. Create a user with UniqueID 30005.
  2. Run curl https://nixos.org/nix/install | sh
  3. You will get
...
~~> Setting up the build user nixbld1
           Created:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 1
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

... 

~~> Setting up the build user nixbld4
           Created:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 4
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld5
<main> attribute status: eDSRecordAlreadyExists
<dscl_cmd> DS Error: -14135 (eDSRecordAlreadyExists)

One might assume, that the problem lies in the fact, that user nixbld5 already exists. Which isn't the case. Problem exists, because other user has conflicting UniqueID, in my case it was failing on nixbld9. Compare it with $ dscl . -list /Users UniqueID output:

nixbld1                 30001
nixbld2                 30002
nixbld3                 30003
nixbld4                 30004
nixbld5                 30005
nixbld6                 30006
nixbld7                 30007
nixbld8                 30008
nobody                  -2
prey                    30009 <----- user created by different tool
root                    0
singles                 501

Debugged with help of @periklis.

singles avatar May 25 '18 15:05 singles

cc @grahamc @LnL7 is that still a problem?

periklis avatar Oct 12 '18 05:10 periklis

I marked this as stale due to inactivity. → More info

stale[bot] avatar Feb 22 '21 13:02 stale[bot]

It's still a problem for me

Wandle% dscl . -list /Users UniqueID | grep 301
dscl . -list /Users UniqueID | grep 301
SonosDMS                 301

idontgetoutmuch avatar Mar 15 '22 17:03 idontgetoutmuch