Fixing fsfreeze-hook can break unattended upgrades
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qemu (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
unattended-upgrades (Ubuntu) |
Fix Released
|
High
|
Balint Reczey | ||
Trusty |
Confirmed
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Balint Reczey | ||
Bionic |
Fix Released
|
High
|
Balint Reczey | ||
Cosmic |
Fix Released
|
High
|
Balint Reczey | ||
Disco |
Fix Released
|
High
|
Unassigned |
Bug Description
[Impact]
* If an update has a new conffile at a path that in a former version was
a directory like
old: /a/b/c
new: a/b
Here b is the new file name and was a directory in the old version.
Then unattended upgrades breaks on installing such a package.
* a recent qemu update has such a case and due to that triggered the
issue in >=Bionic
* The fix is to harden unattended upgrades to be able to handle the case
without aborting.
[Test Case]
Get a qemu guest e.g. of Bionic before the update to 1:2.11+
That can be done with:
$ time uvt-simplestrea
$ uvt-kvm create --password ubuntu bionic-testuu arch=amd64 release=bionic label=daily
Log in and apt update & upgrade all packages, then Install the release level qemu in there.
$ uvt-kvm ssh bionic-testuu
$ sudo apt update
$ sudo apt dist-upgrade
$ sudo apt install unattended-upgrades
$ sudo apt install qemu-guest-
All before was preparation, now force the unattended upgrade to trigger the bug.
$ sudo unattended-upgrade -d
With the bug you'll find some error like:
found pkg: qemu-guest-agent
conffile line: /etc/init.
current md5: f61a64ac1e48993
conffile line: /etc/qemu/
/etc/qemu/
/etc/qemu/
found conffile /etc/qemu/
Traceback (most recent call last):
File "/usr/bin/
sys.
File "/usr/bin/
if conffile_
File "/usr/bin/
with open(prefix + conf_file, 'rb') as fp:
IsADirectoryError: [Errno 21] Is a directory: '/etc/qemu/
[Regression Potential]
* The fix is trying to detect moved conffiles by looking for /etc/foo/foo when the new package ships /etc/foo and /etc/foo is not a known conffile and also checking the renames in the opposite direction.
The potential regression is breaking the logic for detecting changed conffiles and either holding back a package for no reason or trying to install a package with a modified conffile on the system and aborting the upgrade in the middle due to the appearing conffile prompt. To avoid such regressions the test_conffile.py tests are extended to cover rename scenarios.
[Other Info]
* n/a
---
As reported on https:/
We fixed an issue and we added workrounds since basic mv_conffile coudn't handle it and did all sort of upgrade tests.
That all worked fine and moved the conffile.
It was now reported that due to some pre-checks that unattended upgrades might do this might do some checks on its own.
Next step:
- check unattended upgrades through this change
- check if it only affects cases were the former config was modified (minority) or the default file layout (majority)
--- original report copied ---
just wanted to add: This bug also crashes unattended-upgrade and thus prevents security updates on 18.04:
root@mailin1:~# unattended-upgrade
Traceback (most recent call last):
File "/usr/bin/
sys.
File "/usr/bin/
if conffile_
File "/usr/bin/
with open(prefix + conf_file, 'rb') as fp:
IsADirectoryError: [Errno 21] Is a directory: '/etc/qemu/
Basically, unattended-upgrade wants to compare old/new conffiles and doesn't like it when the old conffile turns out to be a directory...
This prevents security updates to be installed. The unattended-upgrade logs do not contain the trace, only the messages:
2019-04-05 13:24:24,851 INFO Initial blacklisted packages:
2019-04-05 13:24:24,853 INFO Initial whitelisted packages:
2019-04-05 13:24:24,853 INFO Starting unattended upgrades script
2019-04-05 13:24:24,854 INFO Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,
And that's it.
You can't really get out of this without manually running 'apt-get install qemu-guest-agent' because at this point, unattended-upgrade can't update itself anymore.
description: | updated |
tags: | added: id-5caddb1e34438017500c9b85 |
Changed in unattended-upgrades (Ubuntu): | |
status: | Confirmed → Fix Committed |
description: | updated |
Changed in unattended-upgrades (Ubuntu Disco): | |
importance: | Undecided → High |
Changed in unattended-upgrades (Ubuntu): | |
importance: | Undecided → High |
no longer affects: | qemu (Ubuntu) |
information type: | Public → Public Security |
tags: | added: patch |
Changed in unattended-upgrades (Ubuntu Trusty): | |
assignee: | Balint Reczey (rbalint) → nobody |
Fix might be in qemu (add even more special cases) or in unattended upgrades (to properly handle or at least not die). Added a bug task for that.