Bug 92247 - rpmdb: unable to join the environment - db4 error(11) from dbenv->open: Resource temporarily unavailable
rpmdb: unable to join the environment - db4 error(11) from dbenv->open: Resou...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm (Show other bugs)
1.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-06-04 00:41 EDT by Toni Willberg
Modified: 2007-04-18 12:54 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-09 08:16:14 EDT
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 Toni Willberg 2003-06-04 00:41:17 EDT
Description of problem:
Every rpm operation gives error.
This box worked yesterday, and today I get errors from rpm.

Even after removing /var/lib/rpm/__db.001 I get the same error. Rpmdb seems to
re-create that db-file.


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

How reproducible:
Always

Steps to Reproduce:
1. rpm -Uvh anypackage.rpm

Actual Results:  
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
rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages database in /var/lib/rpm


Additional info:

popt-1.8-0.69.i386.rpm
db4-4.0.14-21.i386.rpm
db4-devel-4.0.14-21.i386.rpm
db4-utils-4.0.14-21.i386.rpm
rpm-4.2-0.69.i386.rpm
rpm-build-4.2-0.69.i386.rpm
rpm-devel-4.2-0.69.i386.rpm
rpm-python-4.2-0.69.i386.rpm


I've seen similar errorneus behaviour from rpm many times in past 6 months. Why
can't it be fixed?

Atleast make it provide some help on error situation to instruct the user how to
fix this situation.
Comment 1 Toni Willberg 2003-06-04 00:45:30 EDT
Output from "strace -f rpm -qa" (only few last lines)
I did "rm /var/lib/rpm/__db.001" before strace.

...
munmap(0xbf3ea000, 4096)                = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/rpm.mo", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/rpm.mo", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/rpm.mo", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/rpm.mo", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/rpm.mo", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/rpm.mo", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/var/lib/rpm/DB_CONFIG", 0xbff053b0) = -1 ENOENT (No such file or directory)
open("/var/lib/rpm/DB_CONFIG", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file
or directory)
stat64("/var/lib/rpm/__db.001", 0xbff053e0) = -1 ENOENT (No such file or directory)
open("/var/lib/rpm/__db.001", O_RDWR|O_CREAT|O_EXCL|O_DIRECT|O_LARGEFILE, 0644) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
open("/var/lib/rpm/__db.001", O_RDWR|O_CREAT|O_DIRECT|O_LARGEFILE, 0644) = 4
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
_llseek(4, 0, [0], SEEK_END)            = 0
_llseek(4, 8192, [8192], SEEK_CUR)      = 0
write(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 8192) = -1
EINVAL (Invalid argument)
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such
file or directory)
write(2, "rpmdb: ", 7rpmdb: )                  = 7
write(2, "write: 0xbff033f0, 8192: Invalid"..., 41write: 0xbff033f0, 8192:
Invalid argument) = 41
write(2, "\n", 1
)                       = 1
close(4)                                = 0
close(3)                                = 0
write(2, "error: ", 7error: )                  = 7
write(2, "db4 error(22) from dbenv->open: "..., 49db4 error(22) from
dbenv->open: Invalid argument
) = 49
write(2, "error: ", 7error: )                  = 7
write(2, "cannot open Packages index using"..., 61cannot open Packages index
using db3 - Invalid argument (22)
) = 61
rt_sigprocmask(SIG_BLOCK, ~[RTMIN], [], 8) = 0
rt_sigaction(SIGHUP, {SIG_DFL}, NULL, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL}, NULL, 8) = 0
rt_sigaction(SIGTERM, {SIG_DFL}, NULL, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL}, NULL, 8) = 0
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
write(2, "error: ", 7error: )                  = 7
write(2, "cannot open Packages database in"..., 46cannot open Packages database
in /var/lib/rpm
) = 46
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xbf3ea000
write(1, "no packages\n", 12no packages
)           = 12
munmap(0xbf3ea000, 4096)                = 0
exit_group(1)                           = ?

Comment 2 Jeff Johnson 2003-06-05 07:37:45 EDT
Yup, kernel has new semantics for O_DIRECT thereby
breaking rpm.

Adding LD_ASSUME_KERNEL=2.2.5 should fix sufficiently
to upgrade to rpm-4.2-1 packages at
    ftp://ftp.rpm.org/pub/rpm/dist
which have better fix.
Comment 3 Jeff Johnson 2003-06-05 07:42:07 EDT
Add as prefix, like
    LD_ASSUME_KERNEL=2.2.5 rpm ...
Comment 4 Andrew Huntwork 2003-07-19 00:29:50 EDT
i'm using arjan's new 2.6.0 test rpms on rh 9, and I see this problem.  I
originally saw it with rpm-4.2-0.69, so I read this bug and upgraded to 4.2-1
from ftp.rpm.org and I still see exactly the same behavior.
Comment 5 Francisco 2003-07-28 17:08:13 EDT
installing the new rpm package and rebooting fixes this bug for me.
Comment 6 Anders Morken 2003-08-04 11:00:17 EDT
Experienced the exact same problem here on a RH9 box with a homebrew 2.6.0-test2
kernel. Updating rpm with the rpm-4.2-1 packages from ftp.rpm.org fixed the
problem, but only after rebooting. Just upgrading rpm or even going singleuser
was not enough. Thanks for the fix!
Comment 7 Alejandro Gonzalez Hernandez - Imoq 2003-08-15 17:30:40 EDT
I have the same problem here in a Shrike box with kernel 2.6.0-test3 (custom, I
had to recompile only to add support to i810 graphics in kernel and not as
module). I will try to upgrade RPM (hopefully from rawhide) to see if that fixes
the problem.
Comment 8 Alejandro Gonzalez Hernandez - Imoq 2003-08-21 13:28:09 EDT
It did fix the problem.
Comment 9 Jeff Hansen 2004-01-05 14:03:27 EST
I'm using kernel 2.6.0 with RH9 and this solution works perfectly.  I
wish I hadn't had to reboot though.... can someone figure out why it
requires a reboot?
Comment 10 tamer américo da silva 2004-05-02 15:22:44 EDT
Yes, This works.
Under my RH9 with kernel 2.6.4  rpm only works with no root user. 
Then like root and using LD_ASSUME_KERNEL parameter before rpm 
command works well. Remember, I just used this one time to upgrade my 
rpm for rpm-4.2.1 and then reboot machine.

roo# LD_ASSUME_KERNEL=2.2.5 rpm -UvH rpm-4.2.1-i386.rpm
Comment 11 Toni Willberg 2004-06-09 08:16:14 EDT
Current RPM is FC2 is rpm-4.3.1-0.3. I assume this is fixed there too...

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