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

Error when trying to uninstall while running watchman. #1158

Open
ilyagr opened this issue Sep 10, 2024 · 1 comment
Open

Error when trying to uninstall while running watchman. #1158

ilyagr opened this issue Sep 10, 2024 · 1 comment
Labels
MacOS Darwin/MacOS

Comments

@ilyagr
Copy link
Contributor

ilyagr commented Sep 10, 2024

I had the following error while running the nix/nix-installer uninstall. (I was trying to reinstall Nix to update the build user UIDs). I'm not 100% this is actionable, but I thought I'd share.

I debugged with lsof /nix, and the reason was that I had watchman installed with Nix and it was running. One way to reproduce this would be to also install jj (I think nix profile install nixpkgs#jujutsu should do it), configure it to use Watchman, and jj git clone https://github.com/martinvonz/jj; cd jj; jj status. Then, watchman would be running in the same way it was for me and uninstalling Nix would fail in the same way.

Solution/Workaround

The solution for me was to killall watchman, wait a bit, check that lsof /nix no longer showed anything, and then run the uninstaller again.

Speculation

Perhaps the uninstaller should also run lsof /nix before trying to destroy the drive, and either give a friendly error message or try to kill those processes for me.

Error

Error: 
   0: Error reverting
   0: 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 0 (kernel)

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



Metadata

key value
version 0.15.1
os macos
arch aarch64
@cole-h
Copy link
Member

cole-h commented Sep 10, 2024

Thanks for the report!

Yeah, at this point at least, I don't know how we can fix this.

Maybe we should just try to delete the volume, and if it can't be deleted, print a big ole warning / error at the end, but otherwise continue to uninstall.

Upon reinstall, we'd notice that it already exists and will either use it (under some circumstances I don't quite remember enough about to list here), or will ask you to try to delete it again -- we could add a note that "you may need to reboot before running this".

@cole-h cole-h added the MacOS Darwin/MacOS label Sep 10, 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