unattended-upgrades fails if a package has a conffile prompt

Bug #2063268 reported by Andrew Lowther
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
Triaged
Medium
Unassigned

Bug Description

unattended-upgrades will fail if a package has a conffile prompt. This is unusual for a new install, but recently became an issue for me because of changes to the ubuntu-advantage-tools packages. Specifically, uu logged issues with the package ubuntu-pro-client.

In older versions of subiquity, an unattended-upgrades failure will cause subiquity to crash and the install to fail. That no longer appears to be case in newer releases of subiquity. I think because of this commit
https://github.com/canonical/subiquity/commit/800a1e9372f23591b504afa211da7e3cbe30b788

According to the unattended-upgrades source, a failure exit-code is expected if a package has a conffile prompt. Based on the comment at https://github.com/mvo5/unattended-upgrades/blob/7bf3aa52af1c6b11c031d0949f223c1beb94f84c/unattended-upgrade#L2597

    # Was the overall run succesful: only if everything installed
    # fine and nothing was held back because of a conffile prompt.

A potential simple solution would be to append to /etc/apt/apt.conf.d/zzzz-temp-installer-unattended-upgrade
Dpkg::Options::="--force-confold"

An argument could be made for "--force-confnew" instead, but subiquity is already using "--force-confold" when installing packages individually.
https://github.com/canonical/subiquity/blob/dbcf72367606559e7dae530197e4e0694afa63d3/subiquity/server/pkghelper.py#L84

I believe this will work because the unattended-upgrades source checks for these options and will not "blacklist" any packages if present. However, I have not tested to verify.
https://github.com/mvo5/unattended-upgrades/blob/7bf3aa52af1c6b11c031d0949f223c1beb94f84c/unattended-upgrade#L1536

These are some of the logs generated by subiquity when uu fails during an Ubuntu 22.04 install.

Apr 12 22:19:36 ubuntu-server subiquity_log.1234[10785]: check_conffile_prompt(/var/cache/apt/archives/ubuntu-pro-client_31.2~22.04_amd64.deb)
Apr 12 22:19:36 ubuntu-server subiquity_log.1234[10785]: Package ubuntu-pro-client has conffile prompt and needs to be upgraded manually
Apr 12 22:19:36 ubuntu-server subiquity_log.1234[10785]: Package ubuntu-pro-client has conffile prompt and needs to be upgraded manually
...
Apr 12 22:19:37 ubuntu-server subiquity_log.1234[10785]: Packages blacklist due to conffile prompts: ['ubuntu\\-pro\\-client$']
...
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10785]: Packages that are kept back:
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10785]: InstCount=0 DelCount=0 BrokenCount=0
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10785]: Package python3-update-manager has a higher version available, checking if it is from an allowed origin and is not pinned down.
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10785]: Package python3-update-manager is kept back because a related package is kept back or due to local apt_preferences(5).
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10785]: Package ubuntu-advantage-tools has a higher version available, checking if it is from an allowed origin and is not pinned down.
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10785]: Package ubuntu-advantage-tools is kept back because a related package is kept back or due to local apt_preferences(5).
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10785]: Package update-manager-core has a higher version available, checking if it is from an allowed origin and is not pinned down.
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10785]: Package update-manager-core is kept back because a related package is kept back or due to local apt_preferences(5).
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10785]: Extracting content from /var/log/unattended-upgrades/unattended-upgrades-dpkg.log since 2024-04-12 22:18:35
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10774]: Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
...
Apr 12 22:45:55 ubuntu-server subiquity_log.1234[10774]: finish: cmd-in-target: FAIL: curtin command in-target

description: updated
description: updated
Olivier Gayot (ogayot)
Changed in subiquity:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Andrew Lowther (alowther) wrote :

Updated patch file. The one I attached before had a typo, so I went back and copied the formatting from unattended-upgrades

https://github.com/mvo5/unattended-upgrades/blob/7bf3aa52af1c6b11c031d0949f223c1beb94f84c/README.md?plain=1#L265

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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