Bug 1177843
Summary: | "grubby fatal error: unable to find a suitable template" when updating kernel | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Rick Kasten <rickkasten> |
Component: | grubby | Assignee: | Peter Jones <pjones> |
Status: | CLOSED WONTFIX | QA Contact: | Release Test Team <release-test-team-automation> |
Severity: | medium | Docs Contact: | |
Priority: | urgent | ||
Version: | 6.6 | CC: | aruizrui, azelinka, bgollahe, herrold, inetkach, jspanko, jvavra, mpetlan, mwest, obockows, pjones, rickkasten, sbueno, thozza |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-01-30 18:28:24 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Rick Kasten
2014-12-30 20:21:47 UTC
I have discovered that I have a file /boot/initrd-2.6.32-358.el6.x86_64kdump.img but I have no corresponding file for either 504 kernel I have installed. Sorry, I figured out the /boot/boot/ stuff, and my /boot/grub/grub.conf now looks like this: default=0 timeout=0 hiddenmenu title CentOS (2.6.32-504.3.3.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-504.3.3.el6.x86_64 ro root=LABEL=rootfs console=ttyS0 initrd /initramfs-2.6.32-504.3.3.el6.x86_64.img However, everything else about this remains true: installing a new kernel still results in "grubby fatal error: unable to find a suitable template", and `grubby --default-kernel` still results in no output. I have to edit my /boot/grub/grub.conf manually for any kernel update. Please attach /var/log/grubby from immediately after the failure has occurred. You're getting back to me almost 10 months after I opened the bug, and you think I'm still going to have my grubby log? This ticket can be closed I see action on this ticket -- I probably have the files requested in comment #4 ... checking Running a kernel only update just now I do not see the 'no suitable template' message on this unit -- I know I have seen them elsewhere so I will 'walk through' active 6 units looking for it [root@blind log]# rpm -qa kernel\* kernel-2.6.32-573.22.1.el6.i686 kernel-2.6.32-642.el6.i686 kernel-firmware-2.6.32-696.el6.noarch kernel-2.6.32-504.16.2.el6.i686 kernel-headers-2.6.32-696.el6.i686 kernel-2.6.32-431.11.2.el6.i686 kernel-2.6.32-696.el6.i686 [root@blind log]# yum upgrade kernel Loaded plugins: fastestmirror Setting up Upgrade Process Determining fastest mirrors * base: mirrors.lga7.us.voxel.net * extras: mirrors.gigenet.com * updates: centos.mirror.constant.com base | 3.7 kB 00:00 base/primary_db | 3.7 MB 00:02 extras | 3.3 kB 00:00 extras/primary_db | 21 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 3.5 MB 00:00 Resolving Dependencies --> Running transaction check ---> Package kernel.i686 0:2.6.32-696.10.2.el6 will be installed --> Processing Dependency: kernel-firmware >= 2.6.32-696.10.2.el6 for package: kernel-2.6.32-696.10.2.el6.i686 --> Running transaction check ---> Package kernel-firmware.noarch 0:2.6.32-696.el6 will be updated ---> Package kernel-firmware.noarch 0:2.6.32-696.10.2.el6 will be an update --> Finished Dependency Resolution --> Running transaction check ---> Package kernel.i686 0:2.6.32-431.11.2.el6 will be erased --> Finished Dependency Resolution Dependencies Resolved ================================================================================= Package Arch Version Repository Size ================================================================================= Installing: kernel i686 2.6.32-696.10.2.el6 updates 30 M Removing: kernel i686 2.6.32-431.11.2.el6 @updates 89 M Updating for dependencies: kernel-firmware noarch 2.6.32-696.10.2.el6 updates 29 M Transaction Summary ================================================================================= Install 1 Package(s) Upgrade 1 Package(s) Remove 1 Package(s) Total download size: 59 M Is this ok [y/N]: y Downloading Packages: (1/2): kernel-2.6.32-696.10.2.el6.i686.rpm | 30 MB 00:04 (2/2): kernel-firmware-2.6.32-696.10.2.el6.noarch.rpm | 29 MB 00:04 --------------------------------------------------------------------------------- Total 6.3 MB/s | 59 MB 00:09 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : kernel-firmware-2.6.32-696.10.2.el6.noarch 1/4 Installing : kernel-2.6.32-696.10.2.el6.i686 2/4 Cleanup : kernel-2.6.32-431.11.2.el6.i686 3/4 warning: erase unlink of /lib/modules/2.6.32-431.11.2.el6.i686/modules.order failed: No such file or directory warning: erase unlink of /lib/modules/2.6.32-431.11.2.el6.i686/modules.networking failed: No such file or directory warning: erase unlink of /lib/modules/2.6.32-431.11.2.el6.i686/modules.modesetting failed: No such file or directory warning: erase unlink of /lib/modules/2.6.32-431.11.2.el6.i686/modules.drm failed: No such file or directory warning: erase unlink of /lib/modules/2.6.32-431.11.2.el6.i686/modules.block failed: No such file or directory Cleanup : kernel-firmware-2.6.32-696.el6.noarch 4/4 Verifying : kernel-firmware-2.6.32-696.10.2.el6.noarch 1/4 Verifying : kernel-2.6.32-696.10.2.el6.i686 2/4 Verifying : kernel-2.6.32-431.11.2.el6.i686 3/4 Verifying : kernel-firmware-2.6.32-696.el6.noarch 4/4 Removed: kernel.i686 0:2.6.32-431.11.2.el6 Installed: kernel.i686 0:2.6.32-696.10.2.el6 Dependency Updated: kernel-firmware.noarch 0:2.6.32-696.10.2.el6 Complete! [root@blind log]# grubby works uneventfully, but there is no /var/log/grubby file [root@blind ~]# grubby --default-kernel /boot/vmlinuz-2.6.32-696.10.2.el6.i686 [root@blind ~]# cd /var/log [root@blind log]# ls anaconda.log dmesg messages spooler-20170910 anaconda.program.log dmesg.old messages-20170903 spooler-20170917 anaconda.storage.log dracut.log messages-20170910 spooler-20170924 anaconda.syslog dracut.log-20130101 messages-20170917 tallylog anaconda.yum.log dracut.log-20140101 messages-20170924 wtmp audit dracut.log-20150101 ntpstats wtmp-20151125 boot.log dracut.log-20160101 sa yum.log btmp lastlog secure yum.log-20140101 btmp-20170901 mail secure-20170903 yum.log-20150101 cron maillog secure-20170910 yum.log-20160101 cron-20170903 maillog-20170903 secure-20170917 yum.log-20170101 cron-20170910 maillog-20170910 secure-20170924 cron-20170917 maillog-20170917 spooler cron-20170924 maillog-20170924 spooler-20170903 [root@blind log]# What CLI option or RC file setting contains an option to cause 'grubby' to emit debugging information to /var/log/grubby so I may enable it? the 'man' page lists none that I can see no noise seen here either [root@sna-mirror sysconfig]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@sna-mirror sysconfig]# yum clean all Loaded plugins: fastestmirror Cleaning repos: base epel extras updates Cleaning up Everything [root@sna-mirror sysconfig]# cd /var/log [root@sna-mirror log]# ls *grub* ls: cannot access *grub*: No such file or directory [root@sna-mirror log]# yum -q upgrade kernel ================================================================================= Package Arch Version Repository Size ================================================================================= Installing: kernel i686 2.6.32-696.10.3.el6 updates 30 M Removing: kernel i686 2.6.32-573.22.1.el6 @updates 92 M Updating for dependencies: kernel-firmware noarch 2.6.32-696.10.3.el6 updates 29 M Transaction Summary ================================================================================= Install 1 Package(s) Upgrade 1 Package(s) Remove 1 Package(s) Is this ok [y/N]: y warning: erase unlink of /lib/modules/2.6.32-573.22.1.el6.i686/modules.order failed: No such file or directory warning: erase unlink of /lib/modules/2.6.32-573.22.1.el6.i686/modules.networking failed: No such file or directory warning: erase unlink of /lib/modules/2.6.32-573.22.1.el6.i686/modules.modesetting failed: No such file or directory warning: erase unlink of /lib/modules/2.6.32-573.22.1.el6.i686/modules.drm failed: No such file or directory warning: erase unlink of /lib/modules/2.6.32-573.22.1.el6.i686/modules.block failed: No such file or directory [root@sna-mirror log]# ls *grub* ls: cannot access *grub*: No such file or directory [root@sna-mirror log]# date Wed Sep 27 14:38:24 EDT 2017 [root@sna-mirror log]# grubby --info=` grubby --default-kernel ` boot=/dev/xvda index=0 kernel=/boot/vmlinuz-2.6.32-696.10.3.el6.i686 args="ro rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=ttyS0 elevator=noop crashkernel=auto rhgb quiet" root=/dev/vda1 initrd=/boot/initramfs-2.6.32-696.10.3.el6.i686.img [root@sna-mirror log]# grubby --update-kernel=ALL --remove-args="quiet" [root@sna-mirror log]# grubby --update-kernel=ALL --remove-args="rhgb" [root@sna-mirror log]# grubby --info=` grubby --default-kernel ` boot=/dev/xvda index=0 kernel=/boot/vmlinuz-2.6.32-696.10.3.el6.i686 args="ro rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=ttyS0 elevator=noop crashkernel=auto" root=/dev/vda1 initrd=/boot/initramfs-2.6.32-696.10.3.el6.i686.img [root@sna-mirror log]# mpetlan as you set this to 'urgent' could you also please amend the Reporter field to my email address -- my local procmail sorting will bring incoming content ot me faster if that is done ... there must be some 'behind the scenes' activity, as comments I see jump from $7 to #11 Not required, but just faster I am no longer in a position to offer assistance with my original problem. Aide to memory: my prior bug with the 'no suitable template found' message https://bugzilla.redhat.com/show_bug.cgi?id=1189217 RPH later filing https://bugzilla.redhat.com/show_bug.cgi?id=1498169 Unfortunately, RHEL 6 is based on grubby 7, and the logging was not added until grubby 8. In any case, what we have to know in order to fix this is /why/ it can't find a suitable template. Basically, it's looking for an entry for the kernel which is currently set as default to boot, and then trying to find the root filesystem and similar for that. If that fails, it'll try each successive entry until it finds one that's suitable. In order, the things that will make an entry not suitable as a template are: - no kernel line (or it's malformed / doesn't have enough elements on it) - access(kernel_path, R_OK) fails - usually this means it's missing, which will happen if you "rpm -Uvh" kernel instead of "rpm -ivh" or using yum correctly. - no root= line and root= isn't on the kernel arguments line - root= can't be resolved to a device (i.e. root=/dev/sdb1 where the file doesn't exist, root=LABEL=foo where no fs is labeled "foo", or "root=UUID=abcdefg" where blkid doesn't find any fs with that label.) - we couldn't parse /etc/mtab - the UUID of the fs root= points at doesn't match the UUID of the actual filesystem we found mounted as root in /etc/mtab. Again, check what blkid says the UUID is for each. To diagnose which thing is going wrong, first a reproducible set of conditions needs to be established - this usually just means saving the grub.conf from before and after the transaction, and running the grubby invocation that failed (i.e. what new-kernel-pkg ran) on a copy of that file. If you can make a reproducible set of conditions where the failure occurs, then usually strace on the grubby invocation will show you which condition fails, and then the next step is figuring out why - it's possible it's a bug in grubby, but more often something external has broken the data needed for one of the above tests. One thing you might try, and I'm not sure it will actually work, is the test build of grubby linked below, which is the RHEL 7 grubby 8 package (which will log things to /var/log/grubby) hacked up to hopefully work on RHEL 6, where we don't have grub2. Without knowing specifically why finding a suitable template entry is failing, it's impossible to ACK this bug, as we simply do not know what's going wrong. Development Management has reviewed and declined this request. You may appeal this decision by reopening this request. That grubby 8 build is here: https://pjones.fedorapeople.org/grubby-8-rhel-6/ . I want to stress that I don't have any reason to believe this will solve the issue at hand, but it may provide useful logs for debugging the issue. thank you for the pointer -- will add into my testing, and if / when I have a reproducer on RHEL 6 level code but with the later 'grubby-8', I will clone this bug and add details fwiw, there is a sbin -> /usr/sbin/ path change as well when I encounter the template issue, I'll --nodeps through that objection [root@blind ~]# rpm -Uvh /home/herrold/rpmbuild/RPMS/i686/grubby-8.28-23.el6.pj0.i686.rpm error: Failed dependencies: /sbin/new-kernel-pkg is needed by (installed) kernel-2.6.32-696.20.1.el6.i686 [root@blind ~]# rpm -qf /sbin/new-kernel-pkg grubby-7.0.15-7.el6.i686 [root@blind ~]# rpm -qlp /home/herrold/rpmbuild/RPMS/i686/grubby-8.28-23.el6.pj0.i686.rpm | grep new-kernel-pkg /usr/sbin/new-kernel-pkg /usr/share/man/man8/new-kernel-pkg.8.gz [root@blind ~]# again, thank you |