-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Problems with multi-user (re)installation of nix on macOS #3261
Comments
I've also just run into this and was able to figure out that one of my installation runs left a dangling symlink or malformed file at This prevented one of the final steps of the multi-user installer from being run, and it would consistently error out with what you've been describing. Once I ran my cleanup scripts, deleted that file, and then reran the multi-user installer everything seemed to work. |
Also of note is now my user-defined Nix channels aren’t being picked up by default. I’m assuming that there’s some stale bashrc config somewhere that’s loading up a global list of channels and ignoring them. If I manually add When I load the shell installed and configured by |
I had the same issue and your solution worked for me. |
I spoke too soon. I just tried to install nix-darwin and the error came back. $ nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
error: unable to download 'https://github.com/LnL7/nix-darwin/archive/master.tar.gz': Problem with the SSL CA cert (path? access rights?) (77) |
I just had the same issue, and removing the old plist and reinstalling appears to have resolved it. Seems like there are two problems. One, the installer's uninstall instructions should mention to remove |
I ran into a very similar issue. I reran the multi-user OSX install script in an effort to upgrade nix from
fixed the issue for me. I initially got the same errors described in #2794 as well. |
cc @LnL7 |
In my case (nix 2.3.5) there was a |
I believe this was fixed in #4023. Perhaps someone here can confirm this? |
I'm having a different but seemingly related error... After installing Catalina, I reinstalled Nix with multiuser and added the line to the daemon conf that @maljub01 added. Now I'm getting |
This also seems to happen without the daemon... And occurs during installation when the channel is initially updated, without any failure message from the installer? |
Never mind, this is a problem with my work computer's environment, using their provided CA bundle fixed it. |
Mac OS multi-user installations are currently broken because all requests made by nix-daemon to the binary cache fail with: ``` unable to download ... Problem with the SSL CA cert (path? access rights?) (77). ``` This change ensures that the nix-daemon knows where to find the SSL CA cert file. Fixes #2899 and #3261. (cherry picked from commit b7c0223)
For those still with the issue after trying the above, check to see if this PR helps: #4171 |
I also had the dead symlink mentioned in #3261 (comment). This worked for me:
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/anyone-up-for-picking-at-some-nix-onboarding-improvements/13152/6 |
I marked this as stale due to inactivity. → More info |
I didn't come accross this problem anymore. There are also aparent fixes and an unchecked solution. Since this issue lacks a clear definition of done, I am taking the freedom as OP to close it now. If someone objects, it can be reopened. |
I had to do the opposite 🙃 (MacOS Monterey, Nix 2.11.1, multi-user install (reinstall))
This was my solution #
# create an up-to-date cert with keychain
#
sudo mkdir -p /etc/ssl/certs/
sudo rm -f /etc/ssl/certs/ca-certificates.crt
sudo security export -t certs -f pemseq -k /System/Library/Keychains/SystemRootCertificates.keychain -o /etc/ssl/certs/ca-certificates.crt
# force/ensure correct permissions on folders/files
sudo chown root /etc /etc/ssl /etc/ssl/certs/ /etc/ssl/certs/ca-certificates.crt
sudo chmod u=rwx,g=rx,o=rx /etc
sudo chmod u=rwx,g=rx,o=rx /etc/ssl
sudo chmod u=rwx,g=rx,o=rx /etc/ssl/certs/
sudo chmod u=rw,g=r,o=r /etc/ssl/certs/ca-certificates.crt
#
# link cert into nix
#
target="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt" # not sure if different for single-user install
export NIX_SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
sudo mkdir -p "$(dirname "$target")"
# if one exists back it up
[ -f "$target" ] && { [ -f "$target.old" ] || sudo mv "$target" "$target.old" 2>/dev/null; }
# link into nix profile
sudo ln -s "$NIX_SSL_CERT_FILE" "$target" |
Replying here to say I ran into the same issue today and the messages helped me fix it. I don't feel like the issue should be closed until a good solution is found. Re-installing |
This is still happening. Fixing the symlink was enough to fix the issue for me, though. |
I got this problem as well. 1. ZSHI fixed it by changing the shell in the org.nixos.nix-daemon plist to /bin/zsh Then moved the loading of /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh from /etc/zshrc to /etc/zshenv This means that zsh will load the environment variables for non interactive shells. I suspect this change should be made for other uses of zsh - zshenv is the correct place for environment variables - the only issue is altering the path in macOS as Apple messes it up. So I think the full zsh solution is to do this move to /etc/zshenv and then also do a correction to the $PATH in /etc/zshrc after Apple's path_helper is run. 2. Just alter the environment variableI edited the org.nixos.nix-daemon plist adding to the EnvironmentVariables tag already there. End result is
I think the latter is now the best solution |
@bestlem thank you. Your second solution is the only thing that worked for me. I've been experimenting with nix for three days now and it's been a wild ride thus far. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/ssl-ca-cert-error-on-macos/31171/5 |
Same issue today. After following the uninstall instructions on MacOS (I was uninstalling as my system wasn't reflecting anything the documentation says), I couldn't get it to run at the
Steps above helped:
The "problem" now though is that if we uninstall nix (and /nix gets removed),
I'm not immediately able with my still inexperienced nix knowledge to find the right folder in the store. => It seems the uninstall instructions are in need for a review. |
Try doing an |
Yeah.. figured that out after I had already deleted the broken symlink :-) I couldn't find any <...>-etc/ folder in the nix store. I wiped it all out, and then was able to find the <...>-etc/ directory on the nix store and how it all was symlinked. The uninstall instructions should contain some verbiage on deleting the files in /etc too. I'll see if I can find some time and make a PR for this in the next couple of days. |
This seems to be an issue at least for some users. So it should be reopened. |
Occasionally running this works as well.
Add something like this to the common error outputs? Or have |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nix-darwin-installation-question/54502/3 |
Preface
I do not know if this is a documentation issue, bug, or something different. Nevertheless it took me close to a day to get my nix working again - and I do not know if I solved the problem correctly.
Scenario
I'm running macOS Mojave 10.14.6 (18G1012) with a working single-user nix install and using darwin-nix. Before updating to macOS Catalina I wanted to switch to multi-user nix for all it's advantages.
Steps
I did not figure out how to convert from single to multi-user so the only viable solution I found was to remove my old installation and reinstall with
bash <(curl https://nixos.org/nix/install) --daemon
- after all my whole configuration is declaratively stored in mydarwin-configuration.nix
file.I first tried the recommendations from that script if you run it with an existing install. After removing these nix related files, the installation went through and suggested I could run
nix-shell -p nix-info --run "nix-info -m"
in a new shell. But that failed with varying results between:Now I tried several things and found many different potential reasons - not all documented. But to name a few:
all without success.
Solution (working, but is it correct?)
The break through was, when I found expipiplus1's tutorial how to convert a nix single-user install into multi-user one:
There he linked NIX_SSL_CERT_FILE to /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt for the deamon on linux. This file did exist and so I tried:
and it worked. But I have my doubts that this is the correct way, since I found this comment on discourse:
Context
The text was updated successfully, but these errors were encountered: