Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

rpmdb errors

Discussion in 'General Discussion' started by gdgray, Aug 19, 2005.

  1. gdgray

    gdgray Member

    Joined:
    Nov 11, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    151
    I'm getting a lot of these errors when running an update:

    rpmdb: Program version 4.2 doesn't match environment version
    error: db4 error(22) from dbenv->open: Invalid argument
    error: cannot open Packages index using db3 - Invalid argument (22)
    error: cannot open Packages database in /var/lib/rpm

    The update completes anyway, but this can't be healthy.

    Ideas?

    Greg
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,472
    Likes Received:
    20
    Trophy Points:
    463
    Location:
    Go on, have a guess
    Indeed, it's a corrupt rpm database. Steps to resolve:

    1. Check for processes holding the rpm database open (usually in MUTEX/FUTEX states):

    lsof | grep /var/lib/rpm

    If it finds any, kill -9 them all.

    2. Delete any temporary DB files:

    rm -fv /var/lib/rpm/__*

    3. Rebuild your RPM database:

    rpm --rebuilddb -v -v

    If you still have problems, a reboot is probably quickest, then repeat steps 2 and 3 above.
     
  3. gdgray

    gdgray Member

    Joined:
    Nov 11, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    151
    Brilliant! Fixed this and my exim problem.

    Thanks,
    Greg
     
  4. Diatone

    Diatone Well-Known Member

    Joined:
    Aug 22, 2001
    Messages:
    111
    Likes Received:
    0
    Trophy Points:
    316
    Thanks so much
     
  5. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    166
    and if this doesnt work?
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,472
    Likes Received:
    20
    Trophy Points:
    463
    Location:
    Go on, have a guess
    If the steps I gave don't work (including the reboot of the server) and you still get rpm errors, then you may well have terminal damage to your rpm database and you're realisticly looking at an OS reload.
     
  7. Michael-MS

    Michael-MS Well-Known Member

    Joined:
    Apr 16, 2003
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    166
    I have the same problem. A cPanel upgrade (to STABLE) wiped out the /etc/exim.pl file and killed exim. I copied exim.pl from another server and it is running again.

    But, how do I fix this? I ran the commands that you posted above to reset the database.

    Code:
    1. Check for processes holding the rpm database open (usually in MUTEX/FUTEX states):
    
    lsof | grep /var/lib/rpm
    
    If it finds any, kill -9 them all.
    
    2. Delete any temporary DB files:
    
    rm -fv /var/lib/rpm/__*
    
    3. Rebuild your RPM database:
    
    rpm --rebuilddb -v -v
    
    (did not try a reboot yet). But this is what I get when I run /scripts/eximup:

    PHP:
    Trying to fetch openssl-devel-0.9.7a-20.4.legacy.i386.rpm from ftp://mirror.hiwaay.net/redhat/redhat/linux using wget...
    --09:24:13--  ftp://mirror.hiwaay.net/redhat/redhat/linux/9/updates/i386/openssl-devel-0.9.7a-20.4.legacy.i386.rpm
               
    => `openssl-devel-0.9.7a-20.4.legacy.i386.rpm'
    Resolving mirror.hiwaay.net... done.
    Connecting to mirror.hiwaay.net[216.180.99.217]:21... connected.
    Logging in as anonymous ... Logged in!
    ==> SYST ... done.    ==> PWD ... done.
    ==> TYPE I ... done.  ==> CWD /redhat/redhat/linux/9/updates/i386 ...
    No such directory 
    `redhat/redhat/linux/9/updates/i386'.

    Retrieving http://updates.cpanel.net/redhat/updates/9/en/os/i386/openssl-0.9.7a-20.4.legacy.i386.rpm
    Retrieving http://updates.cpanel.net/redhat/updates/9/en/os/i386/openssl-devel-0.9.7a-20.4.legacy.i386.rpm
    rpmdb: /var/lib/rpm/Packages: unexpected file type or format
    error: cannot open Packages index using db3 - Invalid argument (22)
    error: cannot open Packages database in /var/lib/rpm
    warning: /var/tmp/rpm-xfer.1GoGI5: V3 DSA signature: NOKEY, key ID 731002fa
    rpmdb: /var/lib/rpm/Packages: unexpected file type or format
    error: cannot open Packages database in /var/lib/rpm
    rpmdb: /var/lib/rpm/Packages: unexpected file type or format
    error: cannot open Packages database in /var/lib/rpm
    rpmdb: /var/lib/rpm/Packages: unexpected file type or format
    error: cannot open Packages database in /var/lib/rpm
    rpmdb: /var/lib/rpm/Packages: unexpected file type or format
    error: cannot open Packages database in /var/lib/rpm
    Rebuilding local rpm provides list.....openssl..rpmdb: /var/lib/rpm/Packages: unexpected file type or format
    error: cannot open Packages index using db3 - Invalid argument (22)
    error: cannot open Packages database in /var/lib/rpm
    ..openssl-devel..rpmdb: /var/lib/rpm/Packages: unexpected file type or format
    error: cannot open Packages index using db3 - Invalid argument (22)
    error: cannot open Packages database in /var/lib/rpm
    Done
    rpmdb: /var/lib/rpm/Packages: unexpected file type or format
    error: cannot open Packages index using db3 - Invalid argument (22)
    error: cannot open Packages database in /var/lib/rpm
    Building local rpm requires list...rpmdb: /var/lib/rpm/Packages: unexpected file type or format
    error: cannot open Packages index using db3 - Invalid argument (22)
    error: cannot open Packages database in /var/lib/rpm
    Done

    That's a selection of the upgrade. I'm not sure which errors are important. Hopefully, someone can help me?

    Thanks,
    Michael
     
  8. Michael-MS

    Michael-MS Well-Known Member

    Joined:
    Apr 16, 2003
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    166
    root@srv01 [/etc]# rpm --rebuilddb -v -v
    D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.3224
    D: creating directory /var/lib/rpmrebuilddb.3224
    D: opening old database with dbapi 3
    D: opening db environment /var/lib/rpm/Packages joinenv
    D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
    rpmdb: /var/lib/rpm/Packages: unexpected file type or format
    D: closed db index /var/lib/rpm/Packages
    D: closed db environment /var/lib/rpm/Packages
    error: cannot open Packages index
    D: removing directory /var/lib/rpmrebuilddb.3224

    Any idea what might be causing this? :(

    Thanks,
    Michael
     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,472
    Likes Received:
    20
    Trophy Points:
    463
    Location:
    Go on, have a guess
    My previous comments stand. If a rebuild doesn't work, and you don't have an identical server to copy an rpm database from, then you're looking at an OS restore to get rpm going again.
     
  10. Michael-MS

    Michael-MS Well-Known Member

    Joined:
    Apr 16, 2003
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    166
    Copying it from an (almost, but not quite) identical server fixed the problem.

    CPanel's response was that the wrong berkeley db version was installed and that I should go to sleepycat.com and install the latest version. No clue why this would have happened... server was working fine until an upgrade to the latest stable.

    Thanks!
    Michael
     
  11. ChipW

    ChipW Registered

    Joined:
    Mar 15, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    151
    Thanks a million.... fixed my problem...
     
Loading...

Share This Page