hook error due to DPKG lock contention with unattended-upgr
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Neutron Open vSwitch Charm |
Triaged
|
High
|
Unassigned |
Bug Description
This might be a universal issue accross our charms, but filing to neutron-openvswitch as that is where it was observed.
While one might think this would be an edge case to rarely happen, we have recently seen it quite often in our gates:
https:/
https:/
2021-06-04 06:40:42 DEBUG juju.worker.
2021-06-04 06:40:42 DEBUG juju.worker.uniter resolver.go:170 no operations in progress; waiting for changes
2021-06-04 06:40:42 DEBUG juju.worker.
2021-06-04 06:40:42 DEBUG juju.machinelock machinelock.go:162 acquire machine lock for neutron-
2021-06-04 06:40:42 DEBUG juju.machinelock machinelock.go:172 machine lock acquired for neutron-
2021-06-04 06:40:42 DEBUG juju.worker.
2021-06-04 06:40:42 DEBUG juju.worker.
2021-06-04 06:40:42 DEBUG juju.worker.uniter agent.go:20 [AGENT-STATUS] executing: running config-changed hook
2021-06-04 06:40:42 DEBUG juju.worker.
2021-06-04 06:40:43 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:43 WARNING juju-log Package openstack-release has no installation candidate.
2021-06-04 06:40:43 DEBUG jujuc server.go:211 running hook tool "config-get" for neutron-
2021-06-04 06:40:44 DEBUG config-changed none
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "relation-ids" for neutron-
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "relation-list" for neutron-
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "relation-get" for neutron-
2021-06-04 06:40:44 DEBUG config-changed none
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:44 INFO juju-log Registered config file: /etc/neutron/
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:44 INFO juju-log Registered config file: /etc/neutron/
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:44 INFO juju-log Registered config file: /etc/default/
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:44 INFO juju-log Registered config file: /etc/neutron/
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:44 INFO juju-log Registered config file: /etc/neutron/
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:44 INFO juju-log Registered config file: /etc/neutron/
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:44 INFO juju-log Registered config file: /etc/neutron/
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:44 INFO juju-log Registered config file: /etc/neutron/
2021-06-04 06:40:44 DEBUG config-changed none
2021-06-04 06:40:44 DEBUG config-changed none
2021-06-04 06:40:44 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:44 WARNING juju-log Package openstack-release has no installation candidate.
2021-06-04 06:40:45 DEBUG config-changed none
2021-06-04 06:40:45 DEBUG config-changed none
2021-06-04 06:40:45 DEBUG config-changed none
2021-06-04 06:40:45 DEBUG config-changed none
2021-06-04 06:40:46 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:46 WARNING juju-log Package openstack-release has no installation candidate.
2021-06-04 06:40:47 DEBUG config-changed none
2021-06-04 06:40:47 DEBUG config-changed none
2021-06-04 06:40:47 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:47 WARNING juju-log Package openstack-release has no installation candidate.
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-ids" for neutron-
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-get" for neutron-
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-list" for neutron-
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-get" for neutron-
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-ids" for neutron-
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-ids" for neutron-
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-ids" for neutron-
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-get" for neutron-
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-list" for neutron-
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-get" for neutron-
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "relation-get" for neutron-
2021-06-04 06:40:48 DEBUG config-changed none
2021-06-04 06:40:48 DEBUG config-changed none
2021-06-04 06:40:48 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:48 WARNING juju-log Package openstack-release has no installation candidate.
2021-06-04 06:40:49 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:49 INFO juju-log Making dir /var/lib/
2021-06-04 06:40:49 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:49 INFO juju-log Making dir /etc/policy-rc.d root:root 555
2021-06-04 06:40:49 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:49 INFO juju-log Installing [] with options: ['--option=
2021-06-04 06:40:49 DEBUG config-changed Reading package lists...
2021-06-04 06:40:50 DEBUG config-changed Building dependency tree...
2021-06-04 06:40:50 DEBUG config-changed Reading state information...
2021-06-04 06:40:50 DEBUG config-changed 0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
2021-06-04 06:40:50 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:50 WARNING juju-log Package openstack-release has no installation candidate.
2021-06-04 06:40:51 DEBUG config-changed Hit:1 http://
2021-06-04 06:40:51 DEBUG config-changed Hit:2 http://
2021-06-04 06:40:51 DEBUG config-changed Hit:3 http://
2021-06-04 06:40:51 DEBUG config-changed Get:4 http://
2021-06-04 06:40:52 DEBUG config-changed Fetched 114 kB in 1s (216 kB/s)
2021-06-04 06:40:53 DEBUG config-changed Reading package lists...
2021-06-04 06:40:53 DEBUG config-changed none
2021-06-04 06:40:53 DEBUG config-changed none
2021-06-04 06:40:53 DEBUG config-changed none
2021-06-04 06:40:54 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:54 WARNING juju-log Package openstack-release has no installation candidate.
2021-06-04 06:40:57 DEBUG jujuc server.go:211 running hook tool "status-set" for neutron-
2021-06-04 06:40:57 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:57 INFO juju-log Installing ['libnetfilter-
2021-06-04 06:40:57 WARNING config-changed E: Could not get lock /var/lib/
2021-06-04 06:40:57 WARNING config-changed E: Unable to acquire the dpkg frontend lock (/var/lib/
2021-06-04 06:40:57 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:40:57 INFO juju-log Couldn't acquire DPKG lock. Will retry in 10 seconds
2021-06-04 06:41:07 WARNING config-changed E: Could not get lock /var/lib/
2021-06-04 06:41:07 WARNING config-changed E: Unable to acquire the dpkg frontend lock (/var/lib/
2021-06-04 06:41:07 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:41:07 INFO juju-log Couldn't acquire DPKG lock. Will retry in 10 seconds
2021-06-04 06:41:17 WARNING config-changed E: Could not get lock /var/lib/
2021-06-04 06:41:17 WARNING config-changed E: Unable to acquire the dpkg frontend lock (/var/lib/
2021-06-04 06:41:17 DEBUG jujuc server.go:211 running hook tool "juju-log" for neutron-
2021-06-04 06:41:17 INFO juju-log Couldn't acquire DPKG lock. Will retry in 10 seconds
2021-06-04 06:41:27 WARNING config-changed E: Could not get lock /var/lib/
2021-06-04 06:41:27 WARNING config-changed E: Unable to acquire the dpkg frontend lock (/var/lib/
2021-06-04 06:41:28 WARNING config-changed Traceback (most recent call last):
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed main()
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed hooks.execute(
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed self._hooks[
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed return restart_
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed r = lambda_f()
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed (lambda: f(*args, **kwargs)),
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed install_packages()
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed apt_install(
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed _run_apt_
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed _run_with_retries(
2021-06-04 06:41:28 WARNING config-changed File "/var/lib/
2021-06-04 06:41:28 WARNING config-changed result = subprocess.
2021-06-04 06:41:28 WARNING config-changed File "/usr/lib/
2021-06-04 06:41:28 WARNING config-changed raise CalledProcessEr
2021-06-04 06:41:28 WARNING config-changed subprocess.
2021-06-04 06:41:28 ERROR juju.worker.
2021-06-04 06:41:28 DEBUG juju.machinelock machinelock.go:186 machine lock released for neutron-
2021-06-04 06:41:28 DEBUG juju.worker.
2021-06-04 06:41:28 INFO juju.worker.uniter resolver.go:143 awaiting error resolution for "config-changed" hook
2021-06-04 06:41:28 DEBUG juju.worker.uniter agent.go:20 [AGENT-STATUS] error: hook failed: "config-changed"
I think this is universal as it depends on the image that is being used for the charm/payload. i.e. unattended-upgrades being enabled. We could put some code in charm-helpers to detect this situation and wait for the u-u to complete and release the lock before we need to use the packaging system? U-u is generally a good thing (I guess), but we disable it in all of our OpenStack and series upgrade testing to ensure it doesn't interfere with the upgrades.