Bug 672260

Summary: mock fails to build sysroot if one repo is unavailable
Product: [Fedora] Fedora EPEL Reporter: Clement VARALDI <varaldcl>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: el5CC: mebrown, msuchy, williams
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-20 08:01:41 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Clement VARALDI 2011-01-24 10:54:02 EST
Description of problem:
when one of our repository is broken or simply made unavailable (maintainance of repository), all builds with mock are made unavailable

Version-Release number of selected component (if applicable):
Name        : mock                         Relocations: (not relocatable)
Version     : 1.0.12                            Vendor: Fedora Project
Release     : 1.el5                         Build Date: Sat 18 Sep 2010 12:13:17 AM CEST
Install Date: Tue 21 Sep 2010 12:11:38 PM CEST      Build Host: ppc08.phx2.fedoraproject.org

How reproducible:
everytime a repo is broken

Steps to Reproduce:
1. in /etc/mock/myconf.cfg, add the option:
config_opts['yum.conf'] = """
# repos
2. remove repo.xml from repo directory
3. try to run mock
Actual results:
in root.log:
DEBUG backend.py:644:  mount -n -t devpts -o gid=5,mode=0620,ptmxmode=0666 mock_chroot_devpts /var/lib/mock/rhel-5-i386/root/dev/pts
DEBUG util.py:303:  Executing command: mount -n -t devpts -o gid=5,mode=0620,ptmxmode=0666 mock_chroot_devpts /var/lib/mock/rhel-5-i386/root/dev/pts
DEBUG util.py:342:  Child returncode was: 0
DEBUG backend.py:644:  mount -n -t tmpfs mock_chroot_shmfs /var/lib/mock/rhel-5-i386/root/dev/shm
DEBUG util.py:303:  Executing command: mount -n -t tmpfs mock_chroot_shmfs /var/lib/mock/rhel-5-i386/root/dev/shm
DEBUG util.py:342:  Child returncode was: 0
DEBUG backend.py:677:  /usr/bin/yum --installroot /var/lib/mock/rhel-5-i386/root/  install buildsys-build
DEBUG util.py:303:  Executing command: /usr/bin/yum --installroot /var/lib/mock/rhel-5-i386/root/  install buildsys-build
DEBUG util.py:268:  http://somerepo/repo/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
DEBUG util.py:268:  Trying other mirror.
DEBUG util.py:268:  Error: Cannot retrieve repository metadata (repomd.xml) for repository: RPMT. Please verify its path and try again
DEBUG util.py:342:  Child returncode was: 1
DEBUG util.py:303:  Executing command: umount -n /var/lib/mock/rhel-5-i386/root/dev/shm

Expected results:
don't fail and try to continue building.

Additional info:
The issue is quite easy to reproduce but it may not be so easy to understand why we would like it to continue.
The fact is we are having a lot of repositories, managed by different teams.
Each one can build its own packages, and might need to have access to his repository, and sometimes the other ones.
To solve this, we add to the .cfg file all repositories availables.
But it sometimes happens that some team are building a package at the same time when an other one re-creates a repository (even if there is no link between them).

Other way to correct it would be to be able to tell mock which repositories are needed for buildrequires.
For example, we have 
repo1 contains package A, B, C
repo2 contains package D, E, F
repo3 contains package G, H, I
I need to build a package J that needs D and G as buildrequires. I tell mock:

mock -r rhel-5-i386 --buildsrpm --spec=SPECS/J.spec --sources=SOURCES/ --resultdir=SRPMS/ --needrepo=repo2,repo3

and we would have:
/etc/mock/repo{2,3}.cfg containing the yum.conf file for each repo:

# repos repo2
name=base repo2


# repos repo3
name=base repo3
Comment 1 Clark Williams 2011-03-11 13:30:56 EST
have you tried using the "skip_if_unavailable=1" parameter in the repo files?
Comment 3 Miroslav Suchý 2014-11-20 08:01:41 EST
#1 is correct solution.