Created attachment 340623 [details] anaconda-logs.tgz Description of problem: Unable to install packages (with rpm or yum) in a %post script when kickstarting rawhide. This impacts provisioning systems with beaker/rhts Version-Release number of selected component (if applicable): anaconda-11.5.0.46 How reproducible: everytime Steps to Reproduce: 1. Create a kickstart file based on /root/anaconda-ks.cfg 2. Add a %post section as follows: %post yum -y install snake %end 3. Initiate kickstart install Actual results: Installation completes but snake package not installed. Console logs from RHTS show the following messages while attempting to install packages during %post error: cannot open Packages index using db3 - No such file or directory (2) error: cannot open Packages database in /var/lib/rpm error: cannot open Packages database in /var/lib/rpm error: cannot open Packages index using db3 - No such file or directory (2) error: cannot open Packages database in /var/lib/rpm Expected results: Packages requested in %post should be installed Additional info: * See attached log files -rw-r--r-- root/root 20109 2009-04-21 15:39 install.log -rw-r--r-- root/root 3226 2009-04-21 15:39 install.log.syslog -rw------- root/root 1607 2009-04-21 15:39 anaconda-ks.cfg -rw------- root/root 47762 2009-04-21 15:39 var/log/anaconda.log -rw------- root/root 30823 2009-04-21 15:39 var/log/anaconda.syslog * This bug was discovered during RHTS provisions > Failure msg - http://cobbler.pastebin.com/me3624eb > https://rhts.redhat.com/testlogs/55312/185599/1552497/anaconda.log > https://rhts.redhat.com/testlogs/55312/185599/1552497/ks.cfg * At the end of the install, if I chroot into /mnt/sysimage ... rpm commands fail. ┌────────────────────────────┤ Complete ├─────────────────────────────┐ │ │ │ Congratulations, your Fedora installation is complete. │ │ │ │ Please reboot to use the installed system. Note that updates may │ │ be available to ensure the proper functioning of your system and │ │ installation of these updates is recommended after the reboot. │ │ │ │ ┌────────┐ │ │ │ Reboot │ │ │ └────────┘ │ │ │ │ │ └─────────────────────────────────────────────────────────────────────┘ press <ctrl>-z Type <exit> to return to the install program. sh-4.0# chroot /mnt/sysimage/ sh-4.0# rpm -qa error: cannot open Packages index using db3 - No such file or directory (2) error: cannot open Packages database in /var/lib/rpm error: cannot open Packages database in /var/lib/rpm
Can you strace rpm -qa after you chroot and attach the results to this bug too? Thanks.
Also, see if 'rm -f /var/lib/rpm/__db*' before trying to install the snake package helps
Created attachment 340656 [details] strace rpm -q kernel
(In reply to comment #2) > Also, see if 'rm -f /var/lib/rpm/__db*' before trying to install the snake > package helps That seems to resolve the issue. So what does this mean? sh-4.0# chroot /mnt/sysimage /bin/su - [root@i386-70 ~]# rpm -q kernel error: cannot open Packages index using db3 - No such file or directory (2) error: cannot open Packages database in /var/lib/rpm error: cannot open Packages database in /var/lib/rpm [root@i386-70 ~]# rm -f /var/lib/rpm/__db.00* [root@i386-70 ~]# rpm -q kernel kernel-2.6.29.1-100.fc11.x86_64
It means that the different rpmdb flags we use from outside the chroot are making the environment incompatible. On a reboot, they'd get wiped but that won't help here Can you see if updates=http://katzj.fedorapeople.org/updates.cgz helps?
Using the provided updates.img yields ... Running anaconda 11.5.0.46, the Fedora system installer - please wait... Traceback (most recent call last): File "/usr/bin/anaconda", line 551, in <module> import dispatch File "/usr/lib/anaconda/dispatch.py", line 26, in <module> from packages import writeKSConfiguration, turnOnFilesystems File "/tmp/updates/packages.py", line 29, in <module> import timer ImportError: No module named timer install exited abnormally [1/1] disabling swap... unmounting filesystems...
Doh, that's because I gave you the wrong url. Suspiciously close and one that exists, but long different :) http://katzj.fedorapeople.org/updates.img ought to work better
Using the provided updates.img works. sh-4.0# chroot /mnt/sysimage /bin/su - [root@i386-70 ~]# rpm -q kernel kernel-2.6.29.1-102.fc11.x86_64 Is this something we can target for F-11-Preview? This impacts RHTS/beaker automation of Fedora.
I've pushed the fix to git. Not sure where things are in the compose process to know if we can get in another build. jkeating should know and then just ask in #anaconda if we need to get a build done
The fix is in anaconda-11.5.0.48. Preview had .47.
I just saw this again with anaconda-11.5.0.54-1.fc11.x86_64. Is it possible this bug came back? I'm doing the same thing - running rpm as the first thing in a %post.
Created attachment 345663 [details] strace rpm -qa in chroot Here's an strace of rpm -qa inside the chroot.
*** Bug 503475 has been marked as a duplicate of this bug. ***
Hum... from the strace in c#12: open("/var/tmp/imgcreate-OnSfl_/install_root/var/lib/rpm/Packages", O_RDONLY) = -1 ENOENT (No such file or directory) AFAICT that's a leftover by livecd-tools, you certainly dont want the db environment in images. This is supposedly already taken care of: commit c80a302bda3cc1fc55fac088613bbaa86467fe86 Author: Jeremy Katz <katzj> Date: Fri Oct 10 10:18:19 2008 -0400 Clean up rpmdb locks after installing packages also With new versions of RPM, people can otherwise run into things they don't expect inside of their %post scripts. So make things simpler for them ...but maybe something has changed since then.
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle. Changing version to '11'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
btw, I experienced this too - something broke during installation under qemu, so I tried rescue mode of the installer, and I have found that rpm is not installed, so that I used the one provided by the installer ... after installing rpm and chrooting into /mnt/sysimage, I got the same error ... comment #2 helped
Closing out bug that's been in MODIFIED for a while.