DeterminateSystems / nix-installer

Install Nix and flakes with the fast and reliable Determinate Nix Installer, with over 7 million installs.
https://determinate.systems
GNU Lesser General Public License v2.1
2.26k stars 56 forks source link

launchctl failure from uninstall -> reinstall #1290

Open cransom opened 3 days ago

cransom commented 3 days ago

Error

Error: 
   0: Install failure
   1: Error executing action
   2: Action `create_nix_hook_service` errored
   3: Failed to execute command with status 5 `"launchctl" "bootout" "system" "/Library/LaunchDaemons/systems.determinate.nix-installer.nix-hook.plist"`, stdout: 
      stderr: Boot-out failed: 5: Input/output error

Full output from uninstall run in case it's useful:

b12-3% /nix/nix-installer uninstall
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix uninstall plan (v0.19.0)

Planner: macos

Configured settings:
* extra_conf: [{"String":"trusted-users = runner\naccess-tokens = github.com=XXX"}]

Planned actions:
* Unconfigure Nix daemon related settings with launchctl
* Delete file `/Library/LaunchDaemons/systems.determinate.nix-installer.nix-hook.plist`
* Remove the Nix configuration from zsh's non-login shells
* Unconfigure the shell profiles
* Remove the Nix configuration in `/etc/nix/nix.conf`
* Unset the default Nix profile
* Remove time machine exclusions
* Remove Nix users and group
* Remove the directory tree in `/nix`
* Remove the APFS volume `Nix Store` on `disk3`

Proceed? ([Y]es/[n]o/[e]xplain): yes
 INFO Revert: Remove directory `/nix/temp-install-dir`
 INFO Revert: Configure Nix daemon related settings with launchctl
 INFO Revert: Create a `launchctl` plist to put Nix into your PATH
 INFO Revert: Configuring zsh to support using Nix in non-interactive shells
 INFO Revert: Configure Nix
 INFO Revert: Configure Time Machine exclusions
 INFO Revert: Create build users (UID 301-332) and group (GID 30000)
 INFO Revert: Provision Nix
 INFO Revert: Create an APFS volume `Nix Store` for Nix on `disk3` and add it to `/etc/fstab` mounting on `/nix`
Nix was uninstalled successfully!

b12-3% cd installer
# just a wrapper, it's calling `command -v nix || curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --determinate --extra-conf "<stuff>"
b12-3% ./runner_install.sh </dev/null
Automatic checking for updates is turned on
info: downloading installer (https://install.determinate.systems/nix/tag/v0.27.1/nix-installer-aarch64-darwin)
 INFO nix-installer v0.27.1
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
 INFO nix-installer v0.27.1
Bad request.
Could not find service "systems.determinate.nix-store" in domain for system
 INFO Step: Install Determinate Nixd
 INFO Step: Create an encrypted APFS volume `Nix Store` for Nix on `disk3` and add it to `/etc/fstab` mounting on `/nix`
 INFO Step: Provision Nix
 INFO Step: Create build users (UID 351-382) and group (GID 350)
 INFO Step: Configure Time Machine exclusions
 INFO Step: Configure Nix
 INFO Step: Configuring zsh to support using Nix in non-interactive shells
 INFO Step: Unload, then recreate a `launchctl` plist to put Nix into your PATH
Error:
   0: Install failure
   1: Error executing action
   2: Action `create_nix_hook_service` errored
   3: Failed to execute command with status 5 `"launchctl" "bootout" "system" "/Library/LaunchDaemons/systems.determinate.nix-installer.nix-hook.plist"`, stdout:
      stderr: Boot-out failed: 5: Input/output error

   3:

Location:
   src/cli/subcommand/install.rs:314

Metadata

key value
version 0.27.1
os macos
arch aarch64
cransom commented 3 days ago

It seems like there's a knock-on effect here as I didn't see determinate-nixd running and it doesn't look like the launch plist made it in:

b12-3% sudo launchctl list | grep deter
-       0       systems.determinate.nix-store
b12-3% ls -la /Library/LaunchDaemons
total 24
drwxr-xr-x   5 root  wheel   160 Nov 13 13:07 .
drwxr-xr-x  67 root  wheel  2144 May 23 08:28 ..
-rw-r--r--   1 root  admin   665 Oct 10  2023 homebrew.mxcl.netdata.plist
-r--r--r--   1 root  wheel   987 Dec 31  1969 org.nixos.nix-daemon.plist
-rw-r--r--   1 root  wheel   569 Nov 13 13:07 systems.determinate.nix-store.plist

repair/self-test don't catch that anything is amiss.