rpmdb: PANIC: fatal region error detected; run recovery

I am not sure if this is an interworx bug or something else, so I do not know if I am posting in the right board.
I hope someone can solve this problem.

Since a couple of days I have been receiving this error from my VPS:

[SIZE=3]rpmdb: PANIC: fatal region error detected; run recovery[/SIZE]
[SIZE=3]error: db4 error(-30977) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery[/SIZE]
[SIZE=3]error: cannot open Packages index using db3 - (-30977)[/SIZE]
[SIZE=3]error: cannot open Packages database in /var/lib/rpm Traceback (most recent call last):[/SIZE]
[SIZE=3] File “/usr/bin/yum”, line 29, in ?[/SIZE]
[SIZE=3] yummain.user_main(sys.argv[1:], exit_code=True)[/SIZE]
[SIZE=3] File “/usr/share/yum-cli/yummain.py”, line 309, in user_main[/SIZE]
[SIZE=3] errcode = main(args)[/SIZE]
[SIZE=3] File “/usr/share/yum-cli/yummain.py”, line 157, in main[/SIZE]
[SIZE=3] base.getOptionsConfig(args)[/SIZE]
[SIZE=3] File “/usr/share/yum-cli/cli.py”, line 187, in getOptionsConfig[/SIZE]
[SIZE=3] self.conf[/SIZE]
[SIZE=3] File “/usr/lib/python2.4/site-packages/yum/init.py”, line 664, in <lambda>[/SIZE]
[SIZE=3] conf = property(fget=lambda self: self._getConfig(),[/SIZE]
[SIZE=3] File “/usr/lib/python2.4/site-packages/yum/init.py”, line 239, in _getConfig[/SIZE]
[SIZE=3] self._conf = config.readMainConfig(startupconf)[/SIZE]
[SIZE=3] File “/usr/lib/python2.4/site-packages/yum/config.py”, line 804, in readMainConfig[/SIZE]
[SIZE=3] yumvars[‘releasever’] = _getsysver(startupconf.installroot, startupconf.distroverpkg)[/SIZE]
[SIZE=3] File “/usr/lib/python2.4/site-packages/yum/config.py”, line 877, in _getsysver[/SIZE]
[SIZE=3] idx = ts.dbMatch(‘provides’, distroverpkg)[/SIZE]
[SIZE=3]TypeError: rpmdb open failed[/SIZE]
[SIZE=3]rpmdb: PANIC: fatal region error detected; run recovery[/SIZE]
[SIZE=3]error: db4 error(-30977) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery[/SIZE]
[SIZE=3]error: cannot open Packages index using db3 - (-30977)[/SIZE]
[SIZE=3]error: cannot open Packages database in /var/lib/rpm Traceback (most recent call last):[/SIZE]
[SIZE=3] File “/usr/bin/yum”, line 29, in ?[/SIZE]
[SIZE=3] yummain.user_main(sys.argv[1:], exit_code=True)[/SIZE]
[SIZE=3] File “/usr/share/yum-cli/yummain.py”, line 309, in user_main[/SIZE]
[SIZE=3] errcode = main(args)[/SIZE]
[SIZE=3] File “/usr/share/yum-cli/yummain.py”, line 157, in main[/SIZE]
[SIZE=3] base.getOptionsConfig(args)[/SIZE]
[SIZE=3] File “/usr/share/yum-cli/cli.py”, line 187, in getOptionsConfig[/SIZE]
[SIZE=3] self.conf[/SIZE]
[SIZE=3] File “/usr/lib/python2.4/site-packages/yum/init.py”, line 664, in <lambda>[/SIZE]
[SIZE=3] conf = property(fget=lambda self: self._getConfig(),[/SIZE]
[SIZE=3] File “/usr/lib/python2.4/site-packages/yum/init.py”, line 239, in _getConfig[/SIZE]
[SIZE=3] self._conf = config.readMainConfig(startupconf)[/SIZE]
[SIZE=3] File “/usr/lib/python2.4/site-packages/yum/config.py”, line 804, in readMainConfig[/SIZE]
[SIZE=3] yumvars[‘releasever’] = _getsysver(startupconf.installroot, startupconf.distroverpkg)[/SIZE]
[SIZE=3] File “/usr/lib/python2.4/site-packages/yum/config.py”, line 877, in _getsysver[/SIZE]
[SIZE=3] idx = ts.dbMatch(‘provides’, distroverpkg)[/SIZE]
[SIZE=3]TypeError: rpmdb open failed[/SIZE]

Yum freaks out sometimes - generally not a huge deal. This is probably coming from the daily CRON that updates packages on your server.

Try running

yum clean all

And see if it goes away overnight.

Tim

Thanks for your fast answer.
I have tried running “yum clean all” but when I do, I get this:

rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbenv->open: DB_RUNRECOVERY: Fatal error, run data base recovery
error: cannot open Packages index using db3 - (-30977)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
File “/usr/bin/yum”, line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File “/usr/share/yum-cli/yummain.py”, line 309, in user_main
errcode = main(args)
File “/usr/share/yum-cli/yummain.py”, line 157, in main
base.getOptionsConfig(args)
File “/usr/share/yum-cli/cli.py”, line 187, in getOptionsConfig
self.conf
File “/usr/lib/python2.4/site-packages/yum/init.py”, line 664, in <lambda>
conf = property(fget=lambda self: self._getConfig(),
File “/usr/lib/python2.4/site-packages/yum/init.py”, line 239, in _getConf ig
self._conf = config.readMainConfig(startupconf)
File “/usr/lib/python2.4/site-packages/yum/config.py”, line 804, in readMainCo nfig
yumvars[‘releasever’] = _getsysver(startupconf.installroot, startupconf.dist roverpkg)
File “/usr/lib/python2.4/site-packages/yum/config.py”, line 877, in _getsysver
idx = ts.dbMatch(‘provides’, distroverpkg)
TypeError: rpmdb open failed

Perhaps a more drastic solution, then :slight_smile:

rm -f /var/lib/rpm/__db*
/usr/lib/rpm/rpmdb_verify /var/lib/rpm/Packages
rpm --rebuilddb

This will delete all the rpm databases and rebuild them. One page I found suggested that you may need to run yum update twice to see the results.

Tim

I did that.
After that I tried: yum update and I get this:

Another app is currently holding the yum lock; waiting for it to exit…
The other application is: yum
Memory : 1.7 M RSS ( 43 MB VSZ)
Started: Fri Dec 18 03:11:26 2009 - 4 day(s) 12:39:32 ago
State : Sleeping, pid: 26250

I ran # ps aux | grep yum to see what is active.
That returns:

root 26249 0.0 0.2 4496 592 ? S Dec18 0:00 sh -c /usr/bin/ yum update -y --disablerepo=interworx-cp* |tee -a /home/interworx/var/log/lastyu m.log 2>/dev/null
root 26250 0.0 0.6 44260 1768 ? S Dec18 0:36 /usr/bin/python /usr/bin/yum update -y --disablerepo=interworx-cp*
root 26251 0.0 0.1 3720 428 ? S Dec18 0:00 tee -a /home/in terworx/var/log/lastyum.log
root 29028 0.0 0.1 1852 508 pts/0 R+ 15:56 0:00 grep yum

I have killed these processes: root 26249, 26250 and 26251.
I do not have any zombie processes left.

I ran yum update twice. The first time it update 46 files. The second time 0.
I think everything is ok now.

Thanks for helping me with this!!!

Excellent, glad things worked out.