Skip to content
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

Uninstall errored because Sequoia upgrade deleted _nixbld1-4 #1197

Open
purplenoodlesoop opened this issue Sep 25, 2024 · 1 comment
Open
Labels
MacOS Darwin/MacOS

Comments

@purplenoodlesoop
Copy link

Error

Error: 
   0: Error reverting
   0: Action `create_or_merge_nix_config` errored
      Remove file `/etc/nix/nix.conf`

      Action `create_users_and_group` errored
      Multiple child errors

      Action `create_user` errored
      Failed to execute command with status 185 `"/usr/bin/dscl" "." "-delete" "/Users/_nixbld1"`, stdout: delete: Invalid Path

      stderr: <dscl_cmd> DS Error: -14009 (eDSUnknownNodeName)



      Action `create_user` errored
      Failed to execute command with status 185 `"/usr/bin/dscl" "." "-delete" "/Users/_nixbld2"`, stdout: delete: Invalid Path

      stderr: <dscl_cmd> DS Error: -14009 (eDSUnknownNodeName)



      Action `create_user` errored
      Failed to execute command with status 185 `"/usr/bin/dscl" "." "-delete" "/Users/_nixbld3"`, stdout: delete: Invalid Path

      stderr: <dscl_cmd> DS Error: -14009 (eDSUnknownNodeName)



      Action `create_user` errored
      Failed to execute command with status 185 `"/usr/bin/dscl" "." "-delete" "/Users/_nixbld4"`, stdout: delete: Invalid Path

      stderr: <dscl_cmd> DS Error: -14009 (eDSUnknownNodeName)




      Action `create_apfs_volume` errored
      Failed to execute command with status 1 `"/usr/sbin/diskutil" "apfs" "deleteVolume" "Nix Store"`, stdout: Started APFS operation
      Deleting APFS Volume from its APFS Container
      Unmounting disk3s7
      The volume "Nix Store" on disk3s7 couldn't be unmounted because it is in use by process 651 (securityd)

      stderr: Error: -69888: Couldn't unmount disk



Metadata

key value
version 0.19.0
os macos
arch aarch64

I did not run the repair before upgrading to Sequoia. Trying to use any nix command resulted in user conflict error being reported.

I uninstalled nix-darwin using the local uninstaller command darwin-uninstaller, which produced the following output

user defaults...
setting up user launchd services...
setting up /Applications/Nix Apps...
setting up pam...
applying patches...
setting up /etc...
system defaults...
setting up launchd services...
removing service org.nixos.activate-system
removing service org.nixos.nix-daemon
configuring networking...
setting up /Library/Fonts/Nix Fonts...
setting nvram variables...
rm: cannot remove '/Library/LaunchDaemons/org.nixos.nix-daemon.plist': No such file or directory
grep: /etc/bashrc: No such file or directory
Found no nix-daemon.sh reference in /etc/bashrc
add this snippet back to /etc/bashrc:

    # Nix
    if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
      . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
    fi
    # End Nix


NOTE: The /nix/var/nix/profiles/system* profiles still exist and won't be garbage collected.

Done!

After which, running /nix/nix-installer uninstall produced the autogenerated issue above.

I see that my situation is somewhat similar to #1193.

@cole-h
Copy link
Member

cole-h commented Sep 26, 2024

The error above is probably "expected" if you didn't run the repair before or after upgrading to Sequoia. Repairing is necessary for Nix to work on Sequoia in the first place because it deletes the _nixbld1 (UID 301) through _nixbld4 (UID 304) users to take for its own purposes.

The "failed to unmount" issue is because macOS sometimes likes to keep a handle to the Nix volume longer than it should. If you reboot you should be able to delete the Nix volume in Disk Utility and reinstall successfully.

@cole-h cole-h changed the title <autogenerated-issue> Uninstall errored because Sequoia upgrade deleted _nixbld1-4 Sep 26, 2024
@cole-h cole-h added the MacOS Darwin/MacOS label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MacOS Darwin/MacOS
Projects
None yet
Development

No branches or pull requests

2 participants