Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 4th November 2006, 07:46 PM
Red Knuckles Offline
Registered User
 
Join Date: Mar 2006
Location: Colorado USA
Posts: 65
Talking Solved: rpmdb open failed

In recent install [updated once or twice previously] of FC 6 when I try to run 'yum -y update' I get the following output:

# yum -y update
Loading "installonlyn" plugin
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database 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.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 85, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 199, in getOptionsConfig
errorlevel=opts.errorlevel)
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 125, in doConfigSetup
self.conf = config.readMainConfig(startupconf)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 597, in readMainConfig
vars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 656, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed

What's going on and how do I fix??? When I try to edit '/etc/yum.repos.d' as root with kwrite I get:

The file 'file:///etc/yum.repos.d' could not be opened: it is not a normal file, it is a folder.

That seems very wrong to me. How to edit?

When I try '# gedit /etc/yum.repos.d' I get:

Could not open the file /etc/yum.repos.d.

__________________
Thanks,
Noobie,
Red Knuckles

Last edited by Red Knuckles; 5th November 2006 at 07:42 PM.
Reply With Quote
  #2  
Old 4th November 2006, 08:55 PM
Red Knuckles Offline
Registered User
 
Join Date: Mar 2006
Location: Colorado USA
Posts: 65
Ok, I fingered out how to deal with repos in FC 6. Apparently I was used to them all being in one file but now they are in a folder and you have to edit each file seperately. ie. 'kwrite /etc/yum/repos.d/fedora-core.repo' and in my case also '/etc/yum/repos.d/fedora-extras.repo' and '/etc/yum/repos.d/fedora-updates.repo'. For some reason [WHY???] FC 6 comments out all base urls in repos by default [#] so you have to remove the # before the base urls that you wish to have enabled [enabled=1]. In my case so far that is only core, extras and update. I did that but yum still won't run and gives the same error for 'yum clean all'. At least that is what I think I learned from scanning other posts. If I'm wrong someone correct me! I still don't understand why rpmdb open failed??? Is it trying to tell me something when it mentions 'Fatal error, run database recovery' and 'rpmdb: PANIC: fatal region error detected; run recovery'? Aren't I looking for a command to recover the rpmdb? Or am I looking for a rpm command? Will keep looking...
__________________
Thanks,
Noobie,
Red Knuckles
Reply With Quote
  #3  
Old 4th November 2006, 09:42 PM
Red Knuckles Offline
Registered User
 
Join Date: Mar 2006
Location: Colorado USA
Posts: 65
NOT Solved: rpmdb open failed

As of my last post I had not rebooted my computer. What solved the problem was removing the '#' from the base urls in repos AND rebooting computer. Then I ran:

# yum clean all
Loading "installonlyn" plugin
Cleaning up Everything
# yum -y update
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
core 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 1.2 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 824 kB 00:02
################################################## 2242/2242
primary.xml.gz 100% |=========================| 81 kB 00:00
################################################## 249/249
primary.xml.gz 100% |=========================| 1.3 MB 00:28
################################################## 4027/4027
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for kdeadmin to pack into transaction set.
kdeadmin-3.5.5-0.1.fc6.i3 100% |=========================| 35 kB 00:00

so it appears as if it's going to update. Looks like a long one too. Maybe I never updated my FC 6 install yet afterall...
__________________
Thanks,
Noobie,
Red Knuckles

Last edited by Red Knuckles; 4th November 2006 at 10:52 PM. Reason: Not Solved!
Reply With Quote
  #4  
Old 4th November 2006, 10:57 PM
Red Knuckles Offline
Registered User
 
Join Date: Mar 2006
Location: Colorado USA
Posts: 65
Quote:
Originally Posted by Red Knuckles
As of my last post I had not rebooted my computer. What solved the problem was removing the '#' from the base urls in repos AND rebooting computer. Then I ran:

# yum clean all
Loading "installonlyn" plugin
Cleaning up Everything
# yum -y update
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
core 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 1.2 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 824 kB 00:02
################################################## 2242/2242
primary.xml.gz 100% |=========================| 81 kB 00:00
################################################## 249/249
primary.xml.gz 100% |=========================| 1.3 MB 00:28
################################################## 4027/4027
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for kdeadmin to pack into transaction set.
kdeadmin-3.5.5-0.1.fc6.i3 100% |=========================| 35 kB 00:00

so it appears as if it's going to update. Looks like a long one too. Maybe I never updated my FC 6 install yet afterall...
I spoke to soon. When I do the above yum updates a few packages and then I get I very long list like this:

rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery


and I'm back to 'rpmdb open failed'. Then I reboot and do it again and it updates a few more packages and the same error again. How to fix? I thought that when yum was updating it was accessing repos over the internet. I'm confused as to where the error is. For what it's worth:

# ls /var/lib/rpm
Basenames __db.000 __db.002 Dirnames Group Name Providename Pubkeys Requireversion Sigmd5
Conflictname __db.001 __db.003 Filemd5s Installtid Packages Provideversion Requirename Sha1header Triggername
__________________
Thanks,
Noobie,
Red Knuckles
Reply With Quote
  #5  
Old 4th November 2006, 11:14 PM
Red Knuckles Offline
Registered User
 
Join Date: Mar 2006
Location: Colorado USA
Posts: 65
Is it possible that the repos themselves are the problem? These are the 3 I have enabled:

[core]
name=Fedora Core $releasever - $basearch
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=core-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[extras]
name=Fedora Extras $releasever - $basearch
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=extras-$releasever&arch=$basearch
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras
gpgcheck=1

[updates]
name=Fedora Core $releasever - $basearch - Updates
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-fc$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
__________________
Thanks,
Noobie,
Red Knuckles
Reply With Quote
  #6  
Old 4th November 2006, 11:20 PM
timdsmith's Avatar
timdsmith Offline
Registered User
 
Join Date: Aug 2006
Location: The Colony, TX
Age: 40
Posts: 115
No need to reinstall. Do this.
Code:
rm /var/lib/rpm __db.*
Note there are two underscores before the db. You also have to run that command as root.
Reply With Quote
  #7  
Old 4th November 2006, 11:36 PM
u-noneinc-s's Avatar
u-noneinc-s Offline
Registered User
 
Join Date: Jul 2005
Location: Wine Country, California
Posts: 2,862
Also as a note, Base urls are always commented out in favor of the mirrors. The mirrors spread the load.

Speaking of load, if you get yum working and then suddenly get "can't find valid baseurl" it could be because the mirrors are overloaded (or down for maintainance) and you can uncomment the baseurl line(s) but it's advised to recomment them when done (or when mirrors are back up).

After you rm the db, you may need to rebuild it, I believe it is rpm --rebuilddb (check man rpm to be sure)
__________________
Mark N.

Perpetual Newbie
--
I wanted to proclaim myself "The Typo King" but there's way too much competion. :p

411874 Get Counted
Reply With Quote
  #8  
Old 4th November 2006, 11:38 PM
Red Knuckles Offline
Registered User
 
Join Date: Mar 2006
Location: Colorado USA
Posts: 65
Quote:
Originally Posted by timdsmith
No need to reinstall. Do this.
Code:
rm /var/lib/rpm __db.*
Note there are two underscores before the db. You also have to run that command as root.
I did that and:

# rm /var/lib/rpm __db.*
rm: cannot remove directory `/var/lib/rpm': Is a directory
rm: cannot lstat `__db.*': No such file or directory
# rm /var/lib/rpm__db.*
rm: cannot lstat `/var/lib/rpm__db.*': No such file or directory
__________________
Thanks,
Noobie,
Red Knuckles
Reply With Quote
  #9  
Old 4th November 2006, 11:46 PM
u-noneinc-s's Avatar
u-noneinc-s Offline
Registered User
 
Join Date: Jul 2005
Location: Wine Country, California
Posts: 2,862
Don't know if this has anything to do with your problem, but I just loaded your mirrors into FF and got # no repository available for repo extras (same for updates and core).
I get a 404 when I load my mirrors, (but yum still runs fine and finds my mirrors). I am not running FC6, but I don't have a ? in my mirror urls

I do know I have browsed mirrors before (it's just a big list of mirrors that yum uses and rotates).
I don't know why they are not at the moment browsable?
__________________
Mark N.

Perpetual Newbie
--
I wanted to proclaim myself "The Typo King" but there's way too much competion. :p

411874 Get Counted
Reply With Quote
  #10  
Old 4th November 2006, 11:50 PM
u-noneinc-s's Avatar
u-noneinc-s Offline
Registered User
 
Join Date: Jul 2005
Location: Wine Country, California
Posts: 2,862
I believe that was supposed to be # rm /var/lib/rpm/__db.* (but I'm not sure you want to remove all of them. I thought it was just --000.db
I could very well be wrong.
If timdsmith could confirm???
__________________
Mark N.

Perpetual Newbie
--
I wanted to proclaim myself "The Typo King" but there's way too much competion. :p

411874 Get Counted
Reply With Quote
  #11  
Old 5th November 2006, 12:02 AM
timdsmith's Avatar
timdsmith Offline
Registered User
 
Join Date: Aug 2006
Location: The Colony, TX
Age: 40
Posts: 115
Yes. You do have to remove them all. And yes, it was supposed to be
Code:
rm /var/lib/rpm/__db*
Sorry. Typo on my part. and you also have to rebuild the database. Forgot that part too. That's a shame since I just had to do this on my box yesterday. Must be getting old.
Code:
rpm --rebuilddb
is the command for that.
Reply With Quote
  #12  
Old 5th November 2006, 12:09 AM
u-noneinc-s's Avatar
u-noneinc-s Offline
Registered User
 
Join Date: Jul 2005
Location: Wine Country, California
Posts: 2,862
Hey, if it was baseball, you'd be batting 333.
Besides, you should see some of the mistakes I've made here lately. And the fog just keeps getting denser. (Is that a word?)
__________________
Mark N.

Perpetual Newbie
--
I wanted to proclaim myself "The Typo King" but there's way too much competion. :p

411874 Get Counted
Reply With Quote
  #13  
Old 5th November 2006, 12:12 AM
timdsmith's Avatar
timdsmith Offline
Registered User
 
Join Date: Aug 2006
Location: The Colony, TX
Age: 40
Posts: 115
Quote:
Originally Posted by u-noneinc-s
Hey, if it was baseball, you'd be batting 333.
Hey!!! 333 ain't bad!!
Reply With Quote
  #14  
Old 5th November 2006, 07:41 PM
Red Knuckles Offline
Registered User
 
Join Date: Mar 2006
Location: Colorado USA
Posts: 65
Talking Solved!

Quote:
Originally Posted by timdsmith
Yes. You do have to remove them all. And yes, it was supposed to be
Code:
rm /var/lib/rpm/__db*
Sorry. Typo on my part. and you also have to rebuild the database. Forgot that part too. That's a shame since I just had to do this on my box yesterday. Must be getting old.
Code:
rpm --rebuilddb
is the command for that.
I got the solution to this problem from 2 different forums. I replaced the # sign in front of the 3 base urls where I had removed them. Also corrected the 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY'
line to read
'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora'
in the 'core' repos.

Then I ran:

# rm /var/lib/rpm/__db*
# rpm --rebuilddb
# yum -y update

and it updated 29 packages without error or warning. Thanks Lenard [LinuxQuestions.org]. Thanks timdsmith [Fedora Forum].
__________________
Thanks,
Noobie,
Red Knuckles
Reply With Quote
  #15  
Old 7th November 2006, 04:35 AM
hermouche's Avatar
hermouche Offline
Registered User
 
Join Date: Apr 2006
Location: Algeria
Posts: 800
Quote:
Originally Posted by Red Knuckles
I got the solution to this problem from 2 different forums. I replaced the # sign in front of the 3 base urls where I had removed them. Also corrected the 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY'
line to read
'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora'
in the 'core' repos.

Then I ran:

# rm /var/lib/rpm/__db*
# rpm --rebuilddb
# yum -y update

and it updated 29 packages without error or warning. Thanks Lenard [LinuxQuestions.org]. Thanks timdsmith [Fedora Forum].

Hy

i've got the same problem, could you please give the exact path of the
" I replaced the # sign in front of the 3 base urls where I had removed them. Also corrected the 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY'
line to read
'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora'
in the 'core' repos."


I mean where is it the #sign.... and gpgkey=...........

Well in other words where should i go
cd /etc.....???

thanks

i am really waiting for your answer, because i've got the same problem 100%

thanks again

red
Reply With Quote
Reply

Tags
failed, open, rpmdb, typeerror

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Yum: exceptions.TypeError since last update awhb Using Fedora 0 16th March 2009 05:30 PM
rpmdb open failed asulwer Using Fedora 2 24th March 2007 08:20 PM
rpmdb open failed Plossl Using Fedora 2 13th January 2007 02:17 PM


Current GMT-time: 20:58 (Saturday, 18-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat