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

MacOS "oh no!" error - cleared up after an uninstall #6099

Closed
fwip opened this issue Feb 14, 2022 · 3 comments
Closed

MacOS "oh no!" error - cleared up after an uninstall #6099

fwip opened this issue Feb 14, 2022 · 3 comments

Comments

@fwip
Copy link

fwip commented Feb 14, 2022

Describe the bug

I think the Nix install script's uninstaller probably misses something, but I'm not sure how helpful this bug report will be for you. I ran the standard sh <(curl -L https://nixos.org/nix/install) installation procedure, got the generic "oh no!" error (logs posted below).

I then followed the uninstall instructions here: https://gist.github.com/toonn/94a38643d8fa5c9e06100cdfa81ba163#uninstalling

Then ran the install script again, and nix was successfully installed.

Steps To Reproduce

Not sure how to reproduce. I had experimented in the past with nix installs on my macbook, and likely got my system into an unusual state.

Expected behavior

I expected the Nix installer to properly clean up the leftovers of my old broken Nix installation, and install successfully.

nix-env --version output
After the installation is successful, I see

➜  nix-env --version
nix-env (Nix) 2.6.0

I don't believe nix-env was on my path prior to installation.

Additional context

Log of first install:

Link to Gist

Log of manual uninstall procedure:

projects/futz/nix took 4s
➜  sudo /usr/bin/vim /etc/zshrc

projects/futz/nix took 9s
➜  sudo /usr/bin/vim /etc/bashrc

projects/futz/nix took 7s
➜  sudo /usr/bin/vim /etc/zshrc

projects/futz/nix took 2s
➜  sudo vifs

projects/futz/nix took 5s
➜  cat /etc/synthetic.conf
nix

projects/futz/nix
➜  sudo rm /etc/synthetic.conf

projects/futz/nix
➜  sudo launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist
/Library/LaunchDaemons/org.nixos.nix-daemon.plist: Could not find specified service
Unload failed: 113: Could not find specified service

projects/futz/nix
➜  sudo rm /Library/LaunchDaemons/org.nixos.nix-daemon.plist

projects/futz/nix
➜  sudo rm /Library/LaunchDaemons/org.nixos.nix-daemon.plistprojects/futz/nix

projects/futz/nix
➜  sudo launchctl unload /Library/LaunchDaemons/org.nixos.activate-system.plist
/Library/LaunchDaemons/org.nixos.activate-system.plist: No such file or directory
Unload failed: 2: No such file or directory

projects/futz/nix
➜  sudo rm /Library/LaunchDaemons/org.nixos.activate-system.plist
rm: /Library/LaunchDaemons/org.nixos.activate-system.plist: No such file or directory

projects/futz/nix
➜  sudo rm -rf /etc/nix /var/root/.nix-profile /var/root/.nix-defexpr /var/root/.nix-channels ~/.nix-profile ~/.nix-defexpr ~/.nix-channels

projects/futz/nix
➜  sudo dscl . delete /Groups/nixbld

projects/futz/nix
➜  for i in $(seq 1 32); do sudo dscl . -delete /Users/_nixbld$i; done

projects/futz/nix took 3s
➜  sudo diskutil apfs deleteVolume /nix
Started APFS operation
Deleting APFS Volume from its APFS Container
Unmounting disk1s10
Erasing any xART session referenced by 134049EB-94D8-4494-8403-E91387350479
Deleting Volume
Removing any Preboot and Recovery Directories
Finished APFS operation

projects/futz/nix took 3s
➜  sudo rm /etc/bashrc.backup-before-nix /etc/zshrc.backup-before-nix

If it is relevant, my Mac info:

MacOS Monterey (12.2)
MacBook Pro (16-inch, 2019)

Happy to answer any other questions if you think it'll help. :)

@fwip fwip added the bug label Feb 14, 2022
@abathur
Copy link
Member

abathur commented Feb 14, 2022

This looks like the same immediate issue as #6053 (notes on the cause in #6053 (comment))

The broader issue (inability to remediate any install, or even install cleanly over a working install) is a common complaint. I've publicly mused on how we might get there in https://discourse.nixos.org/t/anyone-up-for-picking-at-some-nix-onboarding-improvements/13152

@fwip
Copy link
Author

fwip commented Feb 15, 2022

Thank you, it does look like the same cause.

@zimbatm
Copy link
Member

zimbatm commented Dec 11, 2022

closing as dup

@zimbatm zimbatm closed this as completed Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants