Subject: Re: bug#17786: group specified in `build-users-group' does not exist

From: [email-masked] (Ludovic Courtès)
Date: Tue, 17 Jun 2014 11:57:16 +0200

Hello,

Please keep [email-masked] Cc’d.

Tomas Cech <[email-masked]> skribis:

> On Mon, Jun 16, 2014 at 01:52:36PM +0200, Ludovic Courtès wrote:
>>Tomas Cech <[email-masked]> skribis:
>>
>>> On Mon, Jun 16, 2014 at 09:48:39AM +0200, Ludovic Courtès wrote:
>>>>Hello,
>>>>
>>>>Tomas Cech <[email-masked]> skribis:
>>>>
>>>>> guix package: error: build failed: the group `"guix-builders"' specified in
>>>>> `build-users-group' does not exist
>>>>>
>>>>> # grep guix /etc/passwd
>>>>> guix-builder1:x:61:479:Guix builder 1:/var/empty:/sbin/nologin
>>>>> guix-builder2:x:62:479:Guix builder 2:/var/empty:/sbin/nologin
>>>>> guix-builder3:x:63:479:Guix builder 3:/var/empty:/sbin/nologin
>>>>> guix-builder4:x:64:479:Guix builder 4:/var/empty:/sbin/nologin
>>>>> guix-builder5:x:65:479:Guix builder 5:/var/empty:/sbin/nologin
>>>>> # grep guix /etc/group
>>>>> guix-builders:x:479:guix-builder1,guix-builder2,guix-builder3,guix-builder4,guix-builder5
>>>>>
>>>>> Nothing seems to be obviously wrong, but guix ends with this error.
>>>>
>>>>Hmm, what does “getent group guix-builders” return?
>>>>And “getent passwd guix-builder1”?
>>>
>>> # getent group guix-builders
>>> guix-builders:x:479:guix-builder1,guix-builder2,guix-builder3,guix-builder4,guix-builder5
>>> # getent passwd guix-builder1
>>> guix-builder1:x:61:479:Guix builder 1:/var/empty:/sbin/nologin
>>
>>So that’s all good.
>>
>>The daemon simply does that (build.cc):
>>
>>--8<---------------cut here---------------start------------->8---
>>    /* Get the members of the build-users-group. */
>>    struct group * gr = getgrnam(settings.buildUsersGroup.c_str());
>>    if (!gr)
>>        throw Error(format("the group `%1%' specified in `build-users-group' does not exist")
>>            % settings.buildUsersGroup);
>>--8<---------------cut here---------------end--------------->8---
>>
>>Can you try getgrnam("guix-builders") in C or some other language (from
>>Guile: (getgrnam "guix-builders")) ?
>
> scheme@(guile-user)> (getgrnam "guix-builders")
> $2 = #("guix-builders" "x" 479 ("guix-builder1" "guix-builder2" "guix-builder3" "guix-builder4" "guix-builder5"))

Then there’s something weird: Guile’s getgrnam directly corresponds to
libc’s getgrnam(3), which is what guix-daemon uses in the snippet above.

Oh, I see the error message you gave above reads:

  the group `"guix-builders"'

Note the extra double quotes.

Could it be that the script that launches guix-daemon does something
that amounts to:

  guix-daemon '--build-users-group="guix-builders"'

That is, it leaves the double quotes as is in the argument?

Thanks,
Ludo’.