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

Installation fails on macOS High Sierra 10.13.2 beta #1684

Closed
currymj opened this issue Nov 15, 2017 · 24 comments
Closed

Installation fails on macOS High Sierra 10.13.2 beta #1684

currymj opened this issue Nov 15, 2017 · 24 comments
Assignees
Labels
installer macos Nix on macOS, aka OS X, aka darwin stale

Comments

@currymj
Copy link

currymj commented Nov 15, 2017

This seems to be failing at a different point than #1582 .

Michaels-MacBook-Pro:~ curry$ sh ./install-nix
downloading Nix 1.11.15 binary tarball for x86_64-darwin from 'https://nixos.org/releases/nix/nix-1.11.15/nix-1.11.15-x86_64-darwin.tar.bz2' to '/var/folders/25/h6pww5l537d8vfykld5dgp940000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.l6TJusD6'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 25.8M  100 25.8M    0     0   456k      0  0:00:58  0:00:58 --:--:--  573k
Switching to the Multi-User Darwin Installer
Welcome to the Multi-User Nix Installation

This installation tool will set up your computer with the Nix package
manager. This will happen in a few stages:

1. Make sure your computer doesn't already have Nix. If it does, I
   will show you instructions on how to clean up your old one.

2. Show you what we are going to install and where. Then we will ask
   if you are ready to continue.

3. Create the system users and groups that the Nix daemon uses to run
   builds.

4. Perform the basic installation of the Nix files daemon.

5. Configure your shell to import special Nix Profile files, so you
   can use Nix.

6. Start the Nix daemon.

Would you like to see a more detailed list of what we will do?
[y/n] n


---- let's talk about sudo -----------------------------------------------------
This script is going to call sudo a lot. Every time we do, it'll
output exactly what it'll do, and why.

Just like this:

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo echo

to demonstrate how our sudo prompts look


This might look scary, but everything can be undone by running just a
few commands. We used to ask you to confirm each time sudo ran, but it
was too many times. Instead, I'll just ask you this one time:

Can we use sudo?
[y/n] y

Yay! Thanks! Let's get going!

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo test -e /var/root/.nix-defexpr

making sure that /var/root/.nix-defexpr doesn't exist


---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo test -e /var/root/.nix-channels

making sure that /var/root/.nix-channels doesn't exist


---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo test -e /var/root/.nix-profile

making sure that /var/root/.nix-profile doesn't exist


---- hardware report -----------------------------------------------------------
           Cores:	8

---- Nix config report ---------------------------------------------------------
        Temp Dir:	/var/folders/25/h6pww5l537d8vfykld5dgp940000gn/T/tmp.XXXXXXXXXX.OK7d4a9c
        Nix Root:	/nix
     Build Users:	8
  Build Group ID:	30000
Build Group Name:	nixbld

build users:
    Username:	UID
     nixbld1:	30001
     nixbld2:	30002
     nixbld3:	30003
     nixbld4:	30004
     nixbld5:	30005
     nixbld6:	30006
     nixbld7:	30007
     nixbld8:	30008

Ready to continue?
[y/n] y


~~> Setting up the build group nixbld
            Exists:	Yes

~~> Setting up the build user nixbld1

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo /usr/sbin/sysadminctl -addUser -fullName Nix build user 1 -home /var/empty -UID 30001 -addUser nixbld1

Creating the Nix build user, nixbld1

2017-11-15 17:31:49.208 sysadminctl[6602:237284] Failed to authenticate with SystemAdministration framework.

---- oh no! --------------------------------------------------------------------
Jeeze, something went wrong. If you can take all the output and open
an issue, we'd love to fix the problem so nobody else has this issue.

:(

We'd love to help if you need it.

If you can, open an issue at https://github.com/nixos/nix/issues

Or feel free to contact the team,
 - on IRC #nixos on irc.freenode.net
 - on twitter @nixos_org
@grahamc
Copy link
Member

grahamc commented Nov 16, 2017

Yikes! I had tested this, but the users already existed. I will update my test tool to remove users ahead of time, and will look in to it.

@grahamc
Copy link
Member

grahamc commented Nov 16, 2017

Ok, so you can get around this via:

for i in `seq 1 8`; do
    sudo /usr/sbin/sysadminctl interactive -addUser "nixbld$i" -fullName "Nix build user $i" -home /var/empty -UID "3000$i" -addUser "nixbld$i"
done

but it'll ask for your password a bunch of times, unfortunately. I'm still looking in to a way to make this nicer for the user.

@grahamc
Copy link
Member

grahamc commented Nov 17, 2017

 gchristensen | creating users takes more than just being root
 gchristensen | you either have to call: sysadminctl interactive -addUser <- and this prompts for the admin password every time it is called
 gchristensen | or ... you call sysadminctl -adminUser <username> -adminPassword <password> -addUser <- but here you have to prompt the username/password ahead of time and pass it in over the CLI,
              | which feels icky
 gchristensen | for multi-user support perhaps a better approach is focusing on an upgrade path
 gchristensen | that way, users who want more safer nix on darwin can choose to, and suffer through the password prompts for a few minutes and not be scared away when they're first using it
 gchristensen | I feel bad that this is the case and I would love there to be an alternative, but I don't seee one
 gchristensen | maybe someone else knows some wizardry```

@currymj
Copy link
Author

currymj commented Nov 20, 2017

i'm now happily using nix, so thanks for the workaround. for anyone else who might have stumbled upon this issue after copy-and-pasting an error message into google, please note that the shell script in the comment above has a small typo. the first line should be:

for i in `seq 1 8`; do

@grahamc
Copy link
Member

grahamc commented Nov 21, 2017

Fixed mine, thank you for the correction! I'm glad it worked :)

@orivej
Copy link
Contributor

orivej commented Nov 22, 2017

It may be worth mentioning this issue at https://forums.developer.apple.com/community/beta/macos-1013-beta

@joelparkerhenderson
Copy link

Same issue. High Sierra 10.13.2 Beta (17C60c).

I concur with @orivej about it being worth mentioning the issue on the macOS beta forums, and specifically worth asking for whatever kind of help/wizardry/guidance that Apple's experts may have.

@orivej
Copy link
Contributor

orivej commented Nov 25, 2017

The Nix manual documents the usage of dscl to create build users, which appears to work with sudo on macOS 10.13.2 beta 4 (e.g. sudo dscl . create /Users/tmp12).

@joelparkerhenderson
Copy link

Thanks! The sudo script did work for me.

Could there be a way to at minimum to print a better/clearer error message if the build users aren't existing? For example, a pointer to the documentation for dscl, or a link to this github issue, or the script above? (E.g. anything that makes it clear that the Nix group knows about this, and is working on it, and has a workaround?)

@grahamc
Copy link
Member

grahamc commented Nov 26, 2017

dscl seems to work ... for now ...!

@grahamc
Copy link
Member

grahamc commented Nov 26, 2017

This seems to does not work, but testing further:

sudo dscl . create "/Users/nixbld99" RealName "Nix build user 99" PrimaryGroupID 30000 UserShell /sbin/nologin NFSHomeDirectory /var/empty UniqueID 30099 IsHidden 1
sudo dseditgroup -o edit -a nixbld99 -t user nixbld 

@robx
Copy link
Contributor

robx commented Dec 12, 2017

Just to note that the issue still exists, on non-beta High Sierra 10.13.2. And that after the work-around with creating nixbld users things seem fine.

@copumpkin
Copy link
Member

Hmm, so @grahamc is it not fixed? I assumed #1700 was it

@joelparkerhenderson
Copy link

I'm seeing a side effect that the Nix users now show up on the login screen, and in the menu bar upper right fast user switcher. For comparison, other system-related usernames do not show up.

What removes the Nix users from the login screen and/or fast user switcher?

@orivej
Copy link
Contributor

orivej commented Dec 13, 2017

@joelparkerhenderson:

dsclpath="/Users/$username"
/usr/bin/dscl . -create "$dsclpath" "IsHidden" "1"

@joelparkerhenderson
Copy link

@orivej Thank you!

If anyone else on this thread has a similar issue, here's what I did:

dscl . list /Users | 
grep '^nixbld' | 
xargs -I{} sudo dscl . create /Users/{} IsHidden 1

Then reboot, or at least log out and log back in.

@copumpkin
Copy link
Member

Does this mean we end up with a bunch of empty useless home directories under /Users?

@joelparkerhenderson
Copy link

joelparkerhenderson commented Dec 14, 2017

@copumpkin As far as I can tell yes. I'm a Nix novice. Can anyone expert here comment? [Edit: I was mistaken-- thanks @orivej -- the user entries are visible on my Mac by using the dscl command and /Local/Default/Users, and are not typical Finder directories.]

For whatever it's worth, as a novice user I personally prefer a simple setup as the default, such as the software creating one nix user, and also ideally naming the user "nix".

This is because a simple setup tends to be faster and easier to start using successfully, and to document, and to troubleshoot if needed. (E.g. there would be only one broken user, and the creating script would not need a for...seq loop, and the hiding script would not need xargs, etc.)

@orivej
Copy link
Contributor

orivej commented Dec 14, 2017

@copumpkin The /Users in that command looks like a directory but does not refer to a directory on a filesystem and works even if there are no /Users/nixbld directories.

@copumpkin
Copy link
Member

Oh, interesting, thanks!

@grahamc
Copy link
Member

grahamc commented Dec 15, 2017 via email

@stale
Copy link

stale bot commented Feb 15, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 15, 2021
@abathur
Copy link
Member

abathur commented Jun 16, 2021

I think this can probably be closed at this point?

If nothing else, the macOS behavior has changed in Big Sur (see #4531) necessitating installer changes in #4532 that obsolete a lot of the specifics/commands in this thread.

@stale stale bot removed the stale label Jun 16, 2021
@stale
Copy link

stale bot commented Jan 3, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Jan 3, 2022
@fricklerhandwerk fricklerhandwerk added installer macos Nix on macOS, aka OS X, aka darwin labels Sep 13, 2022
@abathur abathur closed this as completed Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installer macos Nix on macOS, aka OS X, aka darwin stale
Projects
None yet
Development

No branches or pull requests

10 participants