New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grubby fatal error occurred on fedora-28-minimal #4074

Open
Polygonbugs opened this Issue Jul 13, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@Polygonbugs

Qubes OS version:

R4.0

Affected component(s):

grubby, kernel(?)


Steps to reproduce the behavior:

  1. Install grubby via upgrading template. "sudo dnf upgrade -y".
  2. While installing grubby itself also makes error messages.
  3. Updating template after installing grubby makes continuous error messages.

Expected behavior:

It shouldn't give any error message.

Actual behavior:

It gives following error messages.

grubby fatal error: unable to find a suitable template
grubby: doing this would leave no kernel entries. Not writing out new config.
warning: file /lib/modules/4.16.14-300.fc28.x86_64/updates: remove failed: No such file or directory

Additional Information

Here is more verbose information.

Running transaction
Preparing : 1/1
Running scriptlet: grub2-common-1:2.02-38.fc28.noarch 1/1
Upgrading : grub2-common-1:2.02-38.fc28.noarch 1/74
Installing : libkcapi-1.1.1-1.fc28.x86_64 2/74
Installing : libkcapi-hmaccalc-1.1.1-1.fc28.x86_64 3/74
Upgrading : dracut-048-1.fc28.x86_64 4/74
Installing : kernel-core-4.17.4-200.fc28.x86_64 5/74
Running scriptlet: kernel-core-4.17.4-200.fc28.x86_64 5/74
Upgrading : grub2-tools-minimal-1:2.02-38.fc28.x86_64 6/74
Upgrading : openblas-0.3.1-1.fc28.x86_64 7/74
Running scriptlet: openblas-0.3.1-1.fc28.x86_64 7/74
Upgrading : mesa-libglapi-18.0.5-3.fc28.x86_64 8/74
Running scriptlet: mesa-libglapi-18.0.5-3.fc28.x86_64 8/74
Upgrading : libattr-2.4.48-1.fc28.x86_64 9/74
Upgrading : libacl-2.2.53-1.fc28.x86_64 10/74
Upgrading : grub2-tools-extra-1:2.02-38.fc28.x86_64 11/74
Installing : kernel-modules-4.17.4-200.fc28.x86_64 12/74
Running scriptlet: kernel-modules-4.17.4-200.fc28.x86_64 12/74
Running scriptlet: grub2-tools-1:2.02-38.fc28.x86_64 13/74
Upgrading : grub2-tools-1:2.02-38.fc28.x86_64 13/74
Running scriptlet: grub2-tools-1:2.02-38.fc28.x86_64 13/74
Upgrading : grub2-pc-modules-1:2.02-38.fc28.noarch 14/74
Upgrading : perl-Module-CoreList-1:5.20180626-1.fc28.noarch 15/74
Running scriptlet: openssh-7.7p1-5.fc28.x86_64 16/74
Upgrading : openssh-7.7p1-5.fc28.x86_64 16/74
Upgrading : mesa-libgbm-18.0.5-3.fc28.x86_64 17/74
Running scriptlet: mesa-libgbm-18.0.5-3.fc28.x86_64 17/74
Upgrading : mesa-libEGL-18.0.5-3.fc28.x86_64 18/74
Upgrading : openssh-clients-7.7p1-5.fc28.x86_64 19/74
Upgrading : perl-Module-CoreList-tools-1:5.20180626-1.fc28.noa 20/74
Upgrading : grub2-pc-1:2.02-38.fc28.x86_64 21/74
Installing : kernel-4.17.4-200.fc28.x86_64 22/74
Upgrading : acl-2.2.53-1.fc28.x86_64 23/74
Upgrading : vim-minimal-2:8.1.119-2.fc28.x86_64 24/74
Upgrading : mesa-libGL-18.0.5-3.fc28.x86_64 25/74
Installing : openblas-serial-0.3.1-1.fc28.x86_64 26/74
Upgrading : openblas-threads-0.3.1-1.fc28.x86_64 27/74
Running scriptlet: openblas-threads-0.3.1-1.fc28.x86_64 27/74
Installing : grub2-tools-efi-1:2.02-38.fc28.x86_64 28/74
Upgrading : perl-File-Temp-0.230.600-1.fc28.noarch 29/74
Upgrading : perl-Devel-Size-0.82-1.fc28.x86_64 30/74
Upgrading : pcre2-10.31-5.fc28.x86_64 31/74
Upgrading : openldap-2.4.46-2.fc28.x86_64 32/74
Upgrading : libzstd-1.3.5-1.fc28.x86_64 33/74
Upgrading : libjpeg-turbo-1.5.3-6.fc28.x86_64 34/74
Upgrading : kernel-headers-4.17.4-200.fc28.x86_64 35/74
Upgrading : hwdata-0.313-1.fc28.noarch 36/74
Upgrading : hunspell-en-US-0.20140811.1-12.fc28.noarch 37/74
Upgrading : gdisk-1.0.4-1.fc28.x86_64 38/74
Installing : kernel-devel-4.17.4-200.fc28.x86_64 39/74
Running scriptlet: kernel-devel-4.17.4-200.fc28.x86_64 39/74
Cleanup : grub2-pc-1:2.02-34.fc28.x86_64 40/74
Cleanup : acl-2.2.52-20.fc28.x86_64 41/74
Erasing : kernel-4.16.14-300.fc28.x86_64 42/74
Cleanup : perl-Module-CoreList-tools-1:5.20180420-1.fc28.noa 43/74
Cleanup : grub2-pc-modules-1:2.02-34.fc28.noarch 44/74
Cleanup : perl-Module-CoreList-1:5.20180420-1.fc28.noarch 45/74
Erasing : kernel-devel-4.16.14-300.fc28.x86_64 46/74
Cleanup : perl-File-Temp-0.230.400-396.fc28.noarch 47/74
Cleanup : kernel-headers-4.17.3-200.fc28.x86_64 48/74
Cleanup : hwdata-0.312-1.fc28.noarch 49/74
Cleanup : hunspell-en-US-0.20140811.1-11.fc28.noarch 50/74
Running scriptlet: grub2-tools-1:2.02-34.fc28.x86_64 51/74
Cleanup : grub2-tools-1:2.02-34.fc28.x86_64 51/74
Cleanup : grub2-tools-extra-1:2.02-34.fc28.x86_64 52/74
Cleanup : vim-minimal-2:8.1.119-1.fc28.x86_64 53/74
Cleanup : libacl-2.2.52-20.fc28.x86_64 54/74
Cleanup : mesa-libGL-18.0.5-2.fc28.x86_64 55/74
Cleanup : mesa-libEGL-18.0.5-2.fc28.x86_64 56/74
Cleanup : grub2-tools-minimal-1:2.02-34.fc28.x86_64 57/74
Erasing : kernel-modules-4.16.14-300.fc28.x86_64 58/74
Running scriptlet: kernel-modules-4.16.14-300.fc28.x86_64 58/74
Running scriptlet: kernel-core-4.16.14-300.fc28.x86_64 59/74
grubby fatal error: unable to find a suitable template
grubby: doing this would leave no kernel entries. Not writing out new config.

Erasing : kernel-core-4.16.14-300.fc28.x86_64 59/74
warning: file /lib/modules/4.16.14-300.fc28.x86_64/updates: remove failed: No such file or directory
Cleanup : openssh-clients-7.7p1-4.fc28.x86_64 60/74
Cleanup : grub2-common-1:2.02-34.fc28.noarch 61/74
Cleanup : openssh-7.7p1-4.fc28.x86_64 62/74
Cleanup : dracut-047-8.git20180305.fc28.x86_64 63/74
Cleanup : mesa-libgbm-18.0.5-2.fc28.x86_64 64/74
Running scriptlet: mesa-libgbm-18.0.5-2.fc28.x86_64 64/74
Cleanup : mesa-libglapi-18.0.5-2.fc28.x86_64 65/74
Running scriptlet: mesa-libglapi-18.0.5-2.fc28.x86_64 65/74
Cleanup : libattr-2.4.47-23.fc28.x86_64 66/74
Cleanup : perl-Devel-Size-0.81-2.fc28.x86_64 67/74
Cleanup : pcre2-10.31-4.fc28.x86_64 68/74
Cleanup : openldap-2.4.46-1.fc28.x86_64 69/74
Cleanup : openblas-threads-0.3.0-1.fc28.x86_64 70/74
Running scriptlet: openblas-threads-0.3.0-1.fc28.x86_64 70/74
Cleanup : openblas-0.3.0-1.fc28.x86_64 71/74
Running scriptlet: openblas-0.3.0-1.fc28.x86_64 71/74
Cleanup : libzstd-1.3.4-1.fc28.x86_64 72/74
Cleanup : libjpeg-turbo-1.5.3-5.fc28.x86_64 73/74
Cleanup : gdisk-1.0.3-6.fc28.x86_64 74/74
Running scriptlet: kernel-core-4.17.4-200.fc28.x86_64 74/74
grubby fatal error: unable to find a suitable template
grubby fatal error: unable to find a suitable template
grubby: doing this would leave no kernel entries. Not writing out new config.

Running scriptlet: gdisk-1.0.3-6.fc28.x86_64 74/74

@Aekez

This comment has been minimized.

Show comment
Hide comment
@Aekez

Aekez Jul 13, 2018

Two clues here make me curious, you mention the use of -y, and also grubby is currently included in the "dnf autoremove". Did you by any chance run -y on autoremove at any point of time? or force the update/upgrade?

Last metadata expiration check: 0:05:42 ago on Fri Jul 13 18:08:58 2018.
Dependencies resolved.
================================================================================
 Package               Arch         Version                Repository      Size
================================================================================
Removing:
 gnupg                 x86_64       1.4.23-1.fc28          @updates       5.4 M
 grub2-tools-efi       x86_64       1:2.02-38.fc28         @updates       1.9 M
 grubby                x86_64       8.40-11.fc28           @fedora        123 k
 libusb                x86_64       1:0.1.5-12.fc28        @fedora         67 k

Transaction Summary
================================================================================
Remove  4 Packages

Freed space: 7.5 M
Is this ok [y/N]:

Could you try make a new copy of the minimal template, and try without autoremoval or force replacing updates?

Aekez commented Jul 13, 2018

Two clues here make me curious, you mention the use of -y, and also grubby is currently included in the "dnf autoremove". Did you by any chance run -y on autoremove at any point of time? or force the update/upgrade?

Last metadata expiration check: 0:05:42 ago on Fri Jul 13 18:08:58 2018.
Dependencies resolved.
================================================================================
 Package               Arch         Version                Repository      Size
================================================================================
Removing:
 gnupg                 x86_64       1.4.23-1.fc28          @updates       5.4 M
 grub2-tools-efi       x86_64       1:2.02-38.fc28         @updates       1.9 M
 grubby                x86_64       8.40-11.fc28           @fedora        123 k
 libusb                x86_64       1:0.1.5-12.fc28        @fedora         67 k

Transaction Summary
================================================================================
Remove  4 Packages

Freed space: 7.5 M
Is this ok [y/N]:

Could you try make a new copy of the minimal template, and try without autoremoval or force replacing updates?

@Polygonbugs

This comment has been minimized.

Show comment
Hide comment
@Polygonbugs

Polygonbugs Jul 14, 2018

Yes, I always use "sudo dnf check-update" and "sudo dnf upgrade -y && sudo dnf autoremove -y && sudo dnf clean all && sudo fstrim -v /" to upgrade template. It seems like I accidentally remove grubby by using autoremove. I'll try fresh minimal template later as you suggested.

Yes, I always use "sudo dnf check-update" and "sudo dnf upgrade -y && sudo dnf autoremove -y && sudo dnf clean all && sudo fstrim -v /" to upgrade template. It seems like I accidentally remove grubby by using autoremove. I'll try fresh minimal template later as you suggested.

@Polygonbugs

This comment has been minimized.

Show comment
Hide comment
@Polygonbugs

Polygonbugs Jul 14, 2018

No, still I can see "grubby fatal error : unable to find suitable template" on first update when issuing [bash-4.4]# dnf update -y && dnf clean all from fresh fedora-28-minimal. I can't find other error yet.

Polygonbugs commented Jul 14, 2018

No, still I can see "grubby fatal error : unable to find suitable template" on first update when issuing [bash-4.4]# dnf update -y && dnf clean all from fresh fedora-28-minimal. I can't find other error yet.

@Aekez

This comment has been minimized.

Show comment
Hide comment
@Aekez

Aekez Jul 14, 2018

ow, too bad. Maybe we can try something else to cast more light on the issue.

1) Did you download the newest template version? Which template version are you running? The thinking here is that my fedora-28-minimal doesn't get the grubby bug, so perhaps there is a version difference. You can see my version listed down below. Try compare it with your own version to see if there is a difference. Also this is the current same version that should be in the ITL Template repository atm, which can also be browsed here https://yum.qubes-os.org/r4.0/templates-itl/rpm/ so it's pretty likely you got this version as well if you just re-installed the template by freshly downloading it. But just to be sure, try compare the version.

[user@dom0 ~ ]$ rpm -qa qubes-template-fedora-28-minimal
qubes-template-fedora-28-minimal-4.0.0-201805212212.noarch

I wish I could quickly re-install the minimal template to try it again and see if I can encounter the same error as you do, since my template is already fully updated, so it won't serve well to try reproducing your steps.

2) Something else you can try is to compare your grubby version with my fedora-28-minimal grubby version (fully updated atm).

[user@fedora-28-minimal ~]$ rpm -qa grubby
grubby-8.40-11.fc28.x86_64

3) This one is a long-shot. But there may be a difference in running "sudo dnf update" and "dnf update" in the minimal template. Below is the lines I use in my autonomouse template update-script for comparison. I'm currently building the script, that's why it has both "-u root" and "sudo" redudancy, but this is what I used at the time when I was tweaking the script to minimal updates (and forgot to remove sudo), so it may be worth a try if you got time to try trial and errors.

Essentially it could be how you run the commands, try use these two in a script instead.

#!/bin/bash
### Executed from dom0, or alternatively run it from a VM with proper Qubes-RPC (Policies) adjustments.
qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf update --refresh'"
qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf upgrade'"

Also, this part might possibly be slightly off-topic, but while at it try notice how I skip the --clean option, and instead go fo the --refresh option, and I only use it once at the first step. This also removes any risk for repository changes between your two commands, so only running it once is not only faster saving you time, it's also safer, imho.

While it turns out this isn't the case for your grubby, I would still recommend you to avoid using autoremoval in general, especially with the -y argument. There are multiple searchable stories on the internet of people loosing their system/app stability, or even being fully unable to boot, breaking their system, after they ran autoremove. It's probably less harmful to just let them stay, if they're not being used then they probably won't do much else than taking up disk space anyway, and usually it's minor disk space. I'm no expert on this though, however I do believe its much safer to just ignore them, rather than using autoremove. Alternatively you could also try look up the package dependencies yourself.

Aekez commented Jul 14, 2018

ow, too bad. Maybe we can try something else to cast more light on the issue.

1) Did you download the newest template version? Which template version are you running? The thinking here is that my fedora-28-minimal doesn't get the grubby bug, so perhaps there is a version difference. You can see my version listed down below. Try compare it with your own version to see if there is a difference. Also this is the current same version that should be in the ITL Template repository atm, which can also be browsed here https://yum.qubes-os.org/r4.0/templates-itl/rpm/ so it's pretty likely you got this version as well if you just re-installed the template by freshly downloading it. But just to be sure, try compare the version.

[user@dom0 ~ ]$ rpm -qa qubes-template-fedora-28-minimal
qubes-template-fedora-28-minimal-4.0.0-201805212212.noarch

I wish I could quickly re-install the minimal template to try it again and see if I can encounter the same error as you do, since my template is already fully updated, so it won't serve well to try reproducing your steps.

2) Something else you can try is to compare your grubby version with my fedora-28-minimal grubby version (fully updated atm).

[user@fedora-28-minimal ~]$ rpm -qa grubby
grubby-8.40-11.fc28.x86_64

3) This one is a long-shot. But there may be a difference in running "sudo dnf update" and "dnf update" in the minimal template. Below is the lines I use in my autonomouse template update-script for comparison. I'm currently building the script, that's why it has both "-u root" and "sudo" redudancy, but this is what I used at the time when I was tweaking the script to minimal updates (and forgot to remove sudo), so it may be worth a try if you got time to try trial and errors.

Essentially it could be how you run the commands, try use these two in a script instead.

#!/bin/bash
### Executed from dom0, or alternatively run it from a VM with proper Qubes-RPC (Policies) adjustments.
qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf update --refresh'"
qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf upgrade'"

Also, this part might possibly be slightly off-topic, but while at it try notice how I skip the --clean option, and instead go fo the --refresh option, and I only use it once at the first step. This also removes any risk for repository changes between your two commands, so only running it once is not only faster saving you time, it's also safer, imho.

While it turns out this isn't the case for your grubby, I would still recommend you to avoid using autoremoval in general, especially with the -y argument. There are multiple searchable stories on the internet of people loosing their system/app stability, or even being fully unable to boot, breaking their system, after they ran autoremove. It's probably less harmful to just let them stay, if they're not being used then they probably won't do much else than taking up disk space anyway, and usually it's minor disk space. I'm no expert on this though, however I do believe its much safer to just ignore them, rather than using autoremove. Alternatively you could also try look up the package dependencies yourself.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 15, 2018

Member

Can you simply remove grubby? As seen above dnf autoremove would do that (which means it isn't required by anything installed). The grubby+grub2 idea is utterly broken, it tries to edit grub2.cfg file, which is a generated file and changes there would be overridden anyway. It isn't needed to install a kernel, nor configure grub (grub comes with its own configuration generator - grub2-mkconfig).

Member

marmarek commented Jul 15, 2018

Can you simply remove grubby? As seen above dnf autoremove would do that (which means it isn't required by anything installed). The grubby+grub2 idea is utterly broken, it tries to edit grub2.cfg file, which is a generated file and changes there would be overridden anyway. It isn't needed to install a kernel, nor configure grub (grub comes with its own configuration generator - grub2-mkconfig).

@Polygonbugs

This comment has been minimized.

Show comment
Hide comment
@Polygonbugs

Polygonbugs Jul 15, 2018

@Aekez
Here are answer of your questions 1),2),3)
(1)

[user@dom0 ~ ]$ rpm -qa qubes-template-fedora-28-minimal
qubes-template-fedora-28-minimal-4.0.0-2018052112212.noarch

I think we are using identical version of fedora-28-minimal.

(2)

[user@fedora-28-minimal-clone-1 ~]$ rpm -qa grubby
grubby-8.40-11.fc28.x86_64

Same as well

(3)
Sorry, I don't understand what is difference between two commands, qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf update --refresh'" and qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf upgrade'". Also I don't understand the difference between adding sudo next to the commands vs commands issued by root account.


@marmarek ,
Grubby successfully removed (as well as grub2-tools-efi) by autoremove command. Let's see if next update give error messages

@Aekez
Here are answer of your questions 1),2),3)
(1)

[user@dom0 ~ ]$ rpm -qa qubes-template-fedora-28-minimal
qubes-template-fedora-28-minimal-4.0.0-2018052112212.noarch

I think we are using identical version of fedora-28-minimal.

(2)

[user@fedora-28-minimal-clone-1 ~]$ rpm -qa grubby
grubby-8.40-11.fc28.x86_64

Same as well

(3)
Sorry, I don't understand what is difference between two commands, qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf update --refresh'" and qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf upgrade'". Also I don't understand the difference between adding sudo next to the commands vs commands issued by root account.


@marmarek ,
Grubby successfully removed (as well as grub2-tools-efi) by autoremove command. Let's see if next update give error messages

@Aekez

This comment has been minimized.

Show comment
Hide comment
@Aekez

Aekez Jul 15, 2018

Grubby successfully removed (as well as grub2-tools-efi) by autoremove command. Let's see if next update give error messages

Marek seem to have nailed it, so that definitely sounds like a plan. It might only happen the next time you get a kernel update though? So it'll probably be whenever fedora puts out a new kernel version.


Sorry, I don't understand what is difference between two commands, qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf update --refresh'" and qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf upgrade'". Also I don't understand the difference between adding sudo next to the commands vs commands issued by root account.

I'm more than happy to help answer and discuss this as I also find it interesting and I'm happy to help too, but it might go off-topic here. If you would like to discuss running these commands, i.e. in a shell or even a more advanced bash script to make updating easier, then your more than welcome to open an issue over at the volunteer-run independent Qubes Community Collaboration (QCC) https://github.com/Qubes-Community/Contents/issues I'll continue the discussion with you there if you choose to open an issue.

So if you got everyday user questions the Qubes-user mailing list is best https://groups.google.com/forum/#!forum/qubes-users, but if you got questions or suggestions related to scripts, code or Qubes docs, which doesn't fit the official QubesOS GitHub development focus, then you can always open an issue to discuss it over at QCC which is more focused on the minor things and user experiences, with docs and code (typically scripts) :)

Aekez commented Jul 15, 2018

Grubby successfully removed (as well as grub2-tools-efi) by autoremove command. Let's see if next update give error messages

Marek seem to have nailed it, so that definitely sounds like a plan. It might only happen the next time you get a kernel update though? So it'll probably be whenever fedora puts out a new kernel version.


Sorry, I don't understand what is difference between two commands, qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf update --refresh'" and qvm-run -u root fedora-28-minimal "xterm -e 'sudo dnf upgrade'". Also I don't understand the difference between adding sudo next to the commands vs commands issued by root account.

I'm more than happy to help answer and discuss this as I also find it interesting and I'm happy to help too, but it might go off-topic here. If you would like to discuss running these commands, i.e. in a shell or even a more advanced bash script to make updating easier, then your more than welcome to open an issue over at the volunteer-run independent Qubes Community Collaboration (QCC) https://github.com/Qubes-Community/Contents/issues I'll continue the discussion with you there if you choose to open an issue.

So if you got everyday user questions the Qubes-user mailing list is best https://groups.google.com/forum/#!forum/qubes-users, but if you got questions or suggestions related to scripts, code or Qubes docs, which doesn't fit the official QubesOS GitHub development focus, then you can always open an issue to discuss it over at QCC which is more focused on the minor things and user experiences, with docs and code (typically scripts) :)

@Polygonbugs

This comment has been minimized.

Show comment
Hide comment
@Polygonbugs

Polygonbugs Jul 19, 2018

Now I can't find any issue after removing grubby. Kernel update (though actually not needed) doesn't give error message.

Now I can't find any issue after removing grubby. Kernel update (though actually not needed) doesn't give error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment