Red Hat Bugzilla – Bug 213892
RPM database sometimes works only on normal accounts?
Last modified: 2007-11-30 17:11:47 EST
If I login to my normal account and I write the command rpm -qi gcc for example
I get what I should get. But when I login to root with su the same thing fails
if I first do something with yum. The command rpm -qivv gcc gives me the following:
D: opening db environment /var/lib/rpm/Packages joinenv
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Name rdonly mode=0x0
and gets stucked. It is very strange that rpm manages to open Packages but not
Name. Does anyone have an idea what is going on?
To fix this then I must restart my computer.
I've included two strace outputs. One for normal user and one for root user.
Created attachment 140276 [details]
Created attachment 140278 [details]
You likely have stale locks. Fix by doing (also done during reboot):
rm -f /var/lib/rpm/__db*
Yes I think that fixes the problem. But what are these files and why do they
cause this problem?
Segafualts and loss of data are likely due to removing an rpmdb environment
without correcting other problems in the rpmdb.
FYI: Most rpmdb "hangs" are now definitely fixed by purging stale read locks when opening
a database environment in rpm-4.4.8-0.4. There's more todo, but I'm quite sure that a
large class of problems with symptoms of "hang" are now corrected.
Detecting damage by verifying when needed is well automated in rpm-4.4.8-0.4. Automatically
correcting all possible damage is going to take more work, but a large class of problems is likely
already fixed in rpm-4.4.8-0.4 as well.
*** This bug has been marked as a duplicate of 206275 ***