RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1189217 - grubby is unnecessarily terse -- provide better diagnostic message
Summary: grubby is unnecessarily terse -- provide better diagnostic message
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: grubby
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Jones
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-04 17:17 UTC by R P Herrold
Modified: 2015-03-12 19:15 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-12 19:15:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description R P Herrold 2015-02-04 17:17:33 UTC
Description of problem:

grubby has too many opaque failure conditions under a single error message; the admin needs more help; start to help

see also https://bugzilla.redhat.com/show_bug.cgi?id=124246

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

8.28-8.el7

How reproducible:

run updates via yum, and have a grubby failure


Steps to Reproduce:

yum -y upgrade 

(from an initial media install)


Actual results:

the unhelpful message:  
   grubby fatal error: unable to find a suitable template

is seen, and the kernels present do not match the kernels known to grub2
kernel-3.10.0-123.13.2.el7.x86_64 and kernel-3.10.0-123.13.1.el7.x86_64  are NOT reflected to grub2


addressed locally by inventorying and removing the two failed kernels

 cat /boot/grub2/grub.cfg | grep vmlinuz

to see the 'installed' kernels , and so by a process of elimination, identifying failed ones

then:

[root@vm010004029 ~]# rpm -e kernel-3.10.0-123.13.2.el7.x86_64 kernel-3.10.0-123.13.1.el7.x86_64                                                                
warning: file /lib/modules/3.10.0-123.13.1.el7.x86_64/weak-updates: remove failed: No such file or directory                                                    
warning: file /lib/modules/3.10.0-123.13.1.el7.x86_64/modules.softdep: remove failed: No such file or directory                                                 
warning: file /lib/modules/3.10.0-123.13.1.el7.x86_64/modules.devname: remove failed: No such file or directory                                                 
warning: file /lib/modules/3.10.0-123.13.2.el7.x86_64/weak-updates: remove failed: No such file or directory                                                    
warning: file /lib/modules/3.10.0-123.13.2.el7.x86_64/modules.softdep: remove failed: No such file or directory
warning: file /lib/modules/3.10.0-123.13.2.el7.x86_64/modules.devname: remove failed: No such file or directory
[root@vm010004029 ~]#

as well as then re-building the effective grub.cfg file

  grub2-mkconfig -o  /boot/grub/grub.cfg

thus:

[root@vm010004029 grub2]# grub2-mkconfig -o  /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-123.20.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.20.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-123.9.3.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.9.3.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-16290318d1874648e91e93d3be661d78
Found initrd image: /boot/initramfs-0-rescue-16290318d1874648e91e93d3be661d78.img
done




Expected results:

better diagnostic availability -- adding the ''debug is a start -- obviously more by way of succestions is useful as well


Additional info:

This was suggested years ago in a horror story of a bug: 
https://bugzilla.redhat.com/show_bug.cgi?id=723626

Comment 101 Eric Sandeen 2012-09-23 11:01:02 EDT

but I do not find that his patch ever made it into grubby.c

simple patch (inlined as it is a single line:

[herrold@centos-6 grubby]$ git diff
diff --git a/grubby.c b/grubby.c
index 3ee6c98..1347d13 100644
--- a/grubby.c
+++ b/grubby.c
@@ -2151,7 +2151,7 @@ struct singleEntry * findTemplate(struct grubConfig * cfg,
        index++;
     }

-    fprintf(stderr, _("grubby fatal error: unable to find a suitable template\n
+    fprintf(stderr, _("grubby fatal error: unable to find a suitable template;

     return NULL;
 }

=============

environment:
vmlinuz-3.10.0-123.13.1.el7.x86_64                     
vmlinuz-3.10.0-123.13.2.el7.x86_64                     
vmlinuz-3.10.0-123.20.1.el7.x86_64                     
vmlinuz-3.10.0-123.9.3.el7.x86_64                      
vmlinuz-3.10.0-123.el7.x86_64                          
[root@vm010004029 ~]# rpm -qa kernel                   
kernel-3.10.0-123.9.3.el7.x86_64                       
kernel-3.10.0-123.13.2.el7.x86_64                      
kernel-3.10.0-123.20.1.el7.x86_64                      
kernel-3.10.0-123.el7.x86_64                           
kernel-3.10.0-123.13.1.el7.x86_64                      
[root@vm010004029 ~]# uname -a                         
Linux vm010004029.first.owlriver.net 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Comment 2 Peter Jones 2015-03-12 19:05:35 UTC
There's debug information for what the template candidates are and such in /var/log/grubby , including the output from the patch you reference from Eric Sandeen.

Comment 3 RHEL Program Management 2015-03-12 19:15:53 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.


Note You need to log in before you can comment on or make changes to this bug.