Bug 158666 - rpm looks in /usr/lib/rpmdb for rpmdb files instead of /var/lib/rpm
rpm looks in /usr/lib/rpmdb for rpmdb files instead of /var/lib/rpm
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
4
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-24 14:18 EDT by James Bourne
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-25 14:23:02 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)

  None (edit)
Description James Bourne 2005-05-24 14:18:36 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.0.4-1.3.1 Firefox/1.0.4

Description of problem:
When upgraded packages directly using RPM I receive the message:
rio:-bash# rpm -Fvh openoffice.org-*
rpmdb: Program version 4.3 doesn't match environment version
error: db4 error(-30974) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db3 -  (-30974)
warning: cannot open Solve database in /usr/lib/rpmdb/i386-redhat-linux/redhat
error: Failed dependencies:
        libjawt.so.6 is needed by openoffice.org-core-1.9.104-1.i386

Ignoring the failed dependencies line, RPM is attempting to use the rpmdb in /usr/lib/rpmdb/ (obviously) instead of the rpmdb in /var/lib/rpm/.

If I remove the /usr/lib/rpmdb (rename to .bak) rpm creates a new empty database.  previous updates have used the rpmdb in /var/lib/rpm/



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

How reproducible:
Always

Steps to Reproduce:
1. Update/install packages with dependency issues (in this case openoffice.org in rawhide needs libjawt.so.6 (which was replaced in libgcj with libgcjawt) and causes a dependency problem)


  

Actual Results:  rpm fails with db version issue.

Expected Results:  rpm should complain about dependency issue and exit.

Additional info:

The files in /usr/lib/rpmdb don't seem to be getting updated only read from occasionally.  If I move /usr/lib/rpmdb/i386-redhat-linux/redhat to redhat.bak and replace it with a symlink to /var/lib/rpm the issue goes away.

This will be a major problem with clients who are unable to troubleshoot it on their own.  I think it's just two alias lines in /usr/lib/rpm/rpmpopt-4.4.1 that require changing that reference /usr/lib/rpmdb/
Comment 1 Jeff Johnson 2005-05-24 14:23:57 EDT
This will "fix"
    rm -f /usr/lib/rpmdb/i386-redhat-linux/redhat/__db*

Probably better is to do
    rpm -e rpmdb-redhat
or
    rpm -e rpmdb-fedora

since Fedora Core has decided to not produce the rpmdb-fedora package anymore.
Comment 2 Paul Nasrat 2005-05-24 17:30:12 EDT
Anaconda upgrades will now remove rpmdb-fedora on upgrade.
Comment 3 mrgalvin 2005-07-01 01:29:09 EDT
With FC4 I get the same error:

 rpm -Fvh xine-0.99.3-4.2.fc4.i386.rpm
rpmdb: Program version 4.3 doesn't match environment version
error: db4 error(-30974) from dbenv->open: DB_VERSION_MISMATCH: Database
environment version mismatch
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
warning: xine-0.99.3-4.2.fc4.i386.rpm: Header V3 DSA signature: NOKEY, key ID
e42d547b
rpmdb: Program version 4.3 doesn't match environment version
error: db4 error(-30974) from dbenv->open: DB_VERSION_MISMATCH: Database
environment version mismatch
error: cannot open Packages database in /var/lib/rpm

Looked into Comment #1.  Comment #2 must be true.
Comment 4 Jared Stemen 2005-07-14 19:23:09 EDT
I'm also getting a similar error when I try to update my system with apt-get
upgrade, and the above fixes don't seem to work.  It seemed to start happening
right after I installed, or tried to install, a new version of rpm.  Please help.

[root@localhost redhat]# apt-get upgrade
rpmdb: Program version 4.3 doesn't match environment version
error: db4 error(-30974) from dbenv->open: DB_VERSION_MISMATCH: Database
environment version mismatch
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
E: could not open RPM database
Comment 5 Jared Stemen 2005-07-14 20:21:33 EDT
You can disreguard my problem.  It seemed to be fix with a reboot
Comment 6 Jeff Johnson 2005-08-25 14:23:02 EDT
This problem appears resolved (by removing rpmdb-foo)

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