Description of problem: mock fails to initialize the RPM db when creating a chroot environment.
Version-Release number of selected component (if applicable): 1.1.41
How reproducible: Every time on multiple systems for me
Steps to Reproduce:
1. Install EPEL6 (I'm using Scientific Linux 6.5)
2. mock --init
3. Watch it fail
Fails with error:
OSError: [Errno 2] No such file or directory: '/var/lib/mock/epel-6-x86_64/root//var/lib/rpm/Packages'
Debug output: http://pastebin.com/kfb2caZq
A functional chroot build environment
I could not reproduce it (RHEL 6.5 + Epel).
What is your version of yum?
You can even try to manual patch mock if it fix your problem:
diff --git a/py/mockbuild/backend.py b/py/mockbuild/backend.py
index 3e49fe0..bd06d77 100644
@@ -537,6 +537,7 @@ class Root(object):
self.root_log.debug('create skeleton dirs')
for item in [
Althought I have no idea why you are hitting this BT.
It seems like yum is unable to instal 'rpm' package as
$ rpm -qf /var/lib/rpm/Packages
Really don't know why; just an blind idea, do you have enough space in
/var/lib? Creating the file explicitly in backend.py would create the dir
Also, according to 'man yum', adding -d X, -v, -e X, --rpmverbosity to
config_opts['chroot_setup_cmd'] = 'install @buildsys-build''
could say something useful.
(In reply to Pavel Raiskup from comment #2)
> Creating the file explicitly in backend.py would create the dir
> too late.
This is most probably untrue statement ^. Sorry.
Installed: rpm-4.8.0-37.el6.x86_64 at 2014-05-11 13:26
Built : Scientific Linux at 2013-11-21 18:08
Committed: Panu Matilainen <email@example.com> at 2013-09-12
Installed: yum-3.2.29-40.el6.noarch at 2014-05-11 13:27
Built : Scientific Linux at 2013-02-21 17:12
Committed: James Antill <firstname.lastname@example.org> at 2013-01-08
There's definitely plenty of space, but on the off chance that it wanted a whole lot more, I tried setting it to be on a different partition that had 350GB free. Same error.
Cranking the verbosity up gives a lot of extra info, but I didn't see anything obviously wrong. Seems like it installs everything just fine, but fails when it tries to record everything it just did.
I'm attaching the DEBUG output in case someone else can make more sense of it.
Created attachment 920540 [details]
Debug output log
Also, Packages is a file, not a dir, so creating it manually like that wouldn't work.
Notice the differences in paths:
DEBUG util.py:283: D: opening db index /var/lib/mock/epel-6-x86_64/root/usr/lib/rpm/rpmdb/Packages create mode=0x42
DEBUG util.py:283: OSError: [Errno 2] No such file or directory: '/var/lib/mock/epel-6-x86_64/root//var/lib/rpm/Packages'
The question is why yum/rpm create the file in /usr, while later expect it in /var
Also note that I have slighter newer yum
not sure if it make some difference.
On my build system, I have a Packages file in both /var/lib/rpm and /usr/lib/rpm/rpmdb and they are identical.
Yet in the chroot env, only one of them exists. Unfortunately, I can't find any reason as to why.
I'm afraid there is nothing I can do, unless there is better reproducer. Feel free to reopen, when you (or somebody) have more data.