Bug 51463 - Can't execute rpm queiries as root
Summary: Can't execute rpm queiries as root
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
(Show other bugs)
Version: 7.3
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-10 17:25 UTC by Sean Dilda
Modified: 2007-04-18 16:35 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-11 02:59:36 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Sean Dilda 2001-08-10 17:25:17 UTC
As a normal user, I can do:


[agrajag@loiosh agrajag]$ rpm -qf /bin/bash
bash-2.05-8
[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 17:31:43 UTC
Try
	rm -f /var/lib/rpm/__db*

Reopen this bug if that doesn't work.

Comment 2 Sean Dilda 2001-08-10 20:53:17 UTC
That *mostly* works..   When I run 'rpm -qa' as root, it gets to:

[root@loiosh agrajag]# rpm -qa
psgml-1.2.1-13
libgnomeprint11-0.25-9
trn-3.6-28
<snip>
gnumeric-0.67-4
initscripts-6.11-1
cvs-1.11.1p1-3
kudzu-devel-0.99.11-1

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.

Also:
[root@loiosh agrajag]# rpm -q rpm
rpm-4.0.3-0.84
[root@loiosh agrajag]#


Comment 3 Jeff Johnson 2001-08-11 01:40:45 UTC
The next step is
	rpm --rebuilddb


Comment 4 Sean Dilda 2001-08-11 02:59:32 UTC
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 15:52:10 UTC
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.