Monday, July 4, 2011

Koji: Common Mistakes, Errors and Troubleshooting

Koji is a tool which can be nightmare for you. At times, even when everything will look fine, it won't work or throw some of the most weird error messages for you to resolve. Here are some of them with probable solutions.

  • I am getting "OSError: [Errno 13] Permission denied" what do I do?
    #1 Check that permission for /var/{lib,cache}/mock is 02755. You can set this permission by the following commands:
    chmod 02755 /var/lib/mock
    chmod 02755 /var/cache/mock

    #2 
    Make sure that you have build and srpm-build defined into your build tag. Use this guide to define them. Also ensure that bare minimum required packages are added to the each group. I have added following packages in my Koji instance:

    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

  • I can build using srpm but not using SCM url. How to fix that?
    #1 You need to have some files in you scm (git or subversion etc). These are a Makefile, all the patches and spec file. Makefile will consist of the url of the source and way to download it.

    #2
     Make sure that you are giving a complete SCM build command, an example using anonymous checkout:
    koji build --scratch mytag git://abc.com/project.git#d9e1204eddd9ae972456a9bdd2d847a

    #3 Make sure that you have added the url of the SCM in /etc/kojid/kojid.conf and restarted the kojid.

  • I am getting "ERROR: Could not find useradd in chroot, maybe the install failed?"
    #1. Checkout #2 of first bullet

  • I am getting "GenericError: failed to merge repos:" while trying to regenerate repos. What do I do?
    #1.
    Use the command "koji list-external-repos" and check out that there are no extra trailing '/' and do not hardcode the arch. Use $arch instead and don't forget to escape $arch using '\' else it will be evaluated while adding it to repos only.

    #2. Ensure that disk is not full.

  • I am getting "BuildrootError: could not init mock buildroot, mock exited with status 20; see root.log for more information" but root.log is empty.
    #1. Now Koji is trying to make a fool out of you. Well, no, actually Koji guesses what log has the relevant error message and this time it has guessed wrong. Just check out mock_output.log. Make sure that you have bare minimum packages added to your build group.