Koji RPM Build System Configuration and Usage

In the previous short article series I’ve shown you how to install Koji and all its components like Kojid, Kojira, Koji-Hub. However to fully use it we need to do some initial configuration that can only be persisted for a fresh install by a early DB Backup, I’ll remind you of that later.

To understand what we are doing here you need to know a bit more about Kojis philosophy:

Koji uses Tags to identify and mark various stages in the RPM building workflow. Some tags are logically linked together to the same flow, like building for a certain target distribution, e.g. CentOS6. We will call this target tag dist-centos6. But you can maintain multiple distribution-builds on the same Koji instance, just add more tags then according to this article.

We also need a tag that is used for builds and inherits the build target. We call this tag dist-centos6-build
Koji is building RPMs in a chroot with the mock tool. It also installs basic packages to those buildroots from the virtual yum package groups named build and srpm-build. So we need to tell Koji which packages we need. You can extend that list to your needs but choose wise: These packages are pulled in for every build then.
Also, Koji needs to know where to find/pull packages from, therefore we add external repositories, the base repo as the very first !!

When doing this, stick to the tag name pattern dist-SOME_NAME,  dist-SOME_NAME-build

koji add-tag dist-centos6
koji add-tag --parent dist-centos6 --arches "x86_64" dist-centos6-build
# external repos
koji add-external-repo -t dist-centos6-build dist-centos6-repo http://centos.bio.lmu.de/6/os/\$arch/
koji add-external-repo -t dist-centos6-build dist-epel6-repo http://ftp-stud.hs-esslingen.de/pub/epel/6/\$arch/
koji add-target dist-centos6 dist-centos6-build
# virtual build yum groups
koji add-group dist-centos6-build build
koji add-group dist-centos6-build srpm-build
koji add-group-pkg dist-centos6-build build bash bzip2 coreutils cpio diffutils findutils gawk gcc grep sed gcc-c++ gzip info patch redhat-rpm-config rpm-build shadow-utils tar unzip util-linux-ng which make
koji add-group-pkg dist-centos6-build srpm-build bash cvs gnupg make redhat-rpm-config rpm-build shadow-utils wget rpmdevtools

koji regen-repo dist-centos6-build

This last command is always a good shot to fix errors you might run into, especially after altering the external repos or adding packages to the build groups.

Now we are ready to go and build our first package

su kojiadmin;

koji build --scratch dist-centos6 nginx-1.2.7-1.el6.ngx.src.rpm

This uses a local source rpm and builds it “scratch”, meaning that its like sandboxed and not going into the usual Koji workflow. This is useful for quick tests or building packages that you dont want to archive/maintain with Koji permanently.

If that worked out you know that Koji is running fine. Now go ahead and add the packages you want to permanently maintain with Koji

koji add-pkg --owner kojiadmin dist-centos6 nginx

# and build them
koji build dist-centos6 nginx-1.2.7-1.el6.ngx.src.rpm

Note that you can only successfully build an NVRA (Name-Version-Release-Architecture) once ! So you need to bump the release number or version up if you change sth within the srpm.

In the next article, I will show you how to maintain your packages in a Git (or SVN) repository and letting Koji build SRPM and RPM from there , because supplying SRPM locally is not that convenient.

    • Tomasz K.
    • February 11th, 2014 8:24am

    Hi, I’ve tried your instructions:

    [kojiadmin@koji root]$ koji remove-external-repo dist-epel6-repo
    [kojiadmin@koji root]$ koji add-external-repo -t dist-eurolinux6-build dist-epel6-repo http://ftp-stud.hs-esslingen.de/pub/epel/6/\$arch/
    Created external repo 2
    Added external repo dist-epel6-repo to tag dist-eurolinux6-build (priority 10)
    [kojiadmin@koji root]$ koji add-target dist-eurolinux6 dist-eurolinux6-build
    [kojiadmin@koji root]$ koji add-group dist-eurolinux6-build build
    [kojiadmin@koji root]$ koji add-group dist-eurolinux6-build srpm-build
    [kojiadmin@koji root]$ koji add-group-pkg dist-eurolinux6-build build bash bzip2 coreutils cpio diffutils findutils gawk gcc grep sed gcc-c++ gzip info patch redhat-rpm-config rpm-build shadow-utils tar unzip util-linux-ng which make
    [kojiadmin@koji root]$ koji add-group-pkg dist-eurolinux6-build srpm-build bash cvs gnupg make redhat-rpm-config rpm-build shadow-utils wget rpmdevtools
    [kojiadmin@koji root]$ koji regen-repo dist-eurolinux6-build
    Regenerating repo for tag dist-eurolinux6-build
    Watching tasks (this may be safely interrupted)…
    1 newRepo (dist-eurolinux6-build): free

    And it hangs on this for ~20 hours…

    I’ve checked the logs and there is nothing in httpd logs, but there is such line in kojid.log:
    2014-02-07 21:30:48,167 [ERROR] koji.build: Kerberos authentication failed: ‘Cannot contact any KDC for requested realm’ (-1765328228)
    2014-02-07 21:59:06,910 [ERROR] koji.build: Kerberos authentication failed: ‘Cannot contact any KDC for requested realm’ (-1765328228)
    2014-02-08 11:42:35,872 [INFO] koji.build: Starting up
    2014-02-10 09:36:55,591 [INFO] koji.build: Starting up

    And there is such line in kojira.log:
    2014-02-08 11:46:31,516 [INFO] koji: Entering main loop
    2014-02-09 16:34:17,978 [INFO] koji: Try #1 for call 3400 (getActiveRepos) failed: (110, ‘Operation timed out.’)

    Do you have any ideas what could went wrong?

    Thanks in advance,
    Tom

      • phil
      • February 11th, 2014 1:44pm

      unfortunately I cant tell what exactly is wrong. Kojira is the right spot to look at tho. Try to run Kojira in debug mode.
      I often dug into the python code of Koji and added simple printf logging here and there to find out what was wrong. Debugging Koji can be really annoying.

    • Tomasz K.
    • February 11th, 2014 1:43pm

    Ok, it works, this post helped me a lot:
    http://alouche.net/blog/2011/04/01/kojid-dead-but-subsys-locked/

    BTW. you’re missing “user = kojid” in kojid.conf

      • phil
      • February 11th, 2014 1:57pm

      thanks. fixed kojid.conf in the other article 🙂

  1. Hello; thanks for that tutorial it is really helpful.
    The most interesting part I was looking for was how to enable building from an http or SSH git repository. Seems like you haven’t posted the article yet! am I wrong?

  2. Thanks PHIL. Your article would certainly be a life-saver. I reckon Fedora documentation lacks clarity and examples.

    I am just blocked by the external repo thing which is crucial.
    When I launch the command : koji regen-repo …….
    It takes more than 2 hours and at last fires an error related to HTTP POST. (413 Request Entity Too Large).

    I am using this repo:
    koji add-external-repo -t mypackage-b centos65-repo http://centos.mirror.xtratelecom.es/6.5/os/\$arch/
    ——————–trace::

    koji regen-repo mypackage-b
    Regenerating repo for tag mypackage-b
    Watching tasks (this may be safely interrupted)…
    222 newRepo (mypackage-b): free
    222 newRepo (mypackage-b): free -> open (kojibuilder.mycompany.fr)
    224 createrepo (i386): free
    223 createrepo (x86_64): free
    224 createrepo (i386): free -> open (kojibuilder.mycompany.fr)
    223 createrepo (x86_64): free -> open (kojibuilder.mycompany.fr)
    224 createrepo (i386): open (kojibuilder.mycompany.fr) -> FAILED: Fault: <Fault 1: 'Traceback (most recent call last):\n File "/usr/lib/python2.6/site-packages/koji/daemon.py", line 1162, in runTask\n response = (handler.run(),)\n File "/usr/lib/python2.6/site-packages/koji/tasks.py", line 147, in run\n return koji.util.call_with_argcheck(self.handler, self.params, self.opts)\n File "/usr/lib/python2.6/site-packages/koji/util.py", line 139, in call_with_argcheck\n return func(*args, **kwargs)\n File "/usr/sbin/kojid", line 2859, in handler\n self.session.uploadWrapper(\'%s/%s\' % (self.datadir, f), uploadpath, f)\n File "/usr/lib/python2.6/site-packages/koji/__init__.py", line 2048, in uploadWrapper\n self.fastUpload(localfile, path, name, callback, blocksize)\n File "/usr/lib/python2.6/site-packages/koji/__init__.py", line 1991, in fastUpload\n result = self._callMethod(\'rawUpload\', (chunk, ofs, path, name))\n File "/usr/lib/python2.6/site-packages/koji/__init__.py", line 1895, in _callMethod\n return self._sendCall(handler, headers, request)\n File "/usr/lib/python2.6/site-packages/koji/__init__.py", line 1806, in _sendCall\n return self._sendOneCall(handler, headers, request)\n File "/usr/lib/python2.6/site-packages/koji/__init__.py", line 1828, in _sendOneCall\n ret = self._read_xmlrpc_response(response, handler)\n File "/usr/lib/python2.6/site-packages/koji/__init__.py", line 1860, in _read_xmlrpc_response\n response.status, response.reason, response.msg)\nProtocolError: \n’>
    0 free 2 open 0 done 1 failed

    Edit: Shortened by Phil for clarity

      • phil
      • February 28th, 2014 2:19pm

      Did you get this solved? Never encountered this..

    • Gurveer
    • February 27th, 2014 10:18am

    Hi Phil,

    I am new to Koji. I have setup a Koji environment and when i am building a src.rpm i am getting error could not init mock buildroot.

    $ koji build –scratch dist-centos6 sam-1-1.src.rpm
    Uploading srpm: sam-1-1.src.rpm
    [====================================] 100% 00:00:00 2.13 KiB 27.90 KiB/sec
    Created task: 27
    Task info: http://koji.example.com/koji/taskinfo?taskID=27
    Watching tasks (this may be safely interrupted)…
    27 build (dist-centos6, sam-1-1.src.rpm): free
    27 build (dist-centos6, sam-1-1.src.rpm): free -> open (kojid.example.com)
    28 buildArch (sam-1-1.src.rpm, noarch): free
    28 buildArch (sam-1-1.src.rpm, noarch): free -> FAILED: BuildrootError: could not init mock buildroot, mock exited with status 1; see build.log for more information
    0 free 1 open 0 done 1 failed
    27 build (dist-centos6, sam-1-1.src.rpm): open (kojid.example.com) -> FAILED: BuildrootError: could not init mock buildroot, mock exited with status 1; see build.log for more information
    0 free 0 open 0 done 2 failed

    27 build (dist-centos6, sam-1-1.src.rpm) failed

    Can you help me in this.

      • phil
      • February 27th, 2014 12:49pm

      Hi Gurveer,

      could you provide all log files please? root.log build.log etc..

    • Gurveer
    • February 28th, 2014 1:52pm

    I got nothing in logs.

    [kojiadmin@koji SRPMS]$ koji build –scratch dist-centos6 sam-1-1.src.rpm
    Uploading srpm: sam-1-1.src.rpm
    [====================================] 100% 00:00:00 2.13 KiB 23.29 KiB/sec
    Created task: 59
    Task info: http://koji.example.com/koji/taskinfo?taskID=59
    Watching tasks (this may be safely interrupted)…
    59 build (dist-centos6, sam-1-1.src.rpm): free
    59 build (dist-centos6, sam-1-1.src.rpm): free -> open (kojid.example.com)
    60 buildArch (sam-1-1.src.rpm, noarch): free
    60 buildArch (sam-1-1.src.rpm, noarch): free -> FAILED: BuildrootError: could not init mock buildroot, mock exited with status 1; see build.log for more information
    0 free 1 open 0 done 1 failed
    59 build (dist-centos6, sam-1-1.src.rpm): open (kojid.example.com) -> FAILED: BuildrootError: could not init mock buildroot, mock exited with status 1; see build.log for more information
    0 free 0 open 0 done 2 failed

    EDIT: shortened by Phil for clarity

      • phil
      • February 28th, 2014 2:11pm

      what about mock_output.log root.log etc ? Could you pastebin them for me to look at ? (Its really annoying to troubleshoot Koji, even if sitting in front of it)

    • Gurveer
    • February 28th, 2014 9:42pm

    Hi Phil,

    Following is root.log and how i can find mock_output.log ?

    INFO backend.py:1017: Mock Version: 1.1.32
    DEBUG backend.py:334: rootdir = /var/lib/mock/dist-centos6-build-21-6/root/
    DEBUG backend.py:335: resultdir = /var/lib/mock/dist-centos6-build-21-6/result
    INFO backend.py:338: calling preinit hooks
    DEBUG backend.py:505: create skeleton dirs
    DEBUG util.py:62: ensuring that dir exists: /var/lib/mock/dist-centos6-build-21-6/root/var/lib/rpm
    DEBUG util.py:65: creating dir: /var/lib/mock/dist-centos6-build-21-6/root/var/lib/rpm
    …. shortened here
    DEBUG backend.py:527: touch required files
    DEBUG util.py:73: touching file: /var/lib/mock/dist-centos6-build-21-6/root/etc/mtab
    DEBUG util.py:73: touching file: /var/lib/mock/dist-centos6-build-21-6/root/etc/fstab
    DEBUG util.py:73: touching file: /var/lib/mock/dist-centos6-build-21-6/root/var/log/yum.log
    DEBUG backend.py:353: configure yum
    DEBUG backend.py:368: configure yum priorities
    DEBUG util.py:62: ensuring that dir exists: /var/lib/mock/dist-centos6-build-21-6/root/etc/yum/pluginconf.d
    DEBUG util.py:65: creating dir: /var/lib/mock/dist-centos6-build-21-6/root/etc/yum/pluginconf.d
    DEBUG backend.py:377: configure yum rhnplugin
    DEBUG util.py:62: ensuring that dir exists: /var/lib/mock/dist-centos6-build-21-6/root/etc/yum/pluginconf.d
    DEBUG util.py:62: ensuring that dir exists: /var/lib/mock/dist-centos6-build-21-6/root/etc
    DEBUG util.py:88: remove tree: /var/lib/mock/dist-centos6-build-21-6/root/dev
    DEBUG util.py:62: ensuring that dir exists: /var/lib/mock/dist-centos6-build-21-6/root/dev/pts
    DEBUG util.py:65: creating dir: /var/lib/mock/dist-centos6-build-21-6/root/dev/pts
    DEBUG util.py:62: ensuring that dir exists: /var/lib/mock/dist-centos6-build-21-6/root/dev/shm
    DEBUG util.py:65: creating dir: /var/lib/mock/dist-centos6-build-21-6/root/dev/shm
    DEBUG backend.py:472: kver == 2.6.32-220.el6.x86_64
    DEBUG util.py:314: Executing command: [‘/bin/mount’, ‘-n’, ‘-t’, ‘proc’, ‘proc’, ‘/var/lib/mock/dist-centos6-build-21-6/root/proc’] with env {‘LANG’: ‘en_US.UTF-8’, ‘TERM’: ‘vt100’, ‘SHELL’: ‘/bin/bash’, ‘HOSTNAME’: ‘mock’, ‘HOME’: ‘/builddir’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’}
    DEBUG util.py:354: Child return code was: 0
    DEBUG util.py:314: Executing command: [‘/bin/mount’, ‘-n’, ‘-t’, ‘sysfs’, ‘mock_chroot_sys’, ‘/var/lib/mock/dist-centos6-build-21-6/root/sys’] with env {‘LANG’: ‘en_US.UTF-8’, ‘TERM’: ‘vt100’, ‘SHELL’: ‘/bin/bash’, ‘HOSTNAME’: ‘mock’, ‘HOME’: ‘/builddir’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’}
    DEBUG util.py:354: Child return code was: 0
    DEBUG util.py:314: Executing command: [‘/bin/mount’, ‘-n’, ‘-t’, ‘tmpfs’, ‘mock_chroot_shmfs’, ‘/var/lib/mock/dist-centos6-build-21-6/root/dev/shm’] with env {‘LANG’: ‘en_US.UTF-8’, ‘TERM’: ‘vt100’, ‘SHELL’: ‘/bin/bash’, ‘HOSTNAME’: ‘mock’, ‘HOME’: ‘/builddir’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’}
    DEBUG util.py:264: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    DEBUG util.py:264: job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    DEBUG util.py:264: job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    DEBUG util.py:264: job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    DEBUG util.py:354: Child return code was: 0
    DEBUG util.py:314: Executing command: [‘/bin/mount’, ‘-n’, ‘-t’, ‘devpts’, ‘-o’, ‘gid=5,mode=0620,ptmxmode=0666,newinstance’, ‘mock_chroot_devpts’, ‘/var/lib/mock/dist-centos6-build-21-6/root/dev/pts’] with env {‘LANG’: ‘en_US.UTF-8’, ‘TERM’: ‘vt100’, ‘SHELL’: ‘/bin/bash’, ‘HOSTNAME’: ‘mock’, ‘HOME’: ‘/builddir’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’}
    DEBUG util.py:354: Child return code was: 0
    DEBUG backend.py:948: [‘/usr/bin/yum’, ‘–installroot’, ‘/var/lib/mock/dist-centos6-build-21-6/root/’, ‘groupinstall’, ‘build’]
    DEBUG util.py:314: Executing command: [‘/usr/bin/yum’, ‘–installroot’, ‘/var/lib/mock/dist-centos6-build-21-6/root/’, ‘groupinstall’, ‘build’] with env {‘LANG’: ‘en_US.UTF-8’, ‘TERM’: ‘vt100’, ‘SHELL’: ‘/bin/bash’, ‘HOSTNAME’: ‘mock’, ‘PROMPT_COMMAND’: ‘echo -n “”‘, ‘HOME’: ‘/builddir’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’}
    DEBUG util.py:264: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    DEBUG util.py:264: job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    DEBUG util.py:264: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    DEBUG util.py:264: job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    DEBUG util.py:264: Warning: Group build does not have any packages.
    DEBUG util.py:354: Child return code was: 0
    DEBUG util.py:314: Executing command: /usr/bin/repoquery -c /var/lib/mock/dist-centos6-build-21-6/root//etc/yum.conf -a –qf ‘%{nevra} %{buildtime} %{size} %{pkgid} %{repoid}’ > /var/lib/mock/dist-centos6-build-21-6/result/available_pkgs with env {‘LANG’: ‘en_US.UTF-8’, ‘TERM’: ‘vt100’, ‘SHELL’: ‘/bin/bash’, ‘HOSTNAME’: ‘mock’, ‘HOME’: ‘/builddir’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’}
    DEBUG util.py:264: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    DEBUG util.py:264: job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    DEBUG util.py:116: kill orphans

      • phil
      • March 1st, 2014 1:17pm

      mock_output.log is where other logs are, however not always created if an error happens to early, so root.log is good.

      So, check if /var/lib/mock/dist-centos6-build-21-6/ and subdirs exist.

      Also try to run this command manually as mock user as it seems to fail.

      DEBUG backend.py:948: [‘/usr/bin/yum’, ‘–installroot’, ‘/var/lib/mock/dist-centos6-build-21-6/root/’, ‘groupinstall’, ‘build’]
      DEBUG util.py:314: Executing command: [‘/usr/bin/yum’, ‘–installroot’, ‘/var/lib/mock/dist-centos6-build-21-6/root/’, ‘groupinstall’, ‘build’] with env {‘LANG’: ‘en_US.UTF-8′, ‘TERM’: ‘vt100′, ‘SHELL’: ‘/bin/bash’, ‘HOSTNAME’: ‘mock’, ‘PROMPT_COMMAND’: ‘echo -n “”‘, ‘HOME’: ‘/builddir’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’}
      DEBUG util.py:264: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

      And this doesnt look good. Ensure the “build” group does have packages added.

      DEBUG util.py:264: Warning: Group build does not have any packages.

    • Gurveer
    • March 4th, 2014 11:45am

    Hi Phil,

    I Execute this command manually as following.

    #/usr/bin/yum –installroot /var/lib/mock/dist-centos6-build-1-5/root/ groupinstall build
    Warning: Group build does not have any packages.

    I could not found mock_output.log

    I execute /usr/bin/mock -r koji/dist-centos6-build-2-5 –init and output of this is as following:

    INFO: mock.py version 1.1.32 starting…
    Start: init plugins
    INFO: selinux disabled
    Finish: init plugins
    Start: run
    Start: lock buildroot
    Start: clean chroot
    Finish: clean chroot
    Finish: lock buildroot
    Start: chroot init
    Start: lock buildroot
    Mock Version: 1.1.32
    INFO: Mock Version: 1.1.32
    INFO: calling preinit hooks
    Start: device setup
    Finish: device setup
    Start: yum update
    Start: Outputting list of available packages
    Finish: Outputting list of available packages
    Finish: yum update
    ERROR: Could not find useradd in chroot, maybe the install failed?

      • phil
      • March 4th, 2014 12:04pm

      Seems like a problem with build groups. That also explains the “could not find useradd” error.

      These steps are crucial

      # virtual build yum groups
      koji add-group dist-centos6-build build
      koji add-group dist-centos6-build srpm-build
      koji add-group-pkg dist-centos6-build build bash bzip2 coreutils cpio diffutils findutils gawk gcc grep sed gcc-c++ gzip info patch redhat-rpm-config rpm-build shadow-utils tar unzip util-linux-ng which make
      koji add-group-pkg dist-centos6-build srpm-build bash cvs gnupg make redhat-rpm-config rpm-build shadow-utils wget rpmdevtools

      koji regen-repo dist-centos6-build

      Verify groups have packages added by

      koji list-groups dist-centos6-build

    • Gurveer
    • March 5th, 2014 8:35am

    Hi PHIL,

    I verified build group packages and it’s fine. Following are the packages;

    koji list-groups dist-centos6-build
    build [dist-centos6-build]
    bash: None, default [dist-centos6-build]
    bzip2: None, default [dist-centos6-build]
    coreutils: None, default [dist-centos6-build]
    cpio: None, default [dist-centos6-build]
    diffutils: None, default [dist-centos6-build]
    findutils: None, default [dist-centos6-build]
    gawk: None, default [dist-centos6-build]
    gcc: None, default [dist-centos6-build]
    gcc-c++: None, default [dist-centos6-build]
    grep: None, default [dist-centos6-build]
    gzip: None, default [dist-centos6-build]
    info: None, default [dist-centos6-build]
    make: None, default [dist-centos6-build]
    patch: None, default [dist-centos6-build]
    redhat-rpm-config: None, default [dist-centos6-build]
    rpm-build: None, default [dist-centos6-build]
    sed: None, default [dist-centos6-build]
    shadow-utils: None, default [dist-centos6-build]
    tar: None, default [dist-centos6-build]
    unzip: None, default [dist-centos6-build]
    util-linux-ng: None, default [dist-centos6-build]
    which: None, default [dist-centos6-build]
    srpm-build [dist-centos6-build]
    bash: None, default [dist-centos6-build]
    cvs: None, default [dist-centos6-build]
    gnupg: None, default [dist-centos6-build]
    make: None, default [dist-centos6-build]
    redhat-rpm-config: None, default [dist-centos6-build]
    rpm-build: None, default [dist-centos6-build]
    rpmdevtools: None, default [dist-centos6-build]
    shadow-utils: None, default [dist-centos6-build]
    wget: None, default [dist-centos6-build]

    Would it be issue because of miss configuration. I configured entire koji 3 times.

      • phil
      • March 5th, 2014 1:45pm

      Can you show the config file used by mock? Its generated new by Koji every build-run

      /usr/bin/mock -r koji/dist-centos6-build-2-5 –init

    • Gurveer
    • March 7th, 2014 10:39am

    Hi Phil,

    Issue is fixed now.
    Problem was, with External repository.I change repository and now it’s working fine.
    Earlier I misunderstood the concept of external repository but now it’s clear to me.

    Thanks for your help.

    • Whatya have to change? Im also having the same issue at the moment >_<!

      • Ignore that :), Got it working! We were having multiple permsion errors, solved by the magic strace ^_^, running strace on the mock -r command gave us a open error on the root.log, boot.log and a load of other logs, touching these helped loads. Then eventually following it through I got to it complaining it cant open userhelper.so (i think), used locate to find it and cp it to where it was looking (hacky I know!) it brought it up and working 🙂

        [root@kojibuild2 result]# ll
        total 1844
        -rw-r–r–. 1 root nobody 33556 Mar 31 20:31 2ping-2.0-2.el6.noarch.rpm

        One thing I dont quite understand are what the external Repos are used for, if i give it a SRPM to build!, I need to do more reading ^_^. Now to move onto kojira to get rid of the numorus old local buildroots!

      • sergio
      • March 9th, 2015 1:38am

      Gurveer :
      Hi Phil,
      Issue is fixed now.
      Problem was, with External repository.I change repository and now it’s working fine.
      Earlier I misunderstood the concept of external repository but now it’s clear to me.
      Thanks for your help.

      Hi , I got this same error , I see my
      mock -r koji/dist-f20-rpmfusion_free-build-10-13 –init
      give this error and understand that I don’t have external repos config
      so yum fail . How I add repositories to yum.conf on koji/dist-f20-rpmfusion_free-build-10-13.cfg file ?

    • sergio
    • March 9th, 2015 2:55pm

    sergio :

    Hi , I got this same error , I see my
    mock -r koji/dist-f20-rpmfusion_free-build-10-13 –init
    give this error and understand that I don’t have external repos config
    so yum fail . How I add repositories to yum.conf on koji/dist-f20-rpmfusion_free-build-10-13.cfg file ?

    I found an yum bug https://bugzilla.redhat.com/show_bug.cgi?id=1199860 and also had a bad mirror /releases/20/Fedora/\$arch/os/ when should be /releases/20/Everything/\$arch/
    after this is working …

    • Josh
    • April 28th, 2015 4:01pm

    Hey Phil,

    First, let me say thanks for spending the time to document the install and config if Koji! Very well documented and highly informative. Thank you!

    I am struggling a bit with this last part – any insight would be much appreciated!

    Seeing errors when trying to regen-repo and not fully understanding why:
    [kojiadmin@kojihub ~]$
    [kojiadmin@kojihub ~]$ koji regen-repo dist-centos6-build
    Regenerating repo for tag dist-centos6-build
    Watching tasks (this may be safely interrupted)…
    5 newRepo (dist-centos6-build): free
    5 newRepo (dist-centos6-build): free -> open (kojibuilder.local)
    6 createrepo (x86_64): free
    6 createrepo (x86_64): free -> open (kojibuilder.local)
    6 createrepo (x86_64): open (kojibuilder.local) -> FAILED: GenericError: failed to merge repos: /usr/libexec/kojid/mergerepos -a x86_64 -b /mnt/koji/repos/dist-centos6-build/3/x86_64/blocklist -o /tmp/koji/tasks/6/6/repo -g /mnt/koji/repos/dist-centos6-build/3/groups/comps.xml -r file:///tmp/koji/tasks/6/6/repo_3_premerge/ -r http://centos.bio.lmu.de/6/os/x86_64/ -r http://ftp-stud.hs-esslingen.de/pub/epel/6/x86_64/ exited with status 1
    0 free 1 open 0 done 1 failed
    5 newRepo (dist-centos6-build): open (kojibuilder.local) -> FAILED: GenericError: failed to merge repos: /usr/libexec/kojid/mergerepos -a x86_64 -b /mnt/koji/repos/dist-centos6-build/3/x86_64/blocklist -o /tmp/koji/tasks/6/6/repo -g /mnt/koji/repos/dist-centos6-build/3/groups/comps.xml -r file:///tmp/koji/tasks/6/6/repo_3_premerge/ -r http://centos.bio.lmu.de/6/os/x86_64/ -r http://ftp-stud.hs-esslingen.de/pub/epel/6/x86_64/ exited with status 1
    0 free 0 open 0 done 2 failed

    5 newRepo (dist-centos6-build) failed

    Here is the mergerepo.log:
    [kojiadmin@kojihub 6]# cat /mnt/koji/work/tasks/6/6/mergerepos.log
    $ /usr/libexec/kojid/mergerepos -a x86_64 -b /mnt/koji/repos/dist-centos6-build/3/x86_64/blocklist -o /tmp/koji/tasks/6/6/repo -g /mnt/koji/repos/dist-centos6-build/3/groups/comps.xml -r file:///tmp/koji/tasks/6/6/repo_3_premerge/ -r http://centos.bio.lmu.de/6/os/x86_64/ -r http://ftp-stud.hs-esslingen.de/pub/epel/6/x86_64/
    Adding repo: file:///tmp/koji/tasks/6/6/repo_3_premerge/
    Adding repo: http://centos.bio.lmu.de/6/os/x86_64/
    Adding repo: http://ftp-stud.hs-esslingen.de/pub/epel/6/x86_64/
    Traceback (most recent call last):

    yum.Errors.RepoError: Cannot retrieve repository metadata (repomd.xml) for repository: repo2. Please verify its path and try again

    Again, any comments or thoughts would be helpful! Thank you!

      • phil
      • April 29th, 2015 11:18am

      Hey, I’m not running/using Koji anymore for a longer while now but that error sounds like it has problems with the used repo. Maybe try other mirrors. Unfortunately cant be of more help after quite a long time I used Koji

  1. No trackbacks yet.