grub-multi-install fails to find template in some circumstances

Bug #1879948 reported by Balint Harmath
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
High
Unassigned
Focal
Fix Released
High
Unassigned
Groovy
Fix Released
High
Unassigned

Bug Description

[Impact]
Upgrades to focal may fail because debconf cannot find the template.

[Test case]

1. Delete /var/cache/debconf
2. reinstall shim-signed / grub-efi-amd64-signed

[Regression potential]
Other problems asking those questions, and hence failure to install grub.

[Original bug report]

I have just upgraded from Ubuntu 18.04.4 LTS (Bionic Beaver) to Ubuntu 20.04 LTS Focal Fossa.

There is the official graphical way to upgrade. I have used that.
https://ubuntu.com/tutorials/tutorial-upgrading-ubuntu-desktop#1-before-you-start

At the end I had two packages that didn't install - the shim-signed was one of them.
The package number is 1.40.3+15+1533136590.3beb971-0ubuntu1.

I have an AMD64 processor - namely AMD Quad-Core A4-6210.

Error message:
Setting up grub-efi-amd64-signed (1.142+2.04-1ubuntu26) ...
dpkg: error processing package grub-efi-amd64-signed (--configure):
 installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of shim-signed:
 shim-signed depends on grub-efi-amd64-signed | grub-efi-arm64-signed; however:
  Package grub-efi-amd64-signed is not configured yet.
  Package grub-efi-arm64-signed is not installed.

...

E: Sub-process /usr/bin/dpkg returned an error code (1)

affects: ufraw (Ubuntu) → shim-signed (Ubuntu)
Revision history for this message
Steve Langasek (vorlon) wrote :

> installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 10

This error status indicates there is a problem with debconf communication from within this package.

grub-efi-amd64-signed does not invoke debconf itself, but does so via /usr/lib/grub/grub-multi-install.

Can you run 'sudo /usr/lib/grub/grub-multi-install --target=x86_64-efi' manually and see if this command completes successfully?

If it does not, please run 'sudo env DEBCONF_DEBUG=developer /usr/lib/grub/grub-multi-install --target=x86_64-efi' and paste the output.

Changed in shim-signed (Ubuntu):
status: New → Incomplete
Revision history for this message
Balint Harmath (bharmath) wrote :

Thank you for advice!

The matter of the fact is that the command runs, but the upgrade 'sudo apt-get upgrade' returns in error again.

Setting up grub-efi-amd64-signed (1.142+2.04-1ubuntu26) ...
dpkg: error processing package grub-efi-amd64-signed (--configure):
 installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of shim-signed:
 shim-signed depends on grub-efi-amd64-signed | grub-efi-arm64-signed; however:
  Package grub-efi-amd64-signed is not configured yet.
  Package grub-efi-arm64-signed is not installed.

dpkg: error processing package shim-signed (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.

Revision history for this message
Balint Harmath (bharmath) wrote :

For the asked environmental variable value the output is:
sudo env DEBCONF_DEBUG=developer /usr/lib/grub/grub-multi-install --target=x86_64-efi
>debconf (developer): frontend started
>debconf (developer): Trying to find a templates file..
>debconf (developer): Trying /usr/lib/grub/grub-multi-install.templates
>debconf (developer): Trying /usr/share/debconf/templates/grub-multi-install.templates
>debconf (developer): Couldn't find a templates file.
>debconf (developer): frontend running, package name is
>debconf (developer): starting /usr/lib/grub/grub-multi-install --target=x86_64-efi
>debconf (developer): <-- FGET grub-efi/install_devices seen
>debconf (developer): --> 10 grub-efi/install_devices doesn't exist

Revision history for this message
Steve Langasek (vorlon) wrote :

ok, thanks, I was afraid it might be something like this.

Can you also post the output of 'dpkg -l |grep grub' on your system?

affects: shim-signed (Ubuntu) → grub2 (Ubuntu)
Changed in grub2 (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → High
Steve Langasek (vorlon)
Changed in grub2 (Ubuntu Focal):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Balint Harmath (bharmath) wrote :

The asked output is:

$ dpkg -l | grep grub
ii grub-common 2.04-1ubuntu26 amd64 GRand Unified Bootloader (common files)
ii grub-efi-amd64 2.04-1ubuntu26 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 version)
ii grub-efi-amd64-bin 2.04-1ubuntu26 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 modules)
iF grub-efi-amd64-signed 1.142+2.04-1ubuntu26 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 version, signed)
ii grub2-common 2.04-1ubuntu26 amd64 GRand Unified Bootloader (common files for version 2)

tags: added: id-5ec6d132e6344e7db24fa9b7
description: updated
summary: - shim-signed installation focal fossa
+ grub-multi-install fails to find template in some circumstances
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.04-1ubuntu28

---------------
grub2 (2.04-1ubuntu28) groovy; urgency=medium

  * Ensure that grub-multi-install can always find templates (LP: #1879948)
  * Fix changelog entries for security update

 -- Julian Andres Klode <email address hidden> Mon, 10 Aug 2020 15:07:29 +0200

Changed in grub2 (Ubuntu Groovy):
status: Triaged → Fix Released
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Balint, or anyone else affected,

Accepted grub2 into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2/2.04-1ubuntu26.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in grub2 (Ubuntu Focal):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (grub2/2.04-1ubuntu26.3)

All autopkgtests for the newly accepted grub2 (2.04-1ubuntu26.3) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntu-image/1.9+20.04ubuntu1 (arm64)
grubzfs-testsuite/0.4.10 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#grub2

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Julian Andres Klode (juliank) wrote :

focal: Upgraded grub to ubuntu26.3, removed debconf database, and reinstalled shim - worked fine. Removing the db_x_loadtemplatefile line from the script breaks it again, so this fix is good :)

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for grub2 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.04-1ubuntu26.3

---------------
grub2 (2.04-1ubuntu26.3) focal; urgency=medium

  * 2.04-1ubuntu27 and 2.04-1ubuntu28 folded together for focal
  * debian/patches/ubuntu-flavour-order.patch:
    - Add a (hidden) GRUB_FLAVOUR_ORDER setting that can mark certain kernel
      flavours as preferred, and specify an order between those preferred
      flavours (LP: #1882663)
  * debian/patches/ubuntu-zfs-enhance-support.patch:
    - Use version_find_latest for ordering kernels, so it also supports
      the GRUB_FLAVOUR_ORDER setting.
  * debian/patches/ubuntu-dont-verify-loopback-images.patch:
    - disk/loopback: Don't verify loopback images (LP: #1878541),
      Thanks to Chris Coulson for the patch
  * debian/patches/ubuntu-recovery-dis_ucode_ldr.patch
    - Pass dis_ucode_ldr to kernel for recovery mode (LP: #1831789)
  * debian/patches/ubuntu-add-initrd-less-boot-fallback.patch:
    - Merge changes from xnox to fix multiple initrds support (LP: #1878705)
  * debian/patches/ubuntu-clear-invalid-initrd-spacing.patch:
    - Remove, no longer needed thanks to xnox's patch
  * Ensure that grub-multi-install can always find templates (LP: #1879948)

 -- Julian Andres Klode <email address hidden> Mon, 17 Aug 2020 16:04:31 +0200

Changed in grub2 (Ubuntu Focal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.