Bug 430213

Summary: GID 0 is not unique (koji)
Product: [Fedora] Fedora Reporter: Bryce <root>
Component: mockAssignee: David Cantrell <dcantrell>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: mebrown
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-09 05:50:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bryce 2008-01-25 10:48:17 UTC
Description of problem:

koji-1.2.2-2.fc8
mock-0.8.19-1.fc8

I'm sort of lost with working through this one.
this is an issue in the interaction of koji and mock that I've been tearing my
hair out over. So feel free to toss this over to the koji folk if you feel it
doesn't fit here.

DEBUG util.py:239:  run cmd timeout(0): /usr/sbin/userdel -r mockbuild
DEBUG util.py:212:  Ran setarch 'x86_64'
DEBUG util.py:159:  chroot /var/lib/mock/dist-f8-ga-build-5-6/root/
DEBUG util.py:260:  userdel: user mockbuild does not exist
DEBUG util.py:239:  run cmd timeout(0): /usr/sbin/groupdel mockbuild
DEBUG util.py:212:  Ran setarch 'x86_64'
DEBUG util.py:159:  chroot /var/lib/mock/dist-f8-ga-build-5-6/root/
DEBUG util.py:260:  groupdel: group mockbuild does not exist
DEBUG util.py:239:  run cmd timeout(0): /usr/sbin/groupadd -g 0 mockbuild
DEBUG util.py:212:  Ran setarch 'x86_64'
DEBUG util.py:159:  chroot /var/lib/mock/dist-f8-ga-build-5-6/root/
DEBUG util.py:260:  groupadd: GID 0 is not unique
DEBUG util.py:75:  kill orphans

---

koji generates the mock config to be used in /etc/mock/koji/ so this is not
something I truly have control over 8/

#!/usr/bin/python -tt
# Auto-generated by the build system

# Koji buildroot id: 10
# Koji buildroot name: dist-f8-ga-build-10-6
# Koji repo id: 6
# Koji tag: dist-f8-ga-build
import os
config_opts['chrootuid'] = os.geteuid()
config_opts['chrootgid'] = os.getegid()
config_opts['runuser'] = '/sbin/runuser'
config_opts['chroot'] = '/usr/sbin/mock-helper chroot'
config_opts['chroothome'] = '/builddir'
config_opts['macros'] = '%vendor me\n%_topdir
/builddir/build\n%_rpmfilename%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm\n%_host
i386-linux-gnu\n%packager mr.trouble\n%distribution Unknown\n%_host_cpu i386'
config_opts['chrootgroup'] = 'kojibuilder'
config_opts['mount'] = '/usr/sbin/mock-helper mount'
config_opts['basedir'] = '/var/lib/mock'
config_opts['umount'] = '/usr/sbin/mock-helper umount'
config_opts['chroot_dep_package'] = 'buildsys-build'
config_opts['yum.conf'] =
'\n[main]\ncachedir=/var/cache/yum\ndebuglevel=1\nlogfile=/var/log/yum.log\nreposdir=/dev/null\nretries=20\no
bsoletes=1\ngpgcheck=0\nassumeyes=1\n\n#
repos\n\n[core]\nname=core\nbaseurl=file:///export/koji/repos/dist-f8-ga-build/6/i386\n'
config_opts['mknod'] = '/usr/sbin/mock-helper mknod'
config_opts['yum'] = '/usr/sbin/mock-helper yum'
config_opts['chrootuser'] = 'kojibuilder'
config_opts['clean'] = True
config_opts['rm'] = '/usr/sbin/mock-helper rm'
config_opts['buildgroup'] = 'build'
config_opts['root'] = 'dist-f8-ga-build-10-6'
config_opts['target_arch'] = 'i386'

--
when mock fires up it gets as far as running
/usr/sbin/groupadd -g 0 mockbuild
but dies since 0 is already assigned

now I hand built a much more simple mock cfg file to do the same as above and it
happily uses a non 0 GID
DEBUG util.py:239:  run cmd timeout(0): /usr/sbin/groupadd -g 490 mockbuild
But I can't determine for what reason the koji generated version assigns 0

BUT this all aside, would the solution be to to edit
/usr/lib/python2.5/site-packages/mock/backend.py :505 to allow mock to run
groupadd with the -o flag ? or is this just a terrible cowardly way of hiding a
configuration problem?


Phil
=--=

Comment 1 Michael E Brown 2008-01-25 14:32:50 UTC
You appear to be running koji as root (uid=0, gid=0):
  config_opts['chrootgid'] = os.getegid()

Run koji under some other gid should solve this. I'm not sure if koji is meant
to be run as root.

Comment 2 Jesse Keating 2008-01-25 15:22:44 UTC
Actually, what version of koji are you running?  I suspect you're running an
older version of koji with a newer mock or vice-versa.

Comment 3 Bryce 2008-01-25 16:26:56 UTC
Stock f8 rpms (verified (rpm -qV.. ))
koji-1.2.2-2.fc8
mock-0.8.19-1.fc8

well kojid is started out of the system services so the daemon will be root owned
the only directive that might have an impact from the koji side is
mockuser=kojibuilder

[root@ca-test54 mock]# grep kojibuilder /etc/passwd
kojibuilder:x:495:489::/builddir:/bin/bash

Oddly 2 hours later, many reboots and screams later, it started giving me the
495 ID,.. (go figure) though I left in the -o flag as a 'just in case it ever
happens again'

I guess this is closeable now

Phil
=--=



Comment 4 Jesse Keating 2008-01-25 16:37:46 UTC
Hrm, mock got updated on F8, but koji in F8 won't work well with that mock
version.  I guess we'll have to pull the rawhide koji over to F8 too, and get
skvidal to update createrepo there as well.  Michael we should time this with
getting mock 0.9 on F8.

Comment 5 Bug Zapper 2008-11-26 09:33:46 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Bug Zapper 2009-01-09 05:50:50 UTC
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 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.

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