Bug 731226

Summary: grubby fatal error: unable to find a suitable template
Product: [Fedora] Fedora Reporter: Jóhann B. Guðmundsson <johannbg>
Component: grubbyAssignee: Peter Jones <pjones>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: aquini, bcl, gansalmon, itamar, jonathan, jwboyer, kernel-maint, madhu.chinakonda, pjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-19 11:32:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Strace of grubby fail... none

Description Jóhann B. Guðmundsson 2011-08-17 03:53:06 UTC
Description of problem:

When installing the 3.1 rc2 from koji the error in the error in the summary appears...

Transaction Test Succeeded
Running Transaction
  Installing : kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64                  1/2 
  Installing : kernel-3.1.0-0.rc2.git0.1.fc16.x86_64                        2/2 
grubby fatal error: unable to find a suitable template


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

kernel-3.1.0-0.rc2.git0.1.fc16.x86_64

How reproducible:

Atleast once

Steps to Reproduce:
1. Download the kernels from koji
2. run yum install $kernel and kernel-devel 
3.
  
Actual results:

The error in the summary

Expected results:

No error et al...

Additional info:

Comment 1 Jóhann B. Guðmundsson 2011-08-17 04:40:38 UTC
Note that there is no menu entry in grub2 for the 3.1 rc2 kernel.

Comment 2 Josh Boyer 2011-08-17 12:10:22 UTC
What version of grubby do you have installed?

Comment 3 Josh Boyer 2011-08-17 13:45:55 UTC
Also, do you have both grub and grub2 installed?

Comment 4 Josh Boyer 2011-08-17 16:22:17 UTC
I don't see this at all on a freshly installed and updated F16 kvm guest.  The 3.1 rc2 kernel installs just fine and /boot/grub2/grub.cfg has a menu entry.

Comment 5 Jóhann B. Guðmundsson 2011-08-17 19:46:08 UTC
Removing the kernel and reinstalling it triggers it again...

Steps to duplicate...

[root@localhost ~]# rpm -qa | grep grub
grubby-8.1-1.fc16.x86_64
grub2-1.99-0.2.fc16.x86_64
[root@localhost ~]# yum install kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm

Comment 6 Josh Boyer 2011-08-17 19:53:51 UTC
[jwboyer@localhost ~]$ sudo yum localupdate ~/Downloads/kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm 

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for jwboyer: 
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Local Package Process
Examining /home/jwboyer/Downloads/kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm: kernel-3.1.0-0.rc2.git0.1.fc16.x86_64
Marking /home/jwboyer/Downloads/kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm as an update to kernel-3.0.0-1.fc16.x86_64
Marking /home/jwboyer/Downloads/kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm as an update to kernel-3.0.1-3.fc16.x86_64
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.1.0-0.rc2.git0.1.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package
    Arch   Version                 Repository                              Size
================================================================================
Installing:
 kernel
    x86_64 3.1.0-0.rc2.git0.1.fc16 /kernel-3.1.0-0.rc2.git0.1.fc16.x86_64 114 M

Transaction Summary
================================================================================
Install       1 Package

Total size: 114 M
Installed size: 114 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : kernel-3.1.0-0.rc2.git0.1.fc16.x86_64                        1/1 

Installed:
  kernel.x86_64 0:3.1.0-0.rc2.git0.1.fc16                                       

Complete!
[jwboyer@localhost ~]$ cat /boot/grub2/grub
grub.cfg  grubenv   
[jwboyer@localhost ~]$ cat /boot/grub2/grub.cfg 
cat: /boot/grub2/grub.cfg: Permission denied
[jwboyer@localhost ~]$ sudo cat /boot/grub2/grub.cfg 
[sudo] password for jwboyer: 
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

set timeout=20
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora (3.1.0-0.rc2.git0.1.fc16.x86_64)' --class fedora --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt2)'
	search --no-floppy --fs-uuid --set=root 5158ccff-bb07-4056-9620-1494dea1094f
	echo 'Loading Fedora (3.0.1-3.fc16.x86_64)'
	linux	/vmlinuz-3.1.0-0.rc2.git0.1.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root ro rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0 LANG=en_US.UTF-8
	echo 'Loading initial ramdisk ...'
	initrd /initramfs-3.1.0-0.rc2.git0.1.fc16.x86_64.img
}
menuentry 'Fedora (3.0.1-3.fc16.x86_64)' --class fedora --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt2)'
	search --no-floppy --fs-uuid --set=root 5158ccff-bb07-4056-9620-1494dea1094f
	echo 'Loading Fedora (3.0.1-3.fc16.x86_64)'
	linux	/vmlinuz-3.0.1-3.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root ro rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0 LANG=en_US.UTF-8
	echo 'Loading initial ramdisk ...'
	initrd /initramfs-3.0.1-3.fc16.x86_64.img
}
menuentry 'Fedora Linux, with Linux 3.0.0-1.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt2)'
	search --no-floppy --fs-uuid --set=root 5158ccff-bb07-4056-9620-1494dea1094f
	echo	'Loading Linux 3.0.0-1.fc16.x86_64 ...'
	linux	/vmlinuz-3.0.0-1.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root ro rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0 LANG=en_US.UTF-8
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-3.0.0-1.fc16.x86_64.img
}
menuentry 'Fedora Linux, with Linux 3.0.0-1.fc16.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt2)'
	search --no-floppy --fs-uuid --set=root 5158ccff-bb07-4056-9620-1494dea1094f
	echo	'Loading Linux 3.0.0-1.fc16.x86_64 ...'
	linux	/vmlinuz-3.0.0-1.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root ro single rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0 LANG=en_US.UTF-8
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-3.0.0-1.fc16.x86_64.img
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###

Comment 7 Josh Boyer 2011-08-17 19:59:37 UTC
[jwboyer@localhost ~]$ sudo yum remove kernel-3.1.0-0.rc2.git0.1.fc16.x86_64
[sudo] password for jwboyer: 
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.1.0-0.rc2.git0.1.fc16 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package
   Arch   Version                 Repository                               Size
================================================================================
Removing:
 kernel
   x86_64 3.1.0-0.rc2.git0.1.fc16 @/kernel-3.1.0-0.rc2.git0.1.fc16.x86_64 114 M

Transaction Summary
================================================================================
Remove        1 Package

Installed size: 114 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : kernel-3.1.0-0.rc2.git0.1.fc16.x86_64                        1/1 

Removed:
  kernel.x86_64 0:3.1.0-0.rc2.git0.1.fc16                                       

Complete!
[jwboyer@localhost ~]$ sudo yum install ~/Downloads/kernel-
kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm
kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm
[jwboyer@localhost ~]$ sudo yum install ~/Downloads/kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm ~/Downloads/kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm 
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Install Process
Examining /home/jwboyer/Downloads/kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm: kernel-3.1.0-0.rc2.git0.1.fc16.x86_64
Marking /home/jwboyer/Downloads/kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm as an update to kernel-3.0.0-1.fc16.x86_64
Marking /home/jwboyer/Downloads/kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm as an update to kernel-3.0.1-3.fc16.x86_64
Examining /home/jwboyer/Downloads/kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm: kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64
Marking /home/jwboyer/Downloads/kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.1.0-0.rc2.git0.1.fc16 will be installed
---> Package kernel-devel.x86_64 0:3.1.0-0.rc2.git0.1.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package
   Arch   Version                  Repository                              Size
================================================================================
Installing:
 kernel
   x86_64 3.1.0-0.rc2.git0.1.fc16  /kernel-3.1.0-0.rc2.git0.1.fc16.x86_64 114 M
 kernel-devel
   x86_64 3.1.0-0.rc2.git0.1.fc16  /kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64
                                                                           27 M

Transaction Summary
================================================================================
Install       2 Packages

Total size: 140 M
Installed size: 140 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64                  1/2 
  Installing : kernel-3.1.0-0.rc2.git0.1.fc16.x86_64                        2/2 

Installed:
  kernel.x86_64 0:3.1.0-0.rc2.git0.1.fc16                                       
  kernel-devel.x86_64 0:3.1.0-0.rc2.git0.1.fc16                                 

Complete!
[jwboyer@localhost ~]$ sudo grep rc2 /boot/grub2/grub.cfg 
menuentry 'Fedora (3.1.0-0.rc2.git0.1.fc16.x86_64)' --class fedora --class gnu-linux --class gnu --class os {
	linux	/vmlinuz-3.1.0-0.rc2.git0.1.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root ro rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0 LANG=en_US.UTF-8
	initrd /initramfs-3.1.0-0.rc2.git0.1.fc16.x86_64.img
[jwboyer@localhost ~]$

Comment 8 Jóhann B. Guðmundsson 2011-08-17 20:07:34 UTC
Created attachment 518747 [details]
Strace of grubby fail...

This seems to be triggered by this.. 

# /sbin/new-kernel-pkg --package kernel --install 3.1.0-0.rc2.git0.1.fc16.x86_64 
grubby fatal error: unable to find a suitable template

Attached an strace output from running this

Comment 9 Jóhann B. Guðmundsson 2011-08-17 20:18:21 UTC
Did an remove and update like you did ( I did install ) but no change 

This must be hw related since you cant duplicate it in a vm...

[root@localhost ~]# yum remove kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64 kernel-3.1.0-0.rc2.git0.1.fc16.x86_64
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.1.0-0.rc2.git0.1.fc16 will be erased
--> Processing Dependency: kernel-uname-r = 3.1.0-0.rc2.git0.1.fc16.x86_64 for package: kmod-wl-3.1.0-0.rc2.git0.1.fc16.x86_64-5.60.48.36-2.fc16.1.x86_64
---> Package kernel-devel.x86_64 0:3.1.0-0.rc2.git0.1.fc16 will be erased
--> Running transaction check
---> Package kmod-wl-3.1.0-0.rc2.git0.1.fc16.x86_64.x86_64 0:5.60.48.36-2.fc16.1 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================
 Package                                      Arch         Version                         Repository                                           Size
=====================================================================================================================================================
Removing:
 kernel                                       x86_64       3.1.0-0.rc2.git0.1.fc16         @/kernel-3.1.0-0.rc2.git0.1.fc16.x86_64             114 M
 kernel-devel                                 x86_64       3.1.0-0.rc2.git0.1.fc16         @/kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64        27 M
Removing for dependencies:
 kmod-wl-3.1.0-0.rc2.git0.1.fc16.x86_64       x86_64       5.60.48.36-2.fc16.1             installed                                           2.3 M

Transaction Summary
=====================================================================================================================================================
Remove        3 Packages

Installed size: 143 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : kmod-wl-3.1.0-0.rc2.git0.1.fc16.x86_64-5.60.48.36-2.fc16.1.x86_64                                                                 1/3 
  Erasing    : kernel-3.1.0-0.rc2.git0.1.fc16.x86_64                                                                                             2/3 
  Erasing    : kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64                                                                                       3/3 

Removed:
  kernel.x86_64 0:3.1.0-0.rc2.git0.1.fc16                                kernel-devel.x86_64 0:3.1.0-0.rc2.git0.1.fc16                               

Dependency Removed:
  kmod-wl-3.1.0-0.rc2.git0.1.fc16.x86_64.x86_64 0:5.60.48.36-2.fc16.1                                                                                

Complete!
[root@localhost ~]# yum localupdate kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm 
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Local Package Process
Examining kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm: kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64
Marking kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm as an update to kernel-devel-3.0.1-3.fc16.x86_64
Examining kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm: kernel-3.1.0-0.rc2.git0.1.fc16.x86_64
Marking kernel-3.1.0-0.rc2.git0.1.fc16.x86_64.rpm as an update to kernel-3.0.1-3.fc16.x86_64
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.1.0-0.rc2.git0.1.fc16 will be installed
---> Package kernel-devel.x86_64 0:3.1.0-0.rc2.git0.1.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================
 Package                   Arch                Version                               Repository                                                 Size
=====================================================================================================================================================
Installing:
 kernel                    x86_64              3.1.0-0.rc2.git0.1.fc16               /kernel-3.1.0-0.rc2.git0.1.fc16.x86_64                    114 M
 kernel-devel              x86_64              3.1.0-0.rc2.git0.1.fc16               /kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64               27 M

Transaction Summary
=====================================================================================================================================================
Install       2 Packages

Total size: 140 M
Installed size: 140 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : kernel-devel-3.1.0-0.rc2.git0.1.fc16.x86_64                                                                                       1/2 
  Installing : kernel-3.1.0-0.rc2.git0.1.fc16.x86_64                                                                                             2/2 
grubby fatal error: unable to find a suitable template

Installed:
  kernel.x86_64 0:3.1.0-0.rc2.git0.1.fc16                                kernel-devel.x86_64 0:3.1.0-0.rc2.git0.1.fc16                               

Complete!
[root@localhost ~]# grep rc2 /boot/grub2/grub.cfg 
[root@localhost ~]#

Comment 10 Peter Jones 2011-08-17 20:58:21 UTC
Can you attach your grub2.cfg from before and after the failed run?

Comment 11 Jóhann B. Guðmundsson 2011-08-19 00:16:13 UTC
There was no difference in the grub2 file once that was clear I dug a little deeper couple of rpm commands later revealed missing directories incorrect file permissions and what not ( probably bit by the rpm bug ) so I just skipped few steps ahead wiped the laptop did a new fresh install from network voila no problem, kernel updated cleanly hence unable to duplicate thus this can be closed as a NOTABUG. 

You might want to add if then else file permission check to rule that stuff out