[Bug 1260041] Re: Unattended-Upgrades crashes with a dpkg error

Balint Reczey balint.reczey at canonical.com
Wed Mar 13 16:09:11 UTC 2019


Tested with 1.1ubuntu1.18.04.7~16.04.2 on Xenial:

root at x-uu-lp-1260041:~# unattended-upgrade --dry-run --verbose --debug
Initial blacklisted packages: 
Initial whitelisted packages: 
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=xenial, o=Ubuntu,a=xenial-security, o=UbuntuESM,a=xenial, o=Ubuntu,a=xenial-updates
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\.18\.0\-16\-generic$|^linux-headers-4\.18\.0\-16\-generic$|^linux-image-extra-4\.18\.0\-16\-generic$|^linux-modules-4\.18\.0\-16\-generic$|^linux-modules-extra-4\.18\.0\-16\-generic$|^linux-signed-image-4\.18\.0\-16\-generic$|^kfreebsd-image-4\.18\.0\-16\-generic$|^kfreebsd-headers-4\.18\.0\-16\-generic$|^gnumach-image-4\.18\.0\-16\-generic$|^.*-modules-4\.18\.0\-16\-generic$|^.*-kernel-4\.18\.0\-16\-generic$|^linux-backports-modules-.*-4\.18\.0\-16\-generic$|^linux-modules-.*-4\.18\.0\-16\-generic$|^linux-tools-4\.18\.0\-16\-generic$|^linux-cloud-tools-4\.18\.0\-16\-generic$) regexp to find running kernel packages
Checking: cloud-init ([<Origin component:'main' archive:'xenial-proposed' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
adjusting candidate version: cloud-init=18.5-21-g8ee294d5-0ubuntu1~16.04.1
Checking: distro-info-data ([<Origin component:'main' archive:'xenial-proposed' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
pkg distro-info-data not in allowed origin
sanity check failed
Checking: libpam-systemd ([<Origin component:'main' archive:'xenial-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: libsystemd0 ([<Origin component:'main' archive:'xenial-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: libudev1 ([<Origin component:'main' archive:'xenial-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: snapd ([<Origin component:'main' archive:'xenial-proposed' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
adjusting candidate version: snapd=2.34.2ubuntu0.1
Checking: systemd ([<Origin component:'main' archive:'xenial-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: systemd-sysv ([<Origin component:'main' archive:'xenial-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
Checking: ubuntu-core-launcher ([<Origin component:'main' archive:'xenial-proposed' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
adjusting candidate version: ubuntu-core-launcher=2.34.2ubuntu0.1
Checking: udev ([<Origin component:'main' archive:'xenial-updates' origin:'Ubuntu' label:'Ubuntu' site:'archive.ubuntu.com' isTrusted:True>])
pkgs that look like they should be upgraded: libpam-systemd
libsystemd0
libudev1
systemd
systemd-sysv
udev
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: 11468 DestFile:'/var/cache/apt/archives/systemd-sysv_229-4ubuntu21.17_amd64.deb' DescURI: 'http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/systemd-sysv_229-4ubuntu21.17_amd64.deb' ID:0 ErrorText: ''>
check_conffile_prompt(/var/cache/apt/archives/systemd-sysv_229-4ubuntu21.17_amd64.deb)
found pkg: systemd-sysv
No conffiles in deb /var/cache/apt/archives/systemd-sysv_229-4ubuntu21.17_amd64.deb (There is no member named 'conffiles')
<apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 115114 DestFile:'/var/cache/apt/archives/libpam-systemd_229-4ubuntu21.17_amd64.deb' DescURI: 'http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/libpam-systemd_229-4ubuntu21.17_amd64.deb' ID:0 ErrorText: ''>
check_conffile_prompt(/var/cache/apt/archives/libpam-systemd_229-4ubuntu21.17_amd64.deb)
found pkg: libpam-systemd
No conffiles in deb /var/cache/apt/archives/libpam-systemd_229-4ubuntu21.17_amd64.deb (There is no member named 'conffiles')
<apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 204002 DestFile:'/var/cache/apt/archives/libsystemd0_229-4ubuntu21.17_amd64.deb' DescURI: 'http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/libsystemd0_229-4ubuntu21.17_amd64.deb' ID:0 ErrorText: ''>
check_conffile_prompt(/var/cache/apt/archives/libsystemd0_229-4ubuntu21.17_amd64.deb)
found pkg: libsystemd0
No conffiles in deb /var/cache/apt/archives/libsystemd0_229-4ubuntu21.17_amd64.deb (There is no member named 'conffiles')
<apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 3813730 DestFile:'/var/cache/apt/archives/systemd_229-4ubuntu21.17_amd64.deb' DescURI: 'http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/systemd_229-4ubuntu21.17_amd64.deb' ID:0 ErrorText: ''>
check_conffile_prompt(/var/cache/apt/archives/systemd_229-4ubuntu21.17_amd64.deb)
found pkg: systemd
conffile line: /etc/dbus-1/system.d/org.freedesktop.hostname1.conf f55c94d000b5d62b5f06d38852977dd1
current md5: f55c94d000b5d62b5f06d38852977dd1
conffile line: /etc/dbus-1/system.d/org.freedesktop.locale1.conf 5893ab03e7e96aa3759baceb4dd04190
current md5: 5893ab03e7e96aa3759baceb4dd04190
conffile line: /etc/dbus-1/system.d/org.freedesktop.login1.conf 4aac4fe1a99c9fca83c85b80e4e0c2ba
current md5: 4aac4fe1a99c9fca83c85b80e4e0c2ba
conffile line: /etc/dbus-1/system.d/org.freedesktop.network1.conf 162e9a90d8f824f79ef2c6390827ec7b
current md5: 162e9a90d8f824f79ef2c6390827ec7b
conffile line: /etc/dbus-1/system.d/org.freedesktop.resolve1.conf 6969148b4616c56a5c9065cec5ab0775
current md5: 6969148b4616c56a5c9065cec5ab0775
conffile line: /etc/dbus-1/system.d/org.freedesktop.systemd1.conf 846824928e39a465c06c3aae53510535
current md5: 846824928e39a465c06c3aae53510535
conffile line: /etc/dbus-1/system.d/org.freedesktop.timedate1.conf 682369fbf3de26b21e775732c89a2bbe
current md5: 682369fbf3de26b21e775732c89a2bbe
conffile line: /etc/dhcp/dhclient-exit-hooks.d/timesyncd a891f21f45b0648b7082d999bf424591
current md5: a891f21f45b0648b7082d999bf424591
conffile line: /etc/pam.d/systemd-user 3bdb96b18046bd209135cdfe73421db6
current md5: 3bdb96b18046bd209135cdfe73421db6
conffile line: /etc/systemd/bootchart.conf 7cb6c9cab8ec511882e0e05fceb87e45
current md5: 7cb6c9cab8ec511882e0e05fceb87e45
conffile line: /etc/systemd/journald.conf d928a3ce9f51fcff8ed925270f14a2aa
current md5: d928a3ce9f51fcff8ed925270f14a2aa
conffile line: /etc/systemd/logind.conf 5b41bb868487d1013382b738f6648328
current md5: 5b41bb868487d1013382b738f6648328
conffile line: /etc/systemd/resolved.conf cc77726b02979ddc8b034a338f7bdea9
current md5: cc77726b02979ddc8b034a338f7bdea9
conffile line: /etc/systemd/system.conf 1340491c660f9eb234c92fe1225ff427
current md5: 1340491c660f9eb234c92fe1225ff427
conffile line: /etc/systemd/timesyncd.conf 4e1cf2b5f85dff6c1f186135b9f66a85
current md5: 4e1cf2b5f85dff6c1f186135b9f66a85
conffile line: /etc/systemd/user.conf 2eaf5976751be8864d0555f30814d832
current md5: 2eaf5976751be8864d0555f30814d832
<apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 993100 DestFile:'/var/cache/apt/archives/udev_229-4ubuntu21.17_amd64.deb' DescURI: 'http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/udev_229-4ubuntu21.17_amd64.deb' ID:0 ErrorText: ''>
check_conffile_prompt(/var/cache/apt/archives/udev_229-4ubuntu21.17_amd64.deb)
found pkg: udev
conffile line: /etc/init.d/udev e4da2ae5c153148fad0b3f6e5e7ce61e
current md5: e4da2ae5c153148fad0b3f6e5e7ce61e
conffile line: /etc/init/udev.conf 41c0081f3a830e0902aaff76a53edf98
current md5: 41c0081f3a830e0902aaff76a53edf98
conffile line: /etc/init/udevmonitor.conf ec187fc822d47c41416e7c531c8c48dd
current md5: ec187fc822d47c41416e7c531c8c48dd
conffile line: /etc/init/udevtrigger.conf 651ff2421dde80be7ce7ccbf7fa8cf18
current md5: 651ff2421dde80be7ce7ccbf7fa8cf18
conffile line: /etc/modprobe.d/fbdev-blacklist.conf 0b9c466830040ec52986cc3ea117bef5
current md5: 0b9c466830040ec52986cc3ea117bef5
conffile line: /etc/udev/udev.conf a9c43ddab6e58eefa56db50ff44b2b46
current md5: a9c43ddab6e58eefa56db50ff44b2b46
<apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 1 IsTrusted: 1 FileSize: 53928 DestFile:'/var/cache/apt/archives/libudev1_229-4ubuntu21.17_amd64.deb' DescURI: 'http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/libudev1_229-4ubuntu21.17_amd64.deb' ID:0 ErrorText: ''>
check_conffile_prompt(/var/cache/apt/archives/libudev1_229-4ubuntu21.17_amd64.deb)
found pkg: libudev1
No conffiles in deb /var/cache/apt/archives/libudev1_229-4ubuntu21.17_amd64.deb (There is no member named 'conffiles')
blacklist: []
whitelist: []
Option --dry-run given, *not* performing real actions
Packages that will be upgraded: libpam-systemd libsystemd0 libudev1 systemd systemd-sysv udev
Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
applying set ['systemd-sysv']
/usr/bin/dpkg --status-fd 9 --unpack --auto-deconfigure /var/cache/apt/archives/systemd-sysv_229-4ubuntu21.17_amd64.deb 
/usr/bin/dpkg --status-fd 11 --configure systemd-sysv:amd64 
/usr/bin/dpkg --status-fd 13 --configure --pending 
left to upgrade {'udev', 'libpam-systemd', 'libudev1', 'libsystemd0', 'systemd'}
applying set ['udev', 'libudev1']
/usr/bin/dpkg --status-fd 9 --unpack --auto-deconfigure /var/cache/apt/archives/udev_229-4ubuntu21.17_amd64.deb /var/cache/apt/archives/libudev1_229-4ubuntu21.17_amd64.deb 
/usr/bin/dpkg --status-fd 11 --configure libudev1:amd64 udev:amd64 
/usr/bin/dpkg --status-fd 13 --configure --pending 
left to upgrade {'libpam-systemd', 'libsystemd0', 'systemd'}
applying set ['libsystemd0', 'libpam-systemd', 'systemd']
/usr/bin/dpkg --status-fd 9 --unpack --auto-deconfigure /var/cache/apt/archives/libpam-systemd_229-4ubuntu21.17_amd64.deb /var/cache/apt/archives/libsystemd0_229-4ubuntu21.17_amd64.deb 
/usr/bin/dpkg --status-fd 11 --configure libsystemd0:amd64 
/usr/bin/dpkg --status-fd 13 --unpack --auto-deconfigure /var/cache/apt/archives/systemd_229-4ubuntu21.17_amd64.deb 
/usr/bin/dpkg --status-fd 15 --configure systemd:amd64 libpam-systemd:amd64 
/usr/bin/dpkg --status-fd 17 --configure --pending 
left to upgrade set()
All upgrades installed
InstCount=0 DelCount=0 BrokenCount=0
root at x-uu-lp-1260041:~# dpkg -l unattended-upgrades | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                Version                    Architecture Description
+++-===================-==========================-============-===========================================
ii  unattended-upgrades 1.1ubuntu1.18.04.7~16.04.2 all          automatic installation of security upgrades
root at x-uu-lp-1260041:~#



root at x-uu-lp-1260041:~#  while sleep 0.1; do python3 -c 'import apt, apt_pkg, time; print(apt_pkg.pkgsystem_lock()); time.sleep(2)' ; done
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: E:Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable), E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
True
True
...

I also installed apt and related packages from -proposed:

root at x-uu-lp-1260041:~# dpkg -l python3-apt | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version                    Architecture Description
+++-==============-==========================-============-=================================
ii  python3-apt    1.1.0~beta1ubuntu0.16.04.3 amd64        Python 3 interface to libapt-pkg


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

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

Title:
  Unattended-Upgrades crashes with a dpkg error

Status in unattended-upgrades package in Ubuntu:
  Fix Released
Status in unattended-upgrades source package in Xenial:
  Fix Committed
Status in unattended-upgrades source package in Bionic:
  Fix Released

Bug description:
  [Impact]

   * Unattended-upgrades fails upgrading packages in the middle of a dpkg/apt call due to a parallel process acquiring apt or dpkg lock while u-u is running, but u-u running apt/dpkg anyway without successfully re-acquiring the lock.
   * The fix is stopping processing updates when the lock is detected to be lost.

  [Test Case]

   * Set up a system with packages (> 30) to be upgraded:
  $ lxc launch ubuntu:b36ec647e374 uu-lock-bail

   * Set up two shells to run commands in parallel
   * In shell "A" run sudo apt update && sudo unattended-upgrade --dry-run --verbose --debug
   * After u-u started installing the updates run the following command in shell "B":
  $  while sleep 0.1; do python3 -c 'import apt, apt_pkg, time; print(apt_pkg.pkgsystem_lock()); time.sleep(2)' ; done

  * With not fixed u-u observe the following exception repeated in shell "B", then True being printed when the lock is successfully stolen from u-u:
  ...
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
  True
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
  True
  True
  True
  True
  ...

  Buggy u-u continues operation even after the lock is stolen.

  Fixed u-u stops operation with a printout similar to the following when it detects the lock to be stolen:
  ...
  Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
  /usr/bin/dpkg --status-fd 9 --no-triggers --unpack --auto-deconfigure /var/cache/apt/archives/distro-info-data_0.37ubuntu0.1_all.deb 
  /usr/bin/dpkg --status-fd 9 --configure --pending 
  Exception happened during upgrade.
  Traceback (most recent call last):
    File "./unattended-upgrade", line 539, in cache_commit
      res = cache.commit(install_progress=iprogress)
    File "./unattended-upgrade", line 360, in __exit__
      apt_pkg.pkgsystem_lock()
  apt_pkg.Error: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
  Exception happened during upgrade.
  NoneType: None
  Installing the upgrades failed!
  error message: E:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable), E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
  dpkg returned a error! See /var/log/unattended-upgrades/unattended-upgrades-dpkg.log for details
  ...

  [Regression Potential]

   * As a consequence of the fix unattended-upgrade stops installing
  security-updates when an other dpkg frontend's parallel activity is
  detected. This is intentional to prevent parallel execution of dpkg
  and potentially leaving the system in an inconsistent state. The full
  fix will be implemented in LP: #1781169 and changing u-u to use the
  new locking mechanism, and then u-u will never lose the lock.

  [Other Info]

  I believe parallel dpkg calls cause many breakages reported against
  u-u and other packages listing breaking maintainer scripts.

  [Original Bug Text]

  As per https://bugs.launchpad.net/ubuntu/+source/unattended-
  upgrades/+bug/1052360/comments/17, I am filing a new bug with the
  specific error I am running into. This has been going on for quite a
  while now.

  Also, my log files still show up as I described in
  https://bugs.launchpad.net/ubuntu/+source/unattended-
  upgrades/+bug/1052360/comments/14.

  ProblemType: Bug
  DistroRelease: Ubuntu 13.10
  Package: unattended-upgrades 0.79.3ubuntu8
  ProcVersionSignature: Ubuntu 3.11.0-14.21-generic 3.11.7
  Uname: Linux 3.11.0-14-generic x86_64
  NonfreeKernelModules: fglrx
  ApportVersion: 2.12.5-0ubuntu2.1
  Architecture: amd64
  Date: Wed Dec 11 11:07:09 2013
  MarkForUpload: True
  PackageArchitecture: all
  SourcePackage: unattended-upgrades
  UpgradeStatus: Upgraded to saucy on 2013-10-18 (54 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1260041/+subscriptions



More information about the foundations-bugs mailing list