Bug 51463 - Can't execute rpm queiries as root
Can't execute rpm queiries as root
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-08-10 13:25 EDT by Sean Dilda
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-08-10 22:59:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Sean Dilda 2001-08-10 13:25:17 EDT
As a normal user, I can do:

[agrajag@loiosh agrajag]$ rpm -qf /bin/bash
[agrajag@loiosh agrajag]$

However, as root I get:

[root@loiosh agrajag]# rpm -qf /bin/bash
rpmdb: Program version 3.3.11 doesn't match environment version 3.3.4
error: db3 error(22) from dbenv->open: Invalid argument
error: cannot open Packages index using db3 - Invalid argument (22)
[root@loiosh agrajag]# 

I get the same error when I try any rpm query command as root, such as a
-qa, or a normal '-q packagename'
Comment 1 Jeff Johnson 2001-08-10 13:31:43 EDT
	rm -f /var/lib/rpm/__db*

Reopen this bug if that doesn't work.
Comment 2 Sean Dilda 2001-08-10 16:53:17 EDT
That *mostly* works..   When I run 'rpm -qa' as root, it gets to:

[root@loiosh agrajag]# rpm -qa

Then it just hangs until I hit ^C.   When I run rpm -qa as a normal user, it
seems to print all the rpms and exit cleanly.

[root@loiosh agrajag]# rpm -q rpm
[root@loiosh agrajag]#
Comment 3 Jeff Johnson 2001-08-10 21:40:45 EDT
The next step is
	rpm --rebuilddb
Comment 4 Sean Dilda 2001-08-10 22:59:32 EDT
I ran rpm --rebuilddb as root, and it just sat there.. no heavy disk access or
anything...  at the suggestion of Jeremy Katz, I straced it, found it was just
doing selects, then stopped the rpm process and did the rm -f /var/lib/rpm/__db*
 *again*.  Now everything seems to be working fine as far as I can tell.. 
however I do think it is a bug that I even had to remove these files once.
Comment 5 Jeff Johnson 2001-08-11 11:52:10 EDT
Fixed in rtpm-4.0.3-0.88.

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