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 2.0 on macOS High Sierra - error: cannot connect to daemon at '/nix/var/nix/daemon-socket/socket' #1980
Comments
Did you source the newly installed shell profile script before entering the And if you, then what is the shell environment in which you run the |
|
I believe that the system-wide profile is going to source the Nix-specific one automatically once it's installed, i.e. there should be an entry for Nix in In any case, what is the shell environment in which you run the |
I think the daemon isn't running for some reason, what's the output of this command? sudo launchctl list | grep org.nixos |
sudo launchctl list | grep org.nixos 119 0 org.nixos.nix-daemon |
I'm having the exact same issue. Running High Sierra 10.13.3 (17D102) |
@teuffy Strange, that indicates the daemon is running. Does restarting it help? sudo launchctl kickstart -k system/org.nixos.nix-daemon |
Getting the same error and tried running EDIT: A full reboot seems to have done the trick though! |
Ah, a full reboot worked for me as well. |
That's odd, is 05cb8e5 not in 2.0? |
Same here, log-out and log-in to my account did not work, had to reboot the laptop. (macOS 10.12.6) |
I think the plist hard-codes the path to the daemon, so you need to launchctl unload then launchctl load it again |
Same issue for me :
|
confirmed that a full reboot fixes problem on High Sierra 10.13.4 and nix 2.0.4 |
I confirm that I experienced this issue as well and that rebooting is indeed an effective workaround. |
Experiencing this now on Catalina, I am attempting to reinstall /nix, which succeeded after creating /nix. I didn't get this error (but some SSL error) when trying to install nix-darwin, but after the restart this started to appear
the output of launchctl
ADDED: |
Different operating system, but logging in again allows connectino to daemon on Linux. Problem was probably due to unset permissions. |
Same problem happens in Catalina. But the problem is in the mac's side that the mac mounts / as read only. Solution for me:
|
Seems like on macos the daemon takes some time to reload, so you can see this error for about 10s before it boots up. |
|
I occasionally get the same error on system rebuilds on nixos:
|
I marked this as stale due to inactivity. → More info |
1 similar comment
I marked this as stale due to inactivity. → More info |
I am also having this issue on Fedora 37. Reboots have not worked. A reinstall did, for a while, but the issue has popped up again. |
I'm also getting this issue on mac os every time I try to upgrade the nix installation following the guidelines here https://nixos.org/manual/nix/stable/installation/upgrading.html I always need to re-install nix from scratch, which is quite annoying. Anyone has an idea why this is happening and how to prevent it? |
same @alessandrocandolini, thats currently my problem. what do you mean by re-installing from scratch? |
ah nevermind, just had to restart my mac |
I hit the issue on darwin with Edit: found a fix for the deletion on upgrade, following #6499 (comment) — replace I switched to a configuration that attempted to override some of the <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.nixos.nix-daemon</string>
<key>SoftResourceLimits</key>
<dict>
<key>NumberOfFiles</key>
<integer>10240</integer>
</dict>
</dict>
</plist> Plist xml is noisy; here's a simpler representation. { Label = "org.nixos.nix-daemon"
, SoftResourceLimits.NumberOfFiles = 10240
} No matter what I tried, I was unable to load the file; here's an example. > sudo -i sh -c 'launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist'
Load failed: 5: Input/output error
Try running `launchctl bootstrap` as root for richer errors. (I never saw a richer error.) I ended up manually copying the relevant plist file from the nix store (via a profile link) to sudo install -m 444 \
/nix/var/nix/profiles/default/Library/LaunchDaemons/org.nixos.nix-daemon.plist \
/Library/LaunchDaemons/org.nixos.nix-daemon.plist This worked; here's the contents of the plist file. { EnvironmentVariables.OBJC_DISABLE_INITIALIZE_FORK_SAFETY = "YES"
, KeepAlive = True
, Label = "org.nixos.nix-daemon"
, ProgramArguments =
[ "/bin/sh"
, "-c"
, "/bin/wait4path /nix/var/nix/profiles/default/bin/nix-daemon && exec /nix/var/nix/profiles/default/bin/nix-daemon"
]
, RunAtLoad = True
, SoftResourceLimits.NumberOfFiles = 1048576
, StandardErrorPath = "/var/log/nix-daemon.log"
, StandardOutPath = "/dev/null"
} With that, the However, as soon as I switched to the new configuration, the |
@dbaynard thanks. I used |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Same error here, and found I have a process that ran out of my cpu, which caused nix-daemon failed to response... |
|
nix-env (Nix) 2.0
-- fresh install on mbp high sierra with
$ bash <(curl https://nixos.org/nix/install)
-- testing with
nix-shell -p nix-info --run "nix-info -m"
-- output
error: cannot connect to daemon at '/nix/var/nix/daemon-socket/socket': No such file or directory
(use '--show-trace' to show detailed location information)
-- with trace
error: while evaluating the attribute '__impureHostDeps' of the derivation 'shell' at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating 'unique' at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/lib/lists.nix:483:12, called from /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:137:13:
while evaluating 'concatMap' at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/lib/lists.nix:102:18, called from /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:137:25:
while evaluating anonymous function at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:137:40, called from undefined position:
while evaluating the attribute 'darwin.CF' at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/default.nix:199:5:
while evaluating 'callPackageWith' at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/lib/customisation.nix:113:35, called from /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/default.nix:199:23:
while evaluating 'makeOverridable' at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/lib/customisation.nix:72:24, called from /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/lib/customisation.nix:117:8:
while evaluating anonymous function at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix:1:1, called from /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/lib/customisation.nix:74:12:
while evaluating the attribute 'cc.isClang' at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/stdenv/generic/default.nix:137:14:
while evaluating anonymous function at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/build-support/cc-wrapper/default.nix:8:1, called from /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/stdenv/darwin/default.nix:82:49:
while evaluating the attribute 'args' of the derivation 'Libsystem-osx-10.11.6' at /nix/store/7c23fi7pyh8gzrg733i6xhijb3344cp4-nixpkgs-18.09pre131986.893b69a54cb/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
cannot connect to daemon at '/nix/var/nix/daemon-socket/socket': No such file or directory
-- with sudo
sudo nix-shell -p nix-info --run "nix-info -m"
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I), at (string):1:13
The text was updated successfully, but these errors were encountered: