I only have a testcase for Bionic, I hope rbalint has one for the other
releases.


root@b:~# apt list --upgradable
Listing... Done
qemu-guest-agent/bionic-updates,bionic-security 1:2.11+dfsg-1ubuntu7.12 amd64 
[upgradable from: 1:2.11+dfsg-1ubuntu7]
N: There is 1 additional version. Please use the '-a' switch to see it
root@b:~# 
root@b:~# 
root@b:~# sudo unattended-upgrade -d
Initial blacklisted packages: 
Initial whitelisted packages: 
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, 
o=UbuntuESM,a=bionic
Using 
(^linux-image-[0-9]+\.[0-9\.]+-.*|^linux-headers-[0-9]+\.[0-9\.]+-.*|^linux-image-extra-[0-9]+\.[0-9\.]+-.*|^linux-modules-[0-9]+\.[0-9\.]+-.*|^linux-modules-extra-[0-9]+\.[0-9\.]+-.*|^linux-signed-image-[0-9]+\.[0-9\.]+-.*|^kfreebsd-image-[0-9]+\.[0-9\.]+-.*|^kfreebsd-headers-[0-9]+\.[0-9\.]+-.*|^gnumach-image-[0-9]+\.[0-9\.]+-.*|^.*-modules-[0-9]+\.[0-9\.]+-.*|^.*-kernel-[0-9]+\.[0-9\.]+-.*|^linux-backports-modules-.*-[0-9]+\.[0-9\.]+-.*|^linux-modules-.*-[0-9]+\.[0-9\.]+-.*|^linux-tools-[0-9]+\.[0-9\.]+-.*|^linux-cloud-tools-[0-9]+\.[0-9\.]+-.*)
 regexp to find kernel packages
Using 
(^linux-image-4\.15\.0\-48\-generic$|^linux-headers-4\.15\.0\-48\-generic$|^linux-image-extra-4\.15\.0\-48\-generic$|^linux-modules-4\.15\.0\-48\-generic$|^linux-modules-extra-4\.15\.0\-48\-generic$|^linux-signed-image-4\.15\.0\-48\-generic$|^kfreebsd-image-4\.15\.0\-48\-generic$|^kfreebsd-headers-4\.15\.0\-48\-generic$|^gnumach-image-4\.15\.0\-48\-generic$|^.*-modules-4\.15\.0\-48\-generic$|^.*-kernel-4\.15\.0\-48\-generic$|^linux-backports-modules-.*-4\.15\.0\-48\-generic$|^linux-modules-.*-4\.15\.0\-48\-generic$|^linux-tools-4\.15\.0\-48\-generic$|^linux-cloud-tools-4\.15\.0\-48\-generic$)
 regexp to find running kernel packages
Checking: qemu-guest-agent ([<Origin component:'universe' 
archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' 
site:'archive.ubuntu.com' isTrusted:True>, <Origin component:'universe' 
archive:'bionic-security' origin:'Ubuntu' label:'Ubuntu' 
site:'security.ubuntu.com' isTrusted:True>])
pkgs that look like they should be upgraded: qemu-guest-agent
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 
qemu-guest-agent amd64 1:2.11+dfsg-1ubuntu7.12 [232 kB]                         
                                        
Fetched 232 kB in 0s (0 B/s)                                                    
                                                                                
                             
fetch.run() result: 0
<apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 0 IsTrusted: 1 
FileSize: 232116 
DestFile:'/var/cache/apt/archives/qemu-guest-agent_1%3a2.11+dfsg-1ubuntu7.12_amd64.deb'
 DescURI: 
'http://archive.ubuntu.com/ubuntu/pool/universe/q/qemu/qemu-guest-agent_2.11+dfsg-1ubuntu7.12_amd64.deb'
 ID:1 ErrorText: ''>
check_conffile_prompt(/var/cache/apt/archives/qemu-guest-agent_1%3a2.11+dfsg-1ubuntu7.12_amd64.deb)
found pkg: qemu-guest-agent
conffile line: /etc/init.d/qemu-guest-agent f61a64ac1e48993023018fd1cff85191
current md5: f61a64ac1e48993023018fd1cff85191
conffile line: /etc/qemu/fsfreeze-hook/fsfreeze-hook 
15f6ff42cbc5550a07ee21c2a471d905
/etc/qemu/fsfreeze-hook/fsfreeze-hook not in package conffiles 
/etc/init.d/qemu-guest-agent
/etc/qemu/fsfreeze-hook
found conffile /etc/qemu/fsfreeze-hook in new pkg but on dpkg status
Traceback (most recent call last):
  File "/usr/bin/unattended-upgrade", line 2057, in <module>
    sys.exit(main(options))
  File "/usr/bin/unattended-upgrade", line 1773, in main
    if conffile_prompt(item.destfile):
  File "/usr/bin/unattended-upgrade", line 988, in conffile_prompt
    with open(prefix + conf_file, 'rb') as fp:
IsADirectoryError: [Errno 21] Is a directory: '/etc/qemu/fsfreeze-hook'

That is good, it means that the error is affecting this system.
After installing the new unattended upgrades from proposed this works fine now:

root@b:~# apt list --upgradable
Listing... Done
qemu-guest-agent/bionic-updates,bionic-security 1:2.11+dfsg-1ubuntu7.12 amd64 
[upgradable from: 1:2.11+dfsg-1ubuntu7]
N: There is 1 additional version. Please use the '-a' switch to see it
root@b:~# sudo unattended-upgrade -d
Initial blacklisted packages: 
Initial whitelisted packages: 
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, 
o=UbuntuESM,a=bionic
Using 
(^linux-image-[0-9]+\.[0-9\.]+-.*|^linux-headers-[0-9]+\.[0-9\.]+-.*|^linux-image-extra-[0-9]+\.[0-9\.]+-.*|^linux-modules-[0-9]+\.[0-9\.]+-.*|^linux-modules-extra-[0-9]+\.[0-9\.]+-.*|^linux-signed-image-[0-9]+\.[0-9\.]+-.*|^kfreebsd-image-[0-9]+\.[0-9\.]+-.*|^kfreebsd-headers-[0-9]+\.[0-9\.]+-.*|^gnumach-image-[0-9]+\.[0-9\.]+-.*|^.*-modules-[0-9]+\.[0-9\.]+-.*|^.*-kernel-[0-9]+\.[0-9\.]+-.*|^linux-backports-modules-.*-[0-9]+\.[0-9\.]+-.*|^linux-modules-.*-[0-9]+\.[0-9\.]+-.*|^linux-tools-[0-9]+\.[0-9\.]+-.*|^linux-cloud-tools-[0-9]+\.[0-9\.]+-.*)
 regexp to find kernel packages
Using 
(^linux-image-4\.15\.0\-48\-generic$|^linux-headers-4\.15\.0\-48\-generic$|^linux-image-extra-4\.15\.0\-48\-generic$|^linux-modules-4\.15\.0\-48\-generic$|^linux-modules-extra-4\.15\.0\-48\-generic$|^linux-signed-image-4\.15\.0\-48\-generic$|^kfreebsd-image-4\.15\.0\-48\-generic$|^kfreebsd-headers-4\.15\.0\-48\-generic$|^gnumach-image-4\.15\.0\-48\-generic$|^.*-modules-4\.15\.0\-48\-generic$|^.*-kernel-4\.15\.0\-48\-generic$|^linux-backports-modules-.*-4\.15\.0\-48\-generic$|^linux-modules-.*-4\.15\.0\-48\-generic$|^linux-tools-4\.15\.0\-48\-generic$|^linux-cloud-tools-4\.15\.0\-48\-generic$)
 regexp to find running kernel packages
Checking: qemu-guest-agent ([<Origin component:'universe' 
archive:'bionic-updates' origin:'Ubuntu' label:'Ubuntu' 
site:'archive.ubuntu.com' isTrusted:True>, <Origin component:'universe' 
archive:'bionic-security' origin:'Ubuntu' label:'Ubuntu' 
site:'security.ubuntu.com' isTrusted:True>])
pkgs that look like they should be upgraded: qemu-guest-agent
Fetched 0 B in 0s (0 B/s)                                                       
                                                                                
                             
fetch.run() result: 0
<apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 
FileSize: 232116 
DestFile:'/var/cache/apt/archives/qemu-guest-agent_1%3a2.11+dfsg-1ubuntu7.12_amd64.deb'
 DescURI: 
'http://archive.ubuntu.com/ubuntu/pool/universe/q/qemu/qemu-guest-agent_2.11+dfsg-1ubuntu7.12_amd64.deb'
 ID:0 ErrorText: ''>
check_conffile_prompt(/var/cache/apt/archives/qemu-guest-agent_1%3a2.11+dfsg-1ubuntu7.12_amd64.deb)
found pkg: qemu-guest-agent
conffile line: /etc/init.d/qemu-guest-agent f61a64ac1e48993023018fd1cff85191
current md5: f61a64ac1e48993023018fd1cff85191
conffile line: /etc/qemu/fsfreeze-hook/fsfreeze-hook 
15f6ff42cbc5550a07ee21c2a471d905
current md5: 15f6ff42cbc5550a07ee21c2a471d905
blacklist: []
whitelist: []
Packages that will be upgraded: qemu-guest-agent
Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
applying set ['qemu-guest-agent']
(Reading database ... 47684 files and directories currently installed.)
Preparing to unpack .../qemu-guest-agent_1%3a2.11+dfsg-1ubuntu7.12_amd64.deb ...
Unpacking qemu-guest-agent (1:2.11+dfsg-1ubuntu7.12) over 
(1:2.11+dfsg-1ubuntu7) ...
Processing triggers for ureadahead (0.100.0-21) ...
Setting up qemu-guest-agent (1:2.11+dfsg-1ubuntu7.12) ...
Processing triggers for systemd (237-3ubuntu10.21) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
left to upgrade set()
All upgrades installed
InstCount=0 DelCount=0 BrokenCount=0
Extracting content from 
/var/log/unattended-upgrades/unattended-upgrades-dpkg.log since 2019-04-30 
11:16:20
root@b:~# apt list --upgradable
Listing... Done


Setting Bionic to verified.

** Tags removed: verification-needed-bionic
** Tags added: verification-done-bionic

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to unattended-upgrades in
Ubuntu.
https://bugs.launchpad.net/bugs/1823872

Title:
  Fixing fsfreeze-hook can break unattended upgrades

Status in qemu package in Ubuntu:
  Invalid
Status in unattended-upgrades package in Ubuntu:
  Fix Released
Status in unattended-upgrades source package in Trusty:
  New
Status in unattended-upgrades source package in Xenial:
  Fix Committed
Status in unattended-upgrades source package in Bionic:
  Fix Committed
Status in unattended-upgrades source package in Cosmic:
  Fix Committed
Status in unattended-upgrades source package in Disco:
  Fix Committed

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+dfsg-1ubuntu7.12
  That can be done with:
    $ time uvt-simplestreams-libvirt --verbose sync --source 
http://cloud-images.ubuntu.com/daily arch=amd64 label=daily release=bionic
    $ 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-agent=1:2.11+dfsg-1ubuntu7

  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.d/qemu-guest-agent f61a64ac1e48993023018fd1cff85191
  current md5: f61a64ac1e48993023018fd1cff85191
  conffile line: /etc/qemu/fsfreeze-hook/fsfreeze-hook 
15f6ff42cbc5550a07ee21c2a471d905
  /etc/qemu/fsfreeze-hook/fsfreeze-hook not in package conffiles 
/etc/init.d/qemu-guest-agent
  /etc/qemu/fsfreeze-hook
  found conffile /etc/qemu/fsfreeze-hook in new pkg but on dpkg status
  Traceback (most recent call last):
    File "/usr/bin/unattended-upgrade", line 2057, in <module>
      sys.exit(main(options))
    File "/usr/bin/unattended-upgrade", line 1773, in main
      if conffile_prompt(item.destfile):
    File "/usr/bin/unattended-upgrade", line 988, in conffile_prompt
      with open(prefix + conf_file, 'rb') as fp:
  IsADirectoryError: [Errno 21] Is a directory: '/etc/qemu/fsfreeze-hook'

  [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://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1820291/comments/20
  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/unattended-upgrade", line 1998, in <module>
      sys.exit(main(options))
    File "/usr/bin/unattended-upgrade", line 1714, in main
      if conffile_prompt(item.destfile):
    File "/usr/bin/unattended-upgrade", line 929, in conffile_prompt
      with open(prefix + conf_file, 'rb') as fp:
  IsADirectoryError: [Errno 21] Is a directory: '/etc/qemu/fsfreeze-hook'

  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,a=bionic-security, o=UbuntuESM,a=bionic'

  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1823872/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to