Bug 1060811 - mock fails for buildSRPMFromSCM tasks in koji [NEEDINFO]
Summary: mock fails for buildSRPMFromSCM tasks in koji
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-03 16:35 UTC by Dan Horák
Modified: 2016-07-19 10:57 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-19 10:57:43 UTC
Type: Bug
Embargoed:
msuchy: needinfo?


Attachments (Terms of Use)
root.log for buildSRPMFromSCM task (53.56 KB, text/plain)
2014-02-03 16:37 UTC, Dan Horák
no flags Details

Description Dan Horák 2014-02-03 16:35:52 UTC
mock fails to create the mockbuild user for the buildSRPMFromSCM tasks in koji where mock is also installed in the chroot

from root.log
...
DEBUG util.py:91:  remove tree: /var/lib/mock/f21-build-341904-221587/root/builddir
DEBUG util.py:331:  Executing command: ['/usr/sbin/userdel', '-r', '-f', 'mockbuild'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'PROMPT_COMMAND': 'echo -n "<mock-chroot>"', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}
DEBUG util.py:281:  userdel: user 'mockbuild' does not exist
DEBUG util.py:371:  Child return code was: 6
DEBUG util.py:331:  Executing command: ['/usr/sbin/groupdel', 'mockbuild'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'PROMPT_COMMAND': 'echo -n "<mock-chroot>"', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}
DEBUG util.py:281:  groupdel: group 'mockbuild' does not exist
DEBUG util.py:371:  Child return code was: 6
DEBUG util.py:331:  Executing command: ['/usr/sbin/groupadd', '-g', '135', 'mockbuild'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'PROMPT_COMMAND': 'echo -n "<mock-chroot>"', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}
DEBUG util.py:281:  groupadd: GID '135' already exists
DEBUG util.py:371:  Child return code was: 4
...

The host running the builder is an up-to-date F-20.

Version-Release number of selected component (if applicable):
mock-1.1.35-1.fc20.noarch

Comment 1 Dan Horák 2014-02-03 16:37:23 UTC
Created attachment 858700 [details]
root.log for buildSRPMFromSCM task

the task is http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=1346912

Comment 2 Dan Horák 2014-02-03 16:43:12 UTC
It looks to me that the cause is when the mock group id is the same on the host and in the guest. Then the expectation about the chrootgid config value is wrong.

Comment 3 Dan Horák 2014-02-03 17:34:11 UTC
I think the question is what should be the relation of the mockbuild user (created inside the chroot) to the host system.

Comment 4 Dan Horák 2014-02-03 17:53:34 UTC
And I've used this as a workaround:

rm -rf /var/lib/mock/*f*-build-*
groupmod -g 425 mock
yum reinstall -y mock
service kojid restart

Comment 5 Miroslav Suchý 2014-05-19 17:56:57 UTC
Those ids can be set in /etc/mock/site-defaults.cfg and the defaults are:
  config_opts['chrootuid'] = os.getuid()
  config_opts['chrootgid'] = grp.getgrnam("mock")[2]

The first two errors should be ignored so the fatal is very likely only the last one:
DEBUG util.py:331:  Executing command: ['/usr/sbin/groupadd', '-g', '135', 'mockbuild'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'PROMPT_COMMAND': 'echo -n "<mock-chroot>"', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}
DEBUG util.py:281:  groupadd: GID '135' already exists

Comment 6 Miroslav Suchý 2014-11-03 13:20:04 UTC
I could not reproduce it with mock-1.2.0. But to be honest neither with mock-1.41.0
It think this was fixed in 3aed35b65d0c2d6078e3c3edef014123da209fc5
Which seems to land in F20 just week after your report:
https://admin.fedoraproject.org/updates/FEDORA-2014-2116/mock-1.1.36-1.fc20

Therefore closing as CURRENT_RELEASE, but if you can still reproduce, feel free to reopen.

Comment 7 Dustin C. Hatch 2015-03-02 14:03:48 UTC
As of mock-1.2.6, this is still an issue. The problem is that if mock is installed inside the chroot, the "mock" group gets created by the RPM, and then the host mock attempts to create a "mockbuild" group using the same GID. The workaround in comment #4 still applies, as it causes the host mock to create the "mockbuild" group with a different GID from the "mock" group. Another workaround is to not install mock inside the chroot.

Comment 8 Anthony Messina 2015-06-13 16:37:07 UTC
This continues to occur with Fedora 22 with:

mock-1.2.9-1.fc22.noarch
koji-builder-1.9.0-11.fc22.20150423git52a0188.noarch

I can't seem to reopen this issue so I'm adding a needinfo flag.

Comment 9 Nicolas Chauvet (kwizart) 2016-07-06 19:58:21 UTC
reproduced with current builders (f22 at least, for some reason f23 builders are using gid 425 for mock whereas the default package set it to 135)

I'm using mock in chroot because of fedpkg usage (or related) instead of fedpkg-minimal. Removing fedpkg would only be a workaround, but 

by the way, why mock (while creating the chroot) cannot use the 'mock' group instead of 'mockbuild' using group 135 ? 
Or is there some special reason why the name differ from the "host" whereas the gid is the same ?
Also why the existence of the mock user cannot be tested ?

Comment 10 Miroslav Suchý 2016-07-07 12:32:22 UTC
Can you please provide the reproducer? I tried
  mock -r fedora-23-x86_64 install mock
and that works for me.

Comment 11 Fedora End Of Life 2016-07-19 10:57:43 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.