Bug 507188 - rpm package database is broken
rpm package database is broken
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: appliance-tools (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: David Huff
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-21 10:49 EDT by Marek Goldmann
Modified: 2010-12-05 01:49 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-12-05 01:49:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marek Goldmann 2009-06-21 10:49:07 EDT
Description of problem:

I'm trying to customize RAW disk: install additional packages using guestfish or using other technique. Unfortunately it isn't possible, because of a rpm package database error:

error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
warning: /var/tmp/rpm-tmp.YjoK7u: Header V3 DSA signature: NOKEY, key ID 49c8885a
error: cannot open Packages database in /var/lib/rpm

Everything is working perfectly in Fedora 10.

After executing:

rm -f /var/lib/rpm/__db*
rpm --rebuilddb

in RAW disk (using guestfish) I can install packages, or query rpm database. It looks that appliance-creator is messing somehow RPM package database.

Version-Release number of selected component (if applicable):

appliance-tools-004-3.fc11.noarch

How reproducible:

It's always reproducible, tried to use different kickstart files, same result.

Steps to Reproduce:
1. Create an appliance using kickstart file [1].
2. Mount created RAW disk using guestfish [2], launch it.
3. Try to execute command in guestfish: command "yum search mc"

[1] http://git.fedorahosted.org/git/?p=spin-kickstarts.git;a=blob_plain;f=fedora-aos.ks;hb=HEAD
[2] http://libguestfs.org/

Actual results:

><fs> command "yum search mc"
libguestfs: error: error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=T

Expected results:

List of packages.

Additional info:
Comment 1 David Huff 2009-06-30 14:28:44 EDT
I am not sure this is an Appliance-tools error...

I tried to reproduce this issue, I installed a rawhide guest with appliance-creator on a F11 box.

Launch the guest in qemu-kvm, with libvirt, log on to the guest via virt viewer, and the RPM db seems to be intact. 

rpm -Va  reports no errors 
yum search mc works also with out error

this may be an issue with libguestfs...

-D
Comment 2 David Huff 2009-06-30 14:39:01 EDT
I was also unable to reproduce using guestfish....

If you can provide the libguestfs commands that were used to create this issue i will try and reproduce..

-D
Comment 3 Marek Goldmann 2009-07-01 06:24:22 EDT
David,

Steps to reproduce are as follows: create an appliance (I'm using JBoss Cloud kickstarts) using appliance-creator.

After that:

[oddthesis@bolek-f11 httpd-appliance]$ guestfish 

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help with commands
      'quit' to quit the shell

><fs> add-drive httpd-appliance-sda.raw 
><fs> launch 
open /dev/kvm: No such file or directory
Could not initialize KVM, will disable KVM support
><fs> mount /dev/sda1 /
><fs> ls /
.gem
.rnd
bin
boot
dev
etc
home
lib
lib64
lost+found
media
mnt
opt
proc
root
sbin
selinux
srv
sys
tmp
usr
var
><fs> command "yum search mc"
libguestfs: error: error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=T
><fs> 

This is build on latest Fedora 11 packages.

More info: on Fedora 10 this problem *also* exists, I was wrong when I submitted this ticket.

This problem isn't related to guestfish or libguestfs in general, because when I mount disk using losetup, bind all directories, etc, I get same error.

Another info (maybe most important): I *do not start* this virtual machine using qemu, xen, vmware, etc at all. I'm operating offline, on image disk. Maybe Fedora is clearing in some way its RPM package database while starting, dunno that.
Comment 4 Richard W.M. Jones 2009-07-03 10:44:43 EDT
Are you fully mounting every directory that needs to be
mounted?  For example, suppose that /var is a separate
partition.  Then in the above example, /var/lib/rpm
wouldn't exist, which might cause rpm or yum some problems.

You can get virt-inspector to mount everything correctly
for you.  Just do:

  guestfish -i httpd-appliance-sda.raw
Comment 5 Marek Goldmann 2009-07-08 14:01:38 EDT
I just have one root partition, so every partition is mounted. There is no way I missed something to mount.

I really think that's not libguestfs problem.
Comment 6 Richard W.M. Jones 2009-10-19 10:04:02 EDT
They key here is obviously the error message itself:

  cannot open Packages index using db3

Perhaps something like rm /var/lib/__db* ; rpm --initdb  ?
Comment 7 Richard W.M. Jones 2009-10-19 10:06:05 EDT
More accurately, the full error message is:

  error: cannot open Packages index using db3 - No such file or directory (2)
  error: cannot open Packages database in /var/lib/rpm

I would suggest trying stuff out with virt-rescue and
using strace to find out what it's actually missing?
Comment 8 Marek Goldmann 2009-10-19 10:19:38 EDT
Rich,

I'm cleaning rpm database every time I want to install a new package. See description of this pb: https://bugzilla.redhat.com/show_bug.cgi?id=507188#c0.

What's the difference between rebuilding and initializing a RPM database?

But either way it's a workaround IMHO.
Comment 9 Marek Goldmann 2009-10-19 11:31:52 EDT
Rich helped me to debug this issue. We produced a strace log for yum command: http://gist.github.com/213449. The answer is in line 5018.

Of course directory "/home/oddthesis/jboss-cloud/build/tmp/imgcreate-zI1Pr5/install_root/var/lib/rpm/Packages" does not exists. It was created by appliance-creator to compose image.

Appliance-creator caches somewhere the location of Packages database, or rpm database caches it itself and does not look for /var/lib/rpm/Packages by default.
Comment 10 David Huff 2010-02-09 14:58:16 EST
I am trying to clean up some old bugs reported against Appliance-tools.

Marek, is this still an issue?  It looks like it might be a problem with the way livecd-tools does a yum install?

I would be happy to look into this further, however I am not really sure what the next steps would be, any suggestions?
Comment 11 Marek Goldmann 2010-02-10 02:35:32 EST
Yes, this is still an issue, even in F12.

This could be:
- appliance-creator bug
- livecd-tools bug
- yum bug

Maybe you should talk with a Yum expert and ask if yum is caching the Packages database path somewhere. If yes, this could be a bug because it should try to find it here: "/var/lib/rpm/Packages".

Makes this sense?
Comment 12 Bug Zapper 2010-04-27 11:07:58 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  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 '11'.

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 11'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 11 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 13 Bug Zapper 2010-11-04 07:03:09 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  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 '12'.

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 12'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 12 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 14 Bug Zapper 2010-12-05 01:49:39 EST
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 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.