-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
error: could not set permissions on '/nix/var/nix/profiles/per-user' to 755: Operation not permitted #6667
Comments
What does |
|
Hmm. At a glance that looks right. What about |
(thanks for helping here) |
Hehe. Not sure we're headed anywhere fast. :) I was asking these questions to see if your situation seemed to square with #5801, which mentioned the same error message. Your responses make me think that's not the case, though. If you need to get it up and running, you may want to follow the full uninstall instructions before trying to reinstall it again: https://nixos.org/manual/nix/stable/installation/installing-binary.html#macos It might be ~nice to run down whatever leftover state is causing trouble, but it could easily be a time-sink that doesn't turn up anything obvious. I wouldn't really recommend that unless you're more interested in debugging it than getting up and running. |
OK. I followed the uninstall instructions and attempted a reinstall. Now receiving the following error after attempting multi-user install with: Edit: Note r.e. uninstall procedure no.4 & 5:
Output: ---- sudo execution ------------------------------------------------------------
to ensure the Nix volume is not mounted disk1s7 was already unmounted ~~> Configuring /etc/fstab to specify volume mount options ---- sudo execution ------------------------------------------------------------
to add nix to fstab vifs: editing error ---- oh no! -------------------------------------------------------------------- |
Ick. That might be an instance of the issue (hopefully) fixed in #6603 (fix not released, yet). Do you see a file at Edit: If you do find it, I think you can remove it, follow the uninstall instructions again for good measure, and hopefully run clean. |
Can't seem to locate |
Sigh. Vim's been a pain, here. We'll need to make it cough up the error. I don't have time to entirely break it down as I need to AFK for dinner, but basically:
🤞 |
Not sure if the above was helpful .. |
Ah, sorry--I should've come back and just written this out. I think you can run (copy/paste) this on your terminal: cat > "ex_cleanroom_wrapper" <<-EOF
#!/bin/sh
/usr/bin/ex -u NONE -n "\$@"
EOF
chmod 755 "ex_cleanroom_wrapper"
EDITOR=./ex_cleanroom_wrapper sudo vifs |
Thanks - that works. No errors to report back when executing
Getting |
Can you repeat the vifs step, and see what running |
|
Hmm. Not sure what to make of that. :/ To show my cards a bit, at least as far as we know, the We need to shake out what it's doing, but the file we're editing (fstab) and the tool we have to use to do it (vifs) make this a little tricky to do. I'm writing a full script that will do this more like how the installer does it--hopefully that will make it clearer what the problem is. This script assumes that the volume ( Hopefully we'll be able to reproduce the error if you can...
# vifs-test.nix
NIX_ROOT=/nix
uuid="$(/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -k "disk1s7")"
escaped_mountpoint="${NIX_ROOT/ /'\\\'040}"
set -x
SCRATCH=$(mktemp -d "${TMPDIR:-/tmp/}tmp.XXXXXXXXXX")
cat > "$SCRATCH/ex_cleanroom_wrapper" <<EOF
#!/bin/sh
/usr/bin/ex -V -u NONE -n "\$@"
EOF
chmod 755 "$SCRATCH/ex_cleanroom_wrapper"
EDITOR="$SCRATCH/ex_cleanroom_wrapper" sudo vifs <<EOF
:a
UUID=$uuid $escaped_mountpoint apfs rw,noauto,nobrowse,suid,owners
.
:x
EOF
printf "\nvifs exited $?\n" When I run this, the output is: $ ~/vifs-test.sh
+++ mktemp -d /var/folders/hg/pt5wsk1n54d1prjyg9pff5_r0000gn/T/tmp.XXXXXXXXXX
++ SCRATCH=/var/folders/hg/pt5wsk1n54d1prjyg9pff5_r0000gn/T/tmp.ECmW9BBZ7E
++ cat
++ chmod 755 /var/folders/hg/pt5wsk1n54d1prjyg9pff5_r0000gn/T/tmp.ECmW9BBZ7E/ex_cleanroom_wrapper
++ EDITOR=/var/folders/hg/pt5wsk1n54d1prjyg9pff5_r0000gn/T/tmp.ECmW9BBZ7E/ex_cleanroom_wrapper
++ sudo vifs
Password:
chdir(/etc)
fchdir() to previous dir
"/etc/fstab"
"/etc/fstab" 7 lines, 165 characters
Entering Ex mode. Type "visual" to go to Normal mode.
::a
UUID=A7F5D21B-5632-447B-8EC5-D9B5911D5E77 /nix apfs rw,noauto,nobrowse,suid,owners
.
::x
"/private/etc/fstab"
"/private/etc/fstab" 8 lines, 248 characters written++ printf '\nvifs exited 0\n'
vifs exited 0 |
My output looks similar:
|
Something isn't adding up, though I'm not sure what. Just back-tracking and thinking aloud... This was probably made moot by the first uninstall attempt, but: Going back through your first post, I think maybe pulling on the permissions/operation thread mislead us, and that this line was the thread to pull on: /Users/rosseyre/.nix-profile/bin/nix-env My best guess is that it was emitted by the if clause at the beginning of this section: nix/scripts/create-darwin-volume.sh Lines 801 to 813 in 3720a4f
And then I think the operation-not-permitted failure happened on the I hate to loop, but can you:
|
Thanks for grinding away with me on this. Pasting the console output for the uninstall procedure here as well, in case that tells us anything. Uninstall procedure output
^ neither contained lines:
"4. Edit fstab using sudo vifs to remove the line mounting the Nix Store volume on /nix, which looks like this, Found only this line in file:
Post-uninstall command console output:
|
Reinstall giving:
|
I do see a few things here. I think maybe we're falling through some logic holes in the uninstall directions:
I'll try to remember to open a PR to update those doc issues today or maybe this weekend. So, if you can:
|
Success! Thanks Travis. |
Nix working until a couple of days ago. Can no longer enter nix-shell. Possibly caused by recent MacOS and/or XCode update..?
Tried reinstall but exits with the following error:
error: could not set permissions on '/nix/var/nix/profiles/per-user' to 755: Operation not permitted
Any assistance would be appreciated!
System:
System Version: macOS 12.4 (21F79)
Kernel Version: Darwin 21.5.0
MacBookPro11,5
Relevant console output:
The text was updated successfully, but these errors were encountered: