Sporradic user '_nixbld2' in the group 'nixbld' does not exist #31

Open
opened 2024-10-07 08:25:42 +00:00 by szlend · 0 comments

When running a nix build on Darwin right after running the lix-installer, I sporadically get this error:

error: the user '_nixbld4' in the group 'nixbld' does not exist

This error is not related to Sequoia. For some reason the user database on MacOS doesn't always update immediately. My best guess is that this is some sort of timing issue in MacOS when creating users in quick succession. I could only reproduce it when running multiple MacOS VMs for CI which I assume would be more prone to context switching.

Querying for the user, I can see that it exists:

$ dscacheutil -q user
...
name: _nixbld4
password: ********
uid: 354
gid: 350
dir: /var/empty
shell: /sbin/nologin
gecos:

So the user does in fact exist, but getpwnam somehow still returns null.

Running odutil reset cache after the installation step appears to fix the issue. My suggestion would be to add it to the end of the user setup process.

When running a `nix build` on Darwin right after running the lix-installer, I sporadically get this error: ``` error: the user '_nixbld4' in the group 'nixbld' does not exist ``` **This error is not related to Sequoia.** For some reason the user database on MacOS doesn't always update immediately. My best guess is that this is some sort of timing issue in MacOS when creating users in quick succession. I could only reproduce it when running multiple MacOS VMs for CI which I assume would be more prone to context switching. Querying for the user, I can see that it exists: ``` $ dscacheutil -q user ... name: _nixbld4 password: ******** uid: 354 gid: 350 dir: /var/empty shell: /sbin/nologin gecos: ``` So the user does in fact exist, but [getpwnam](https://git.lix.systems/lix-project/lix/src/commit/ed9b7f4f84fd60ad8618645cc1bae2d686ff0db6/src/libstore/lock.cc#L75) somehow still returns `null`. Running `odutil reset cache` after the installation step appears to fix the issue. My suggestion would be to add it to the end of the user setup process.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix-installer#31
No description provided.