Bug 83699

Summary: rpm --rebuilddb crashed
Product: [Retired] Red Hat Linux Reporter: Donatas <jancau>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DEFERRED QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
URL: www.svm.lt
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-02-08 15:36:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Donatas 2003-02-07 06:09:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461; .NET 
CLR 1.0.3705)

Description of problem:
Can't rebuild rpmdb. Not working rpm -qa, also up2date is not working

rpm --rebuilddb
*** dbiUpdateRecord: uh is NULL
Segmentation fault

This bug occur after running manually up2date. Temporary Internet connection 
was lost. And after that started another up2date application. But first is 
seams wasn't stopped.

Please help  me to repair rpm database?
It is located http://www.svm.lt/~donatas/rpmdb.tar.gz

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


How reproducible:
Always

Steps to Reproduce:
1.Take my rpm database from http://www.svm.lt/~donatas/rpmdb.tar.gz
2.Copy contens to /var/lib
3.Run rpm --rebuilddb
   

Actual Results:  *** dbiUpdateRecord: uh is NULL
Segmentation fault

Additional info:

I don't know how exactly up2date is working, but it seams up2date do not lock 
database when processing update.
This bug happen when another up2date process started, while first did not 
finished.

Comment 1 Donatas 2003-02-08 15:36:39 UTC
Fixed myself

Comment 2 Jeff Johnson 2003-02-08 15:39:41 UTC
Good. What was wrong?

Comment 3 Donatas 2003-02-08 16:24:52 UTC
I just followed instructions on
http://info.ccone.at/INFO/Mail-Archives/redhat/Jan-2003/msg00050.html

Found that my current list of rpm packages is valid on
/var/log/rpmpkgs.1

Downloaded all packages available in this list. Some was on RedHat
installation, some on RedHat updates, others just find on Internet.

Moved old database:
# mv /var/lib/rpm /var/lib/rpm.save

Initialized a new rpm database:
# rpm --initdb

Downloaded script http://www.tuxfan.homeip.net:8080/hacks/recover_rpm_db.sh

And just run the script
# ./recover_rpm_db.sh -f /var/log/rpmpkgs.1 -p ./downloadedRPMS


Comment 4 Jeff Johnson 2003-02-08 16:39:41 UTC
That'll work.

FWIW, a rebuilddb with rpm-4.1 should fix as well, preserving
install times and file states that are lost by the --justdb
recreation.

Carry Packages to machine with rpm-4.1, rebuilddb there, bring Packages
back, rebuilddb to recreate indices.