Bug 507188 - rpm package database is broken
Summary: rpm package database is broken
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: appliance-tools
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Huff
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-21 14:49 UTC by Marek Goldmann
Modified: 2010-12-05 06:49 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-12-05 06:49:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Marek Goldmann 2009-06-21 14:49:07 UTC
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 18:28:44 UTC
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 18:39:01 UTC
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 10:24:22 UTC
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 14:44:43 UTC
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 18:01:38 UTC
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 14:04:02 UTC
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 14:06:05 UTC
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 14:19:38 UTC
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 15:31:52 UTC
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 19:58:16 UTC
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 07:35:32 UTC
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 15:07:58 UTC
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 11:03:09 UTC
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 06:49:39 UTC
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.