As per Jeff Johnson's at http://www.geocrawler.com/lists/3/Red-Hat-Linux/87/0/5656728/ I am having a problem with a corrupt RPM database shortly after upgrading my rpm to the 4.0.2-7x rpm. When trying various opertations including trying to rebuild the database I get the following error: # rpm --rebuilddb rpmdb: header.c:241: regionSwab: Assertion `ie.info.type >= 0 && ie.info.type <= 9' failed. Aborted (core dumped) I do get the same problem after upgrading to the rpm-4.0.3 specified in the e-mail in the link above.
Can you attach a tar ball of your database cd /var/lib tar czvf /tmp/rpmdb-38454.tar.gz rpm to this bug, and I'll take a look? Thanks.
Created attachment 17486 [details] tarball of the RPM database causing this trouble
Here's the start of the problem. The script cd /var/lib/rpm for i in * do echo $i ---- db_verify $i done gives output: db_verify: First overflow page 2814 has a prev_pgno db_verify: Overflow item incomplete on page 2862 db_verify: Overflow page 2814 has bogus prev_pgno value db_verify: Page 2814 encountered twice in overflow traversal db_verify: First overflow page 2814 has a prev_pgno db_verify: Page 2814 encountered twice in overflow traversal db_verify: First overflow page 2814 has a prev_pgno db_verify: Page 2814 encountered twice in overflow traversal db_verify: First overflow page 2814 has a prev_pgno db_verify: Page 2814 encountered twice in overflow traversal db_verify: First overflow page 2814 has a prev_pgno db_verify: Page 2814 encountered twice in overflow traversal db_verify: DB->verify: Packages.old: DB_VERIFY_BAD: Database verification failed Fix or workaround coming in a bit ...
OK, you have several bad records, all occurred someplace near ... kernel-2.2.19-7.0.1.2.2mvd Wed 25 Apr 2001 10:14:38 PM EDT up2date-gnome-2.5.4-1 Wed 25 Apr 2001 10:09:50 PM EDT up2date-2.5.4-1 Wed 25 Apr 2001 10:09:45 PM EDT rhn_register-gnome-1.3.2-1 Wed 25 Apr 2001 10:09:44 PM EDT rhn_register-1.3.2-1 Wed 25 Apr 2001 10:09:43 PM EDT python-xmlrpc-1.4-1 Wed 25 Apr 2001 10:09:42 PM EDT ========== HERE ============= abisuite-0.7.13-ximian.6 Wed 25 Apr 2001 06:06:11 PM EDT gnome-audio-1.4.0-ximian.1 Wed 25 Apr 2001 06:06:05 PM EDT gnome-audio-1.0.0-12 Wed 25 Apr 2001 06:06:03 PM EDT abisuite-0.7.13-ximian.6 Wed 25 Apr 2001 06:04:53 PM EDT nautilus-trilobite-1.0.1.1-ximian.12 Wed 25 Apr 2001 05:57:25 PM EDT Here's how to fix: 1) Fix the database damage (and save a copy) by doing (as root, you need db3-utils) cd /var/lib/rpm mv Packages Packages.old db_dump Packages.old | db_load Packages 2) Get a copy of the attached toy program, and compile by doing (you need db3-devel) cc -o t38454 t38454.c -ldb-3.1 3) Run the program as root t38454 4) Do a rpm -qa, then a rpm --rebuilddb.
Created attachment 17528 [details] t38454.c will delete bad records
Reopen the bug if you need more ...
Works great! Thanks Jeff!
*** Bug 40066 has been marked as a duplicate of this bug. ***
*** Bug 41793 has been marked as a duplicate of this bug. ***
*** Bug 41054 has been marked as a duplicate of this bug. ***
*** Bug 55396 has been marked as a duplicate of this bug. ***