Bug 4590

Summary: setting up mga.1 chroot under cauldron needs urpmi to downgrade rpm database
Product: Mageia Reporter: Chris Denice <eatdirt>
Component: RPM PackagesAssignee: Thierry Vignaud <thierry.vignaud>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: Low Keywords: Triaged
Version: Cauldron   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: urpmi-6.44-1.mga2.src.rpm CVE:
Status comment:
Attachments: GDB trace of rpm-4.8.x choking on rpm-4.9.x db

Description Chris Denice 2012-02-19 18:21:04 CET
Description of problem:

Setting up a chroot for mga,1 with urpmi under Cauldron is currently broken and gives some warnings as:

"
can not migrate rpm db from Hash version 9 to Hash version 8 without db42_load 
"

Installation of basesystem-minimal fails due to missing setup; and with the wrokaround mentioned below ends up with a corrupted rpm db.

Installing db42-utils from mdv (we don't have it) suppresses the warning but still gives a corrupted db.



How reproducible: all time time under the steps below for a chroot under /mnt/bsroot.


Steps to Reproduce:
1.
urpmi.addmedia --urpmi-root /mnt/bsroot --distrib --mirrorlist http://mirrors.mageia.org/api/mageia.1.x86_64.list

2.
urpmi --urpmi-root /mnt/bsroot --auto --no-suggests sysvinit basesystem-minimal

<<<<<<< the warning comes here <<<<<<<<,
can not migrate rpm db from Hash version 9 to Hash version 8 without db42_load
<<<<<<<

3. At that point, basesystem-minimal alone fails with this error:
Installation failed:    setup >= 2.7.12-2 is needed by passwd-0.78-2.mga1.x86_64

4. But this works:
 urpmi --urpmi-root /mnt/bsroot --auto --no-suggests setup

5. Again, and this times this is ok:
   urpmi --urpmi-root /mnt/bsroot --auto --no-suggests sysvinit basesystem-minimal

6. Finally
   urpmi --urpmi-root /mnt/bsroot --auto --no-suggests urpmi

7. mount the /proc /sys + setup resol.conf + chroot /mnt/bsroot

8. Inside the chroot try

urpmi whatever and enjoy the rpmdb corruption show which ends up with a segmentation fault :)
Comment 1 Manuel Hiebel 2012-02-21 01:18:55 CET
Hi, thanks for reporting this bug.
Assigned to the package maintainer.

(Please set the status to 'assigned' if you are working on it)

Keywords: (none) => Triaged
Assignee: bugsquad => thierry.vignaud

Comment 2 Thierry Vignaud 2012-02-21 11:15:13 CET
That's just a warning (because there's no rpm installed at all in the chroot at that stage) which should just be silenced. And anyway db42* stuff is only needed for very old rpm that we don't care about. We only offer upgrade path from mdv2010.x

As for the segfault, rpmdb isn't corrupted.
It just is in rpm4.9 format.
urpmi just needs to perform a rpmdb downgrade.
One need to manually run "rpm --rebuilddb" in the chroot in order to downgrade the rpmdb.

Point #2 is a packaging issues

Priority: Normal => Low
Summary: setting up mga.1 chroot under cauldron yields corrupted rpm database => setting up mga.1 chroot under cauldron needs urpmi to downgrade rpm database
Severity: normal => minor

Comment 3 Thierry Vignaud 2012-02-21 11:15:15 CET
Created attachment 1612 [details]
GDB trace of rpm-4.8.x choking on rpm-4.9.x db
Comment 4 Thierry Vignaud 2012-02-21 12:10:14 CET
Fixed in my git repo

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 5 Chris Denice 2012-02-21 13:28:30 CET
Cool, and thanks for the clarifications! rpm --rebuilddb worked.

chris.