Bug 607593 - mock -r fedora-12-i386 --rebuild Conn-1.0.31-1.src.rpm fails with some db 3 vs. 4 mismatch
mock -r fedora-12-i386 --rebuild Conn-1.0.31-1.src.rpm fails with some db 3 v...
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
13
All Linux
low Severity medium
: ---
: ---
Assigned To: Clark Williams
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-24 08:59 EDT by Catalin BOIE
Modified: 2013-01-10 01:02 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-06-27 14:52:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
mock with --trace and --verbose (126.46 KB, text/plain)
2010-07-22 02:12 EDT, Catalin BOIE
no flags Details

  None (edit)
Description Catalin BOIE 2010-06-24 08:59:26 EDT
Description of problem:


Version-Release number of selected component (if applicable):
mock-1.1.1-1.fc13.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
INFO: mock.py version 1.1.1 starting...
State Changed: init plugins
State Changed: start
INFO: Start(rpm/Conn-1.0.31-1.src.rpm)  Config(fedora-12-i386)
State Changed: lock buildroot
State Changed: clean
State Changed: init
State Changed: lock buildroot
Mock Version: 1.1.1
INFO: Mock Version: 1.1.1
INFO: enabled root cache
INFO: enabled yum cache
State Changed: cleaning yum metadata
INFO: enabled ccache
State Changed: running yum
State Changed: creating cache
State Changed: setup
ERROR: Exception(rpm/Conn-1.0.31-1.src.rpm) Config(fedora-12-i386) 6 minutes 46 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-12-i386/result
ERROR: Command failed: 
 # /usr/bin/yum --installroot /var/lib/mock/fedora-12-i386/root/  resolvedep  ccache 
rpmdb: Program version 4.8 doesn't match environment version 4.7
error: db3 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db3 -  (-30971)
error: cannot open Packages database in /var/lib/mock/fedora-12-i386/root/var/lib/rpm
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 254, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 88, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 191, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 778, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 255, in _getConfig
    startupconf = config.readStartupConfig(fn, root)
  File "/usr/lib/python2.6/site-packages/yum/config.py", line 834, in readStartupConfig
    startupconf.releasever = _getsysver(startupconf.installroot, startupconf.distroverpkg)
  File "/usr/lib/python2.6/site-packages/yum/config.py", line 944, in _getsysver
    idx = ts.dbMatch('provides', distroverpkg)
_rpm.error: rpmdb open failed
Comment 1 Jan Kratochvil 2010-07-02 09:46:18 EDT
There are usually some rpm database format problems across host vs. guest OS,
you may want to try:
rpm -r /var/lib/mock/fedora-12-i386/root -q gcc
You may want to do:
rm -f /var/lib/mock/fedora-12-i386/root/var/lib/rpm/__db.*
rpm -r /var/lib/mock/fedora-12-i386/root --rebuilddb

Using script:
http://dyn.jankratochvil.net/nethome/bin/mockupdate?view=co
mockupdate -q /var/lib/mock/fedora-12-i386
Comment 2 Catalin BOIE 2010-07-02 10:24:32 EDT
I think that this is not a solution.
Should work out-of-the-box.
Comment 3 Clark Williams 2010-07-10 10:53:04 EDT
What host OS are you using to generate the above error? F13?
Comment 4 Catalin BOIE 2010-07-12 01:43:30 EDT
Yes, F13.
Comment 5 Clark Williams 2010-07-12 09:48:27 EDT
Ok, is the F12 chroot your using coming from cache? The reason I ask is that since we don't use the RPM installed into the chroot to do anything, I couldn't see how you were getting a db3 rpm database on F13. But, if you're using an F12 cache from building back on an f12 system, then I could see it.
Comment 6 Catalin BOIE 2010-07-12 10:36:19 EDT
Hm. I started to play with mock on F13 host, if I remember correctly.
But, I will remove the cache and I will try again.
Thanks.
Comment 7 Jan Kratochvil 2010-07-12 10:52:10 EDT
(In reply to comment #5)
> since we don't use the RPM installed into the chroot to do anything, I couldn't
> see how you were getting a db3 rpm database on F13.

If you use `mock --shell' then any operation such as `rpm -q bash' immediately creates /var/lib/mock/NAME/root/var/lib/rpm/__db.* environment breaking mock.
Comment 8 Catalin BOIE 2010-07-13 04:13:49 EDT
I did not used mock --shell.
Comment 9 Catalin BOIE 2010-07-13 04:18:35 EDT
I tried again after removing /var/cache/mock/fedora-12-i386 and the result is the same error message.
May be because of ccache installed after using rpm command from host instead of rpm command from chroot?
Comment 10 Catalin BOIE 2010-07-13 05:00:39 EDT
Setting 'config_opts['plugin_conf']['ccache_enable']' to 'False', I managed to build that rpm!
So, the ccache configuration option is the cause!
Comment 11 Clark Williams 2010-07-13 09:48:41 EDT
well, we're not supposed to *ever* use the rpm inside the chroot. mock uses the "native" rpm for all package operations.
Comment 12 Jan Kratochvil 2010-07-13 09:54:54 EDT
I use mock as a lightweight virtualization tool. No need for new partitions, no need to copy files.  One has to do some workarounds for --orphanskill patch - accidentally by me - which cannot be disabled in the final application, though.
Otherwise each new chroot user will kill all the existing processes there.
Comment 13 Catalin BOIE 2010-07-13 10:40:15 EDT
What about yum? Does it uses native rpm or chroot rpm?

Clark, you are saying that I cannot build Fedora 12 rpms on a Fedora 13 host?!
Comment 14 Clark Williams 2010-07-13 11:46:53 EDT
All of the rpm operations take place outside the chroot, using the native rpm program. Mock populates the chroot using yum with the --installroot argument. This does *not* execute a chroot(2) system call but rather just redirects the native yum and rpm to install into a different base directory. The intent is to avoid doing any RPM manipulation from inside the chroot. 

You should be able to build f12 packages on 13 with no problems.
Comment 15 Catalin BOIE 2010-07-14 02:05:24 EDT
:) The problem is that I cannot (out-of-the-box) and this bug is reporting this problem.
Seems that ccache is the problem, see comment 10, please.
Comment 16 Clark Williams 2010-07-14 10:16:18 EDT
Catalin,

Would you attach your SRPM to the BZ? I'd like to make sure I'm doing exactly what you are when debugging this.

Thanks!
Comment 18 Clark Williams 2010-07-14 15:01:26 EDT
Ok, that built fine with my current tree doing:

mock -r fedora-12-x86-64 --rebuild Conn-1.0.32-1.src.rpm

I *think* it was fixed as a consequence of a yum_cache fix that skvidal gave me earlier. I'm working on a couple of other fixes, but would you be interested in a test package to see if it fixes things for you?
Comment 19 Catalin BOIE 2010-07-15 02:20:02 EDT
Did you have ccache activated in mock's config file? If no, please activate it. Only with it activated I get the unexpected error.

Yes, I can try a test package.
Comment 20 Clark Williams 2010-07-16 09:11:26 EDT
Please try:

http://people.redhat.com/williams/mock-1.1.2pre-1.fc13.noarch.rpm

And let me know if this fixes your problems.
Comment 21 Catalin BOIE 2010-07-16 09:52:30 EDT
Sadly, this update does not fix the issue.
I cleaned root cache and activated back ccache configuration option and I get:

mock -r fedora-12-i386 --rebuild Conn-1.0.32-1.src.rpm 
INFO: mock.py version 1.1.2pre starting...
State Changed: init plugins
State Changed: start
INFO: Start(Conn-1.0.32-1.src.rpm)  Config(fedora-12-i386)
State Changed: lock buildroot
State Changed: clean
State Changed: init
State Changed: lock buildroot
Mock Version: 1.1.2pre
INFO: Mock Version: 1.1.2pre
INFO: enabled root cache
INFO: enabled yum cache
State Changed: cleaning yum metadata
INFO: enabled ccache
State Changed: running yum
State Changed: creating cache
State Changed: setup
ERROR: Exception(Conn-1.0.32-1.src.rpm) Config(fedora-12-i386) 2 minutes 11 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-12-i386/result
ERROR: Command failed: 
 # /usr/bin/yum --installroot /var/lib/mock/fedora-12-i386/root/  resolvedep  ccache 
rpmdb: Program version 4.8 doesn't match environment version 4.7
error: db3 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db3 -  (-30971)
error: cannot open Packages database in /var/lib/mock/fedora-12-i386/root/var/lib/rpm
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 254, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 88, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 191, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 778, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 255, in _getConfig
    startupconf = config.readStartupConfig(fn, root)
  File "/usr/lib/python2.6/site-packages/yum/config.py", line 834, in readStartupConfig
    startupconf.releasever = _getsysver(startupconf.installroot, startupconf.distroverpkg)
  File "/usr/lib/python2.6/site-packages/yum/config.py", line 944, in _getsysver
    idx = ts.dbMatch('provides', distroverpkg)
_rpm.error: rpmdb open failed

Seems that mock tries to install ccache and this is where the things break. Without ccache is working just fine.
Comment 22 Clark Williams 2010-07-16 10:11:21 EDT
Sigh, back to the drawing board.
Comment 23 Clark Williams 2010-07-16 11:07:45 EDT
So when I run it locally on my F13 laptop, here's what I see:

$ mock -r fedora-12-i386 --rebuild Conn-1.0.32-1.src.rpm 
INFO: mock.py version 1.1.2pre starting...
State Changed: init plugins
State Changed: start
INFO: Start(Conn-1.0.32-1.src.rpm)  Config(fedora-12-i386)
State Changed: lock buildroot
State Changed: clean
State Changed: init
State Changed: lock buildroot
Mock Version: 1.1.2pre
INFO: Mock Version: 1.1.2pre
INFO: enabled root cache
State Changed: unpacking root cache
INFO: enabled yum cache
State Changed: cleaning yum metadata
INFO: enabled ccache
State Changed: running yum
State Changed: setup
State Changed: build
INFO: Done(Conn-1.0.32-1.src.rpm) Config(fedora-12-i386) 0 minutes 14 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-12-i386/result

I'm trying to figure out how you're getting a db3 error on a Fedora 13 system, since you should be using the native rpm to manipulate the rpmdb, no matter what config you choose.
Comment 24 Catalin BOIE 2010-07-19 03:29:35 EDT
May I add more debugging somehow?
Comment 25 Clark Williams 2010-07-21 10:23:15 EDT
run your mock command with --trace and it'll trace what's going on inside mock. Between that and --verbose we might get an idea of how things are taking a wrong turn.
Comment 26 Catalin BOIE 2010-07-22 02:12:15 EDT
Created attachment 433588 [details]
mock with --trace and --verbose
Comment 27 Catalin BOIE 2010-07-22 02:14:58 EDT
/usr/bin/yum --installroot /var/lib/mock/fedora-12-i386/root/  resolvedep  ccache generates the exception.
But, I assume that something else is "corrupting" the rpm's db before this.
Comment 28 Fedora Admin XMLRPC Client 2011-03-11 13:10:22 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 29 Bug Zapper 2011-06-01 11:42:25 EDT
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  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 '13'.

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 13'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 13 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 30 Bug Zapper 2011-06-27 14:52:04 EDT
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 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.

Note You need to log in before you can comment on or make changes to this bug.