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
Created attachment 858700 [details] root.log for buildSRPMFromSCM task the task is http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=1346912
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.
I think the question is what should be the relation of the mockbuild user (created inside the chroot) to the host system.
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
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
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.
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.
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.
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 ?
Can you please provide the reproducer? I tried mock -r fedora-23-x86_64 install mock and that works for me.
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.