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

M4 Mac migrated nix daemon crashes immediately #11918

Open
skeet70 opened this issue Nov 19, 2024 · 3 comments
Open

M4 Mac migrated nix daemon crashes immediately #11918

skeet70 opened this issue Nov 19, 2024 · 3 comments
Labels

Comments

@skeet70
Copy link

skeet70 commented Nov 19, 2024

Describe the bug

I migrated from an M3 Mac to an M4 Mac. I uninstalled nix following the official docs on the M4, then reinstalled with the official installer. It installed without error after having me remove a bunch of backups, but now any nix command I run just gives me

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

Sometimes it'll download things for a bit before that, but once it has cached up to a point, any run of the same command will give me that error immediately. cat /var/log/nix-daemon.log shows a new two entries of

accepted connection from pid <unknown>, user mumu
libc++abi: terminating due to uncaught exception of type nix::Interrupted: error: interrupted by the user

I promise I'm not interrupting anything.

Steps To Reproduce

Doesn't seem particularly reproducible but:

  1. Use the Mac Migration assistant to migrate everything from a system with a working nix and nix-darwin installation
  2. Follow the official uninstallation instructions, removing backup files as it discovers them.
  3. sh <(curl -L https://nixos.org/nix/install) to install nix
  4. Run nix-shell -p nix-info --run "nix-info -m"

Expected behavior

The successful output of nix-info.

Additional Details

nix_2024-11-19-122317_MacBook-Pro.diag.txt
nix-2024-11-19-121348.ips.txt
nix-2024-11-19-122337.ips.txt
nix-2024-11-19-122801.ips.txt
nix-2024-11-19-124924.ips.txt
nix-2024-11-19-124934.ips.txt
nix-2024-11-19-125113.ips.txt
nix-2024-11-19-131620.ips.txt
nix-2024-11-19-134029.ips.txt
nix-2024-11-19-134043.ips.txt
nix-2024-11-19-134056.ips.txt
nix-daemon.log

nix-env --version output

nix-env (Nix) 2.25.2

Priorities

Add 👍 to issues you find important.

@skeet70 skeet70 added the bug label Nov 19, 2024
@polynomialspace
Copy link

Similar symptoms, in my case it seemed to be caused by SSL certs, resolved with solution in this post which then prompted (on channel install of nix-darwin):

error: Unexpected files in /etc, aborting activation
The following files have unrecognized content and would be overwritten:

  /etc/ssl/certs/ca-certificates.crt
  /etc/bashrc
  /etc/zshrc

Please check there is nothing critical in these files, rename them by adding .before-nix-darwin to the end, and then try again.

and following those instructions.

@skeet70
Copy link
Author

skeet70 commented Dec 18, 2024

Something along these lines was the fix for me as well.

@neilyio
Copy link

neilyio commented Feb 12, 2025

I'm still running into this on an M1 Mac... also a re-installation of Nix.

$ export NIX_CONFIG="experimental-features = nix-command flakes"
$ nix develop
performing daemon worker op: 19
error: Nix daemon disconnected unexpectedly (maybe it crashed?)

I manually started nix-daemon with debug to see some crash details:

~/D/nixbench ❯❯❯ sudo nix-daemon --debug
warning: $HOME ('/Users/neilyio') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
accepted connection from pid <unknown>, user neilhansen
received daemon op 19
objc[97521]: +[NSMutableString initialize] may have been in progress in another thread when fork() was called.
objc[97521]: +[NSMutableString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

I was able to move forward by running nix-daemon like this:

 sudo env OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES nix-daemon

nix develop is running now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants