-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nix install breaks on UID clash #6153
Comments
looking into this further, my system already has a user with UniqueID 301 |
I ended up downloading the tarball, figuring out what user IDs are available on my system, modifying the appropriate file, and installing. It would be nice to recognise this kind of fault and provide a suggestion for how to fix it. |
I agree. Looks like it would detect a name clash but not a UID one. Can you update the title to mention the UID clash? For anyone trying a fix:
|
I have this problem but this
is too cryptic for me. How do I figure out what user IDs are available on my system and what are the appropriate files? Why not just remove the offending user ids? |
See also #2179 |
Not sure calling the comment by @ikuz cryptic will encourage them to provide more context...
You can find answers to the basic how-do-I-check questions in #5928, where the reporter also mentioned a SonosDMS user.
I suspect @ikuz is talking about downloading the installer tarball and editing it in line with the 2nd point in my comment at the end of #5928.
I don't think anyone will be able to answer this for you, because it's wrapped up in knowing what the user/UID are for and whether they are still in use. If the SonosDMS user is cruft from something you no longer use, removing it is probably fine. If not, removing it may break whatever uses it. |
Thanks @abathur. I'm including the detail here in case anyone else finds it useful
I did
to get a sorted list of users and user IDs. Then I identified a suitable gap (of at least 32 ids) and used that as the range. (in my case the SonosDMS user had the conflicting ID 301 (and I didn't want to remove or change that in case it breaks my Sonos install), but there was a suitable gap from 302 onwards)
I went to https://releases.nixos.org/ and browsed to find the tarball of nix that was relevant for my system (in my case it was Then I unpacked the tarball and edited the
Then I ran
Note that running
Eventually it succeeded. Hope that's helpful. |
Well I got further
I guess I should open a new ticket |
Could someone maybe change the install script so that NIX_FIRST_BUILD_UID can be passed as an environment variable to override the default value? Or something similar. Maybe also add to installation instructions something like that I think having an existing UID of 301 is a company-wide problem for us, and it would be a lot easier to persuade people to use Nix if I could just say "Please install it with In the long run it would of course be better if the install script handled this whole thing automatically. |
Doesn't f4d57aa work? |
OP says:
Ugh, it seems darwin uses a different code path:
|
Similar to f4d57aa ("installer: allow overriding nix user GID and UIDs"), but for darwin. (There's no corresponding *_GID in this script though, so skipping that.) Ref NixOS#6153.
On Ventura, with the system-installed grep, @ikuz 's one-liner to remove existing users did not work for me. I had to use:
(the difference is the inclusion of the After that, running my modified |
Hi @bjornfor Is there any plan to upstream your fix? |
I don't have anything other than the draft above, and don't have a good solution/time to fix it so that it can be integrated. |
I just got bit by this. In my case there was a "SonosDMS" user at 301—looks like some vestige of an old install. I just deleted the user to get past it (since I haven't used a Sonos product in years). The rest of the install worked fine. |
Could we both have a configurable first user id and if not provided, try incrementing uids until we either find an open block that can be used or fail if we are going to exceed the maximum number of uids? |
might run into this on macOS 15. 301 occupied by new daemon
|
IIRC we still use 30000 as the gid and only use 301 as a uid. |
yup same here
|
Egh--I guess that's both a UID and GID :) Can you survey the ID space to see what contiguous ranges are open? I think maybe cat We picked 301+ since it seemed like Apple focused on the 200 range. I'm hoping they've just filled it and are spilling over (and not, say, sprawling out over the 200-400 service user range and leaving us no good contiguous block). Hopefully we can just move new installs up to 360 or something. IDK. @cole-h Do you recall whether the detsys installer is sensitive to this same issue, or does it just skip UIDs that are taken? |
The last few are these here:
Maybe go 450+? |
Opened up a dedicated issue to track this. |
To repeat @ikuz's solution again: For a quick fix on macOS 15 install/reinstall with: NIX_FIRST_BUILD_UID="305" sh <(curl -L https://nixos.org/nix/install) |
@michaelvanstraten After upgrade to macOS 15, I've run your suggested command but get the following error:
Did you experience something similar? |
@niklasravnsborg you can try the following with caution: for u in $(sudo dscl . -list /Users | grep _nixbld); do sudo dscl . -delete /Users/$u; done |
Awesome, that did the trick for me regarding the nix installation :) Thank you |
Describe the bug
Tried to (re)install nix on mac os but it fails.
Steps To Reproduce
I followed instructions to remove a previous installation of nix: https://nixos.org/manual/nix/stable/installation/installing-binary.html
then did
sh <(curl -L https://nixos.org/nix/install)
eventually it fails, because it looks like there are already _nixbld users on the system.
Log of the installation process:
Expected behavior
nix installed correctly
Additional context
Mac OS version 12.1
The text was updated successfully, but these errors were encountered: