Bug 80482 - rpm-4.2-0.38 fails to open databases.
rpm-4.2-0.38 fails to open databases.
Status: CLOSED WORKSFORME
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm (Show other bugs)
1.0
All Linux
high Severity high
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-26 20:50 EST by Ralph Loader
Modified: 2005-10-31 17:00 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-27 19:34:26 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ralph Loader 2002-12-26 20:50:57 EST
Description of problem:

After upgrading to rpm-4.2-0.38, all rpm operations performed as root failed.


Version-Release number of selected component (if applicable):

rpm-4.2-0.38

How reproducible:

Everytime.

Steps to Reproduce:

As root, do "rpm -q rpm".

Actual results:

[root@suckfish root]# rpm -q rpm
rpmdb: Berkeley DB library configured to support only DB_PRIVATE environments
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
package rpm is not installed

Expected results:

rpm package & version should be displayed (rpm is installed!).

Additional Info:

Doing "rpm -q rpm" as non-root worked OK.  "rpm --rebuilddb" gave similar
"cannot open Packages" error.
Comment 1 Ralph Loader 2002-12-26 21:14:48 EST
PS.  Downgrading (unpacking rpm by hand!) to rpm-4.2-0.25.1 seems to fix the
problem.
Comment 2 Jeff Johnson 2002-12-27 09:22:41 EST
Yup. rpm is transiting to using nptl, and so behavior
is gonna depend on which kernel is booted, which glibc
is installed, and whether you are running as root or
non-root.

Hmmm, the behavior should have fallen back automagically.

What glibc and kernel were you running?
Comment 3 Ralph Loader 2002-12-27 12:46:01 EST
I'm running kernel rpm 2.4.20-2.2 for i686 and glibc-2.3.1-21.

[root@suckfish root]# rpm -q kernel
kernel-2.4.20-2.2
[root@suckfish root]# uname -a
Linux suckfish 2.4.20-2.2 #1 Fri Dec 20 13:02:59 EST 2002 i686 i686 i386 GNU/Linux
[root@suckfish root]# rpm -q glibc
glibc-2.3.1-21
[root@suckfish root]#
Comment 4 Jeff Johnson 2002-12-27 14:54:21 EST
Hmmm, this is working for me with
    kernel-smp-2.4.20-2.2 (i686, it may matter)
    glibc-2.3.1-21
    rpm-4.2-0.40 (don't remember a difference from -0.38)

So what happens if you do (as root)
    rm -f /var/lib/rpm/__db*
    rpm -qa
Comment 5 Sammy 2002-12-27 17:22:58 EST
I had the same problem with the same kernel and glibc for rpm-4.2-0.36 and -0.38. 
Do we need to install a package which is not listed in requirements? 
Comment 6 Ralph Loader 2002-12-27 18:31:24 EST
Still the same problem:

[root@suckfish rpms]# rm -f /var/lib/rpm/__db.00*
[root@suckfish rpms]# rpm -qa
rpmdb: Berkeley DB library configured to support only DB_PRIVATE environments
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
Comment 7 Jeff Johnson 2002-12-27 18:39:48 EST
Hmmm, something is fishy here, but rpm's use of
nptl is very, very new.

Try adding the following line to /etc/rpm/macros:
    %__dbi_cdb create client private cdb mpool mp_mmapsize=16Mb mp_size=1Mb]

This is the default config from /usr/lib/rpm/macros with
the keyword "private" added.
Comment 8 Jeff Johnson 2002-12-27 18:49:34 EST
Apologies, there's a typo from cut 'n paste
    %__dbi_cdb create private cdb mpool mp_mmapsize=16Mb mp_size=1Mb
Comment 9 Ralph Loader 2002-12-27 19:27:24 EST
That's cured it!  Thanks.

[root@suckfish root]# cat /etc/rpm/macros
%__dbi_cdb create private cdb mpool mp_mmapsize=16Mb mp_size=1Mb
[root@suckfish root]# rpm -q rpm
rpm-4.2-0.38
Comment 10 Jeff Johnson 2002-12-27 19:34:26 EST
Good, at least something "works" :-(

You probably want to pay close attention to kernel/glibc/rpm
updates from Raw Hide, as all this is changing quite fast,
transiting to NPTL and /dev/futex.
Comment 11 Reuben Farrelly 2002-12-27 20:42:22 EST
Worked here too after the fix suggested by Jeff above.  I'm running latest 
glibc and rpm from rawhide but also 2.5 series kernels..
Comment 12 Need Real Name 2003-01-03 06:05:07 EST
I had same problem - exact same symptomps. It began when installing RawHide just
before Xmas, including new rpm and glibc packages. I thought that installing a
full Phoebe might cure it. Phoebe install went flawlessly, but rpm still did not
work for root.

Note that I had no "/etc/rpm/macros" file, just macros.prelink, macros.solve and
macros.specspo

FWIW, there were no "/var/lib/rpm/__db.001" file.

Anyway, creating a "/etc/rpm/macros" file with the single line show in the
comments cured everything. In terms of the "WORKSFORME" status, at least here is
a message that it required the fix to work for me.
Comment 13 Corporal Pisang 2003-02-18 23:05:23 EST
glibc-2.3.1-46
rpm-4.2-0.68
db4-4.0.14-20
kernel 2.5.62

the one line addition in macros made my rpm works.

before the one liner:

after deleting __db*

#rpm --rebuilddb
rpmdb: write: 0xbfffd510, 8192: Invalid argument
error: db4 error(22) from dbenv->open: Invalid argument
error: cannot open Packages index

#rpm --rebuilddb
rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index

after the line addition, rpm works again.

#rpm -Uvh kudzu* pciut*
warning: kudzu-0.99.96-1.i386.rpm: V3 DSA signature: NOKEY, key ID 897da07a
Preparing...                ########################################### [100%]
   1:pciutils-devel         ########################################### [ 25%]
   2:kudzu                  ########################################### [ 50%]
   3:kudzu-devel            ########################################### [ 75%]
   4:pciutils               ########################################### [100%]

thanks.

Note You need to log in before you can comment on or make changes to this bug.