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

Nix Daemon disconnects on fresh install (MacOS) #12011

Open
2 tasks done
Dandandooo opened this issue Dec 5, 2024 · 8 comments
Open
2 tasks done

Nix Daemon disconnects on fresh install (MacOS) #12011

Dandandooo opened this issue Dec 5, 2024 · 8 comments
Labels
bug macos Nix on macOS, aka OS X, aka darwin

Comments

@Dandandooo
Copy link

Describe the bug

I uninstalled Nix following the guide for the multi-user install. I then reinstall the multi-user installation of nix. I am running the latest MacOS 15.2 Developer beta. When I run any nix-shell -p command, I get the following error:

error: Nix daemon disconnected unexpectedly (maybe it crashed?)

There is no other output.

When I run launchctl list | grep nix, there is no output.
When I run 'nix-daemon' I get:

error: cannot bind to socket at '/nix/var/nix/daemon-socket/socket': Address already in use

Steps To Reproduce

  1. sh <(curl -L https://nixos.org/nix/install)
  2. restart
  3. nix-shell -p nix-info --run "nix-info -m" or any other nix-shell command

Expected behavior

I should run without error

Metadata

nix-env (Nix) 2.25.3

Additional context

I am running the latest MacOS 15.2 Developer Beta. I have leftover nix files in my system, but I performed the full uninstall procedure listed on the guide.

Checklist


Add 👍 to issues you find important.

@Dandandooo Dandandooo added the bug label Dec 5, 2024
@abathur
Copy link
Member

abathur commented Dec 5, 2024

Is there a crash dump in console.app?

@Dandandooo
Copy link
Author

Yes there is. This is the latest one (copied to plaintext instead of .ips):
nix-crash.txt

@abathur
Copy link
Member

abathur commented Dec 5, 2024

Thanks--hopefully that'll light the way.

If you need to get Nix running, I'd try uninstalling and then installing some other recent versions to see if this is new trouble (hopefully not something to do with 15.2...).

I'd start with the most recent 2.24 and 2.18 releases.

@GiyoMoon
Copy link

GiyoMoon commented Dec 13, 2024

I just updated MacOS from 15.1.1 to 15.2 and I'm facing the same error

❯ nix config check
[PASS] PATH contains only one nix version.
[PASS] All profiles are gcroots.
error: cannot connect to socket at '/nix/var/nix/daemon-socket/socket': Connection refused
❯ nix --version
nix (Nix) 2.24.10

nix-daemon seems to be running but my user can't access it. (launchctl print system/org.nixos.nix-daemon says state = running)

@abathur
Copy link
Member

abathur commented Dec 13, 2024

With the caveat that this may actually be two separate issues (despite the socket being a point of commonality, the exact error and state of the daemon differs):

I checked in on Matrix and found at least one person (also running 2.24.10) able to affirm that they've taken the 15.2 update without seeing either of these errors.

I'm not familiar with what is going on here, but I'm taking it as a sign that this isn't a global issue with 15.2.

Unless someone happens by who knows what's going on: In both cases, it might also help to spend a little time trawling the full device log in Console.app around the time of your invocations and around daemon startup (may need to stop and start it) to see if there's anything that smells related.

The only real hunch I've got at the moment is that sometimes people disable a permission at some point (often because they notice something's unhelpfully just listed as "sh" because it's a wrapper and think it looks suspicious) and then an OS update leads to new enforcement/consequences for that previous action. Worth checking for anything like that to toggle it back on for a test.

@GiyoMoon
Copy link

GiyoMoon commented Dec 14, 2024

Running the update command from the nix manual fixed it for me!
https://nix.dev/manual/nix/2.17/installation/upgrading
The version stayed the same (2.24.10) so I assume something was wrong on my side locally hm.

@Dandandooo
Copy link
Author

I tried this and it didn't fix it for me. Same error message

@roberth roberth added the macos Nix on macOS, aka OS X, aka darwin label Dec 18, 2024
@cole-h
Copy link
Member

cole-h commented Dec 18, 2024

Seems similar to #11918, which has a comment linking to another potential solution: https://discourse.nixos.org/t/ssl-ca-cert-error-on-macos/31171/5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug macos Nix on macOS, aka OS X, aka darwin
Projects
None yet
Development

No branches or pull requests

5 participants