Hi folks,
Summary: When I install packages with rpm inside VirtualBox, rpm sometimes deletes arbitrary files as a side-effect, files which should not be affected by the installation. It happens rarely, but it breaks openSUSE installations, kiwi-builds and other things that rely on rpm. My host is openSUSE 12.1 with VirtualBox (4.1.4) from oss repo, my guests are openSUSE 12.1 and 12.2 (build 0091). It happened also with host=oS 11.4. I have no idea where to look for the cause.
I usually test new openSUSE versions inside VirtualBox before I install them on my production machines. This testing includes building kiwi images. Starting with oS 12.1, the kiwi built process sometimes produced broken images. *(https://bugzilla.novell.com/754259) but kiwi’s principal author WONTFIX it since it only occurs in VirtualBox and since it is possibly an rpm bug and not in kiwi. I can understand his decision.
I boiled down the kiwi sequence to lots of rpm calls and observed that the bug can occur whenever rpm -U is used. The following script installs the “filesystem” package about a million times but stops as soon as the resulting root tree differs from the previous one.
#!/bin/bash
# Mount install dvd in /mnt/suse !
suse=/mnt/suse
logprefix=/tmp/rpmbug
rpmroot=/tmp/rpmroot
arch=x86_64
for k in $(seq -f %06.0f 999999)
do
rm -rf $rpmroot
echo -n "$k: "
# Prepare root dir
mkdir -p $rpmroot/etc
cp /var/adm/fillup-templates/group.aaa_base $rpmroot/etc/group
cp /var/adm/fillup-templates/passwd.aaa_base $rpmroot/etc/passwd
# Install 'filesystem' package
rpm \
--root $rpmroot \
-U \
--nodeps \
-vv \
-- \
$suse/suse/$arch/filesystem-*.$arch.rpm \
>& $logprefix-$k.rpm.log
# Get hash of directory structure
currentsha1=$( \
(cd $rpmroot ; find) \
| tee $logprefix-$k.ls \
| sha1sum \
| cut -d' ' -f1 \
| tee $logprefix-$k.ls.sha1)
echo $currentsha1
# Stop if hash is different from last one
-z "$firstsha1" ] && firstsha1=$currentsha1
"$firstsha1" != "$currentsha1" ] && break
done
The host is an x86_64 machine with openSUSE 12.1 and VirtualBox 4.1.4, as guest I use openSUSE 12.1 or 12.2 from DVD (also x86_64). When I call this script, it stops after a few 1000 iterations — on my last test run, the bug occured on iteration 2837. The log files from rpm (rpmbug-00283{6,7}.rpm.log) are exactly the same, but the resulting root trees are different. Here are the first few lines of “vimdiff rpmbug-00283{6,7}.ls”:
. | .
./selinux | --------------------------------
./root | ./root
./root/bin | --------------------------------
./root/.gnupg | --------------------------------
./var | ./var
./var/X11R6 | --------------------------------
./var/adm | ./var/adm
./var/adm/backup | ./var/adm/backup
./var/adm/backup/rpmdb | --------------------------------
./var/adm/backup/sysconfig | --------------------------------
./var/adm/update-scripts | --------------------------------
./var/adm/perl-modules | --------------------------------
./var/adm/SuSEconfig | ./var/adm/SuSEconfig
./var/adm/SuSEconfig/bin | --------------------------------
./var/adm/SuSEconfig/md5 | --------------------------------
./var/adm/update-messages | --------------------------------
./var/adm/fillup-templates | --------------------------------
./var/games | --------------------------------
./var/spool | ./var/spool
./var/spool/clientmqueue | --------------------------------
./var/spool/lpd | --------------------------------
And “wc rpmbug-00283{6,7}.ls” says:
484 484 11579 rpmbug-002836.ls
193 193 4059 rpmbug-002837.ls
677 677 15638 insgesamt
I’m stuck. This bug bites me hard since November and I cannot ignore it. Most of the broken kiwi images boot perfectly, but basic applications (like vim) refuse to work because some files are missing. Note that I cannot reproduce this ouside of VBox. Also note that in some (early) test runs with multiple zypper calls, one of those calls removed files which have been installed by earlier zypper invocations. So it appears that rpm does not just fail to install the files/directories it is supposed to do, but it actively removes existing files — all happening inside the root tree on which rpm operates. The removal is not completely random, e.g., my kiwi images often lack “/var/lib/empty” and “/etc/alternatives”.
I have no idea where I might look for the cause of this. Did anyone of you observe something similar? If yes I’d be highly interested in details. Do you have an idea what I could do to further round up the cause? I’d like to reopen my bug report but I would prefer to return with something which can be reproduced by the maintainers.
– Yarny*