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.
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) = ?
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.
Add as prefix, like LD_ASSUME_KERNEL=2.2.5 rpm ...
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.
installing the new rpm package and rebooting fixes this bug for me.
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!
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.
It did fix the problem.
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?
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
Current RPM is FC2 is rpm-4.3.1-0.3. I assume this is fixed there too...