Regression: users are prompted on upgrade of cloud images

Bug #1747464 reported by Robie Basak
This bug affects 14 people
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

Steps to reproduce (use case):

1. Fire up a Bionic cloud image (I used 20180124)
2. Run: sudo apt-get update && sudo apt-get -y dist-upgrade

Expected results: completes without prompts.

Actual results: prompts the user for input to resolve a "manually" changed /boot/grub/menu.lst.

Steps to reproduce (developer):

1. Fire up a Bionic cloud image (I used 20180124)
2. Run "sudo update-grub-legacy-ec2"

As you don't even need to upgrade to reproduce, it seems to me that the cloud image build is hacking menu.lst in a way that breaks update-grub-legacy-ec2. This time it seems to be a whitespace issue.

User impact: this messes up automation; it is a common use of cloud images for users to automate their server deployments which generally involves running a dist-upgrade and then bootstrapping some kind of configuration management system.

Workaround: users can use something like: apt-get update && UCF_FORCE_CONFOLD=1 apt-get -y dist-upgrade. Note that to avoid prompts in various other cases users should also set DEBIAN_FRONTEND=noninteractive, run apt-get with -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" and consider redirecting stdin from /dev/null.


This has happened multiple times before. Please put CI in place to avoid this regressing again. See bug 1485685, bug 1581044, bug 1581046 and bug 1323772.

Robie Basak (racb)
summary: - Users are prompted on upgrade of cloud images
+ Regression: users are prompted on upgrade of cloud images
Changed in cloud-images:
status: New → Triaged
tags: added: id-5a81ebf979b1f510227d9dfc
Dan Watkins (oddbloke)
Changed in cloud-images:
importance: Undecided → High
Revision history for this message
Jesse Steele (jessesteele) wrote :

Ubuntu-devel-discuss Digest, Vol 144, Issue 13 responded that my problem could be caused by this bug. It would be Ubuntu 18.04 on DigitalOcean, the symptom being that apt updates were attempting to overwrite php.ini and asking about GRUB. I have no more information, this is FYI, feel free to close.

no longer affects: ubuntu
Revision history for this message
Josh Goodall (joshua-goodall) wrote :

still a pain in the *** every ***ing kernel bump on ec2

Revision history for this message
Scott (scottschreckengaust) wrote :

The only thing that has helped without interaction is thus far is from this comment <>:

sudo apt-get -y update;
sudo apt-get -y upgrade;
sudo rm /boot/grub/menu.lst
sudo update-grub-legacy-ec2 -y
sudo apt-get -y dist-upgrade;

Revision history for this message
Bryce Harrington (bryce) wrote :

Many packages uses ucf to identify config changes, which can trigger prompts like this during upgrade. In theory these are to prevent overwriting local changes, but in practice there can be false-positives depending on how the package implements ucf. In the case of openssh, for example, it uses a list of md5sums of "known stock" config files to clue itself in on ignorable changes (see LP: #1861472).

In the case of grub the logic is a lot more complex, although it's still using ucf to do it, so that's likely where adjustments to the logic would need to be made:

It would obviously be an improvement if somehow ucf could ignore changes in comments and whitespace, for instance. See LP: #1861472 for some additional thoughts.

Revision history for this message
Joshua Powers (powersj) wrote :

Hi, going through old bugs right now.

grub-legacy-ec2 was removed from Bionic EC2 images and therefore, this should no longer occur. Focal and newer releases will never have grub-legacy-ec2 shipped with those images, so they would also not be affected.

I am going to mark this fix-released, but if someone finds an issue using a cloud image dated after 20200730, then please do let us know.


Changed in cloud-images:
status: Triaged → 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.