Bug 102410

Summary: rpm -qa as root fails
Product: [Retired] Red Hat Linux Beta Reporter: Don Zickus <dzickus>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED CURRENTRELEASE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: prebeta   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-08-19 15:40:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Don Zickus 2003-08-14 21:25:32 UTC
Description of problem:
I upgraded from RH9 to the beta version of linux-2.6 from
http://people.redhat.com/arjanv/2.5 using yum.  While playing around I noticed
when the command 'rpm -qa' is run as root it fails.  When run as a user it
succeeds.  

The failure message is :
rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db3 - Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
no packages



Version-Release number of selected component (if applicable):
#rpm -qa|grep rpm
redhat-rpm-config-8.0.21-1
rpm-python-4.2-0.69
rpm-devel-4.2-0.69
rpm-build-4.2-0.69
rpm-4.2-0.69


How reproducible:
Very reproducible

Steps to Reproduce:
1. rpm -qa  (as root)
2.
3.
    
Actual results:
Fails with message listed above

Expected results:
list of all packages

Additional info:

I assumed the internal website for the 2.6 kernel had all the packages I needed
to run my system.  Perhaps I need to manually upgrade some other components?

Comment 1 Jeff Johnson 2003-08-19 12:50:52 UTC
Try doing
    rm -f /var/lib/rpm/__db*
Does that fix?

Comment 2 Don Zickus 2003-08-19 14:53:36 UTC
It doesn't fix the problem, but it does speed up the failure.  Instead of
waiting 18 seconds, it fails immediately.

>>>>>>>>>>>>>>>>>>>>>>>>>>
[root@studmuffin rpm]# time rpm -qa
rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db3 - Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
no packages
 
real    0m18.019s
user    0m0.016s
sys     0m0.006s
[root@studmuffin rpm]# rm __db.001
rm: remove regular empty file `__db.001'? y
[root@studmuffin rpm]# time rpm -qa
rpmdb: write: 0xbfffc460, 8192: Invalid argument
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
no packages
 
real    0m0.045s
user    0m0.016s
sys     0m0.005s
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


Comment 3 Jeff Johnson 2003-08-19 15:40:35 UTC
This is what I needed:
   rpmdb: write: 0xbfffc460, 8192: Invalid argument
The kernel folk have invented new semantics for O_DIRECT, breaking
rpm.

Fix is in rpm-4.2-1 packages at ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.2.x

Comment 4 Don Zickus 2003-08-19 16:38:11 UTC
Thanks a lot!! It seems to work fine now.