Bug 91935

Summary: rpm commands randomly fail, and keep failing then, wihen using NPTL.
Product: [Retired] Red Hat Linux Reporter: Carlo Wood <bugzilla>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED CURRENTRELEASE QA Contact: Mike McLean <mikem>
Severity: high Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: athlon   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-24 21:34:52 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:
Attachments:
Description Flags
Output of strace rpm. none

Description Carlo Wood 2003-05-30 00:32:38 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Description of problem:
Any rpm or rpmbuild command can suddenly give:

>rpm -q rpm
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

Running 'db_recover' in /var/lib/rpm
does not change this, running 'rpm --rebuilddb' (using
the trick below, thus successfully) does not fix this.

I had this once before, and it went away after a reboot and
possibly other things - I can't remember.  Just now it happened
again when I tried to install:
/usr/src/rawhide>rpm -ihv glibc-2.3.2-41.src.rpm
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
warning: glibc-2.3.2-41.src.rpm: V3 DSA signature: NOKEY, key ID 897da07a
   1:glibc                  ########################################### [100%]
/usr/src/rawhide>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
/usr/src/rawhide>cd ../redhat/SPECS
/usr/src/redhat/SPECS>rpmbuild -bp glibc.spec
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

etc.

My trick to run 'rpm --rebuilddb', or any other rpm
command that I needed is to use LD_ASSUME_KERNEL=2.2.5.
Ie:

>LD_ASSUME_KERNEL=2.2.5 rpm -qa
fileutils-4.1.9-11
functions-4-2
automake-1.7.2-5
...etc

and

/var/lib/rpm>LD_ASSUME_KERNEL=2.2.5 rpm --rebuilddb
/var/lib/rpm>

The conclusing is that there is a problem
with rpm and the new threading library.





Version-Release number of selected component (if applicable):
rpm-4.2-0.69, glibc-2.3.2-27.9, db4-4.0.14-20

How reproducible:
Sometimes

Steps to Reproduce:
1. See description :/
2.
3.
    

Additional info:

Comment 1 Carlo Wood 2003-06-04 10:06:48 UTC
Created attachment 92133 [details]
Output of strace rpm.

Comment 2 Carlo Wood 2003-06-04 10:10:49 UTC
Was this reproduced yet?

I am currently having this problem ALWAYS.
rpm really needs fixing.

I attached an strace of:

/usr/src/RedHat>strace -ttT -ff -o rpmout rpm -i glibc-2.3.2-27.9.src.rpm
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
warning: glibc-2.3.2-27.9.src.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Note that 'rpm' calls:

select(0, NULL, NULL, NULL, {6, 0})

which doesn't look right.


Comment 3 Jeff Johnson 2003-06-24 21:34:52 UTC
This problem is fixed in rpm-4.2 (for Red Hat 9 with NPTL)
or rpm-4.1.1 (for Red Hat 8.0 w/o NPTL) packages at
    ftp://ftp.rpm.org/pub/rpm/dist/rpm-x.y.z

Quick fix is to do
    rm -f /var/lib/rpm/__db*
to remove stale locks left from missed SIGPIPE.