Bug 108915 - 'rpm -qa' results in: error: rpmdbNextIterator.....
'rpm -qa' results in: error: rpmdbNextIterator.....
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2003-11-03 00:18 EST by Brian Jackowski
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-19 15:00:34 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 Brian Jackowski 2003-11-03 00:18:27 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031016

Description of problem:
Recently, when trying to install rpms, installation would fail; even
querying the RPM database would segfault.

[root@localhost root]# rpm -qa
error: rpmdbNextIterator: skipping h#     710 Header V3 DSA signature:
BAD, key
ID db42a60e
Segmentation fault
[root@localhost root]#

From what I understand, the RPM database is essentially a linked list;
somehow one or more entries in are not pointing to the next entry like
it should; that much I know.  How to fix it, is beyond me at this point.

In my search for an answer, I stumbled upon:
http://www.rpm.org/hintskinks/repairdb/; and followed the directions
listed there to the tee.  Unfortunatly I'm still no farther ahead. 
The following are steps I've taken

cd /var/lib/rpm
db_verify Packages     (No errors at this point)

/usr/lib/rpm/rpmdb_verify Packages   (Still no errors at this point)

With no immediate errors, I proceed to execute...

rpm --rebuilddb

At which point I get the same exact error that I've been getting when
trying to query the package list.

[root@localhost root]# rpm --rebuilddb
error: rpmdbNextIterator: skipping h#     710 Header V3 DSA signature:
BAD, key
ID db42a60e
Segmentation fault
[root@localhost root]#

At this point I'm at a complete loss of where to go next.

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

How reproducible:

Steps to Reproduce:
1.  rpm -qa, or installation of any rpm packages using rpm -Uvh

Additional info:

Maybe this isn't a rpm corruption issue at all.  I am able to list
packages from the Packages database with 'rpm -qa --nosignature'.  Not
sure what's going on.  Maybe somehow I've lost the gpg-key some
package required?  Even so, I've got to find a way to remove the
offending entry so I can get rpm working again and get on with my life!
Comment 1 Jeff Johnson 2003-12-05 11:19:22 EST
Try removing (or renaming) /var/lib/rpm/Pubkeys and doing
rpm --rebuilddb -vv to recreate the index.

Does that fix?
Comment 2 Francois Massonneau 2003-12-26 19:04:02 EST
Sorry to jump on this one, but I've got the same kind of errors :
error: rpmdbNextIterator: skipping h#     423 blob size(3368): BAD, 8
+ 16 * 
il(17) + dl(3056)
error: rpmdbNextIterator: skipping h#     956 Header V3 DSA signature:
key ID db42a60e
Erreur de segmentation
[root@celtes2 archives]#

I've tried rpmdb --rebuilddb or rpm --rebuilddb. No success.
I've tried :
  rm -f __db.00[123]
  rpm --rebuilddb
No success.
But I did what you said above and it has worked. The database seems to
be good now.
Comment 3 Leonard den Ottolander 2004-04-13 10:28:43 EDT
Brian, does the workaround work for you?
Comment 4 Jeremy Katz 2005-04-19 15:00:34 EDT
Closing due to inactivity.  Please reopen if this still occurs on newer releases
with the details about how the workaround fails.

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