Comment 0 for bug 2034273

Revision history for this message
Chad Smith (chad.smith) wrote : 23.3: implicit dependency on gpgconf breaks Ubuntu minimal images

cloud-init 23.3" when providing #cloud-config userdata containing apt: repo keys. add-apt-repository launches two background services in root's home directory as seen with systemctl status cloud-config.service

     CGroup: /system.slice/cloud-config.service
             ├─1042 dirmngr --daemon --homedir /root/.gnupg
             └─1082 gpg-agent --homedir /root/.gnupg --use-standard-socket --daemon

Upstream commit https://github.com/canonical/cloud-init/commit/842d0452 introduced a strict dependency on gpgconfig utility to kill any gpg-agent/dirmngr daemons spawned.

Although cloud-init debian/control has a Recommends: gnupg, Recommends packages are not installed in Ubuntu minimal images which lead to traceback like the following[1].

To avoid pulling in unnecessary package dependencies and bloating images, cloud-init should approach this daemon cleanup using common system utilities (kill) or python modules (os.kill).

This breaks daily Ubuntu minimal builds on Mantic builds and should be seen as an SRU blocker for cloud-init of 23.3.

16:53:35 AssertionError: ['(\'apt_configure\', ProcessExecutionError("Unexpected error while running command.\\nCommand: [\'16:53:35 FAILURE: __main__.CloudInitTests.test_cloud_init_has_no_captured_failures
16:53:35 Traceback (most recent call last):
16:53:35 File "/home/ubuntu/tests.py", line 45, in test_cloud_init_has_no_captured_failures
16:53:35 self.assertFalse(
16:53:35 AssertionError: ['(\'apt_configure\', ProcessExecutionError("Unexpected error while running command.\\nCommand: [\'gpgconf\', \'--kill\', \'all\']\\nExit code: -\\nReason: [Errno 2] No such file or directory: b\'gpgconf\'\\nStdout: -\\nStderr: -"))'] is not false : cloud-init has reported errors. Please investigate. ['(\'apt_configure\', ProcessExecutionError("Unexpected error while running command.\\nCommand: [\'gpgconf\', \'--kill\', \'all\']\\nExit code: -\\nReason: [Errno 2] No such file or directory: b\'gpgconf\'\\nStdout: -\\nStderr: -"))']
16:53:35\', \'--kill\', \'all\']\\nExit code: -\\nReason: [Errno 2] No such file or directory: b\'gpgconf\'\\nStdout: -\\nStderr: -"))'] is not false : cloud-init has reported errors. Please investigate. ['(\'apt_configure\', ProcessExecutionError("Unexpected error while running command.\\nCommand: [\'gpgconf\', \'--kill\', \'all\']\\nExit code: -\\nReason: [Errno 2] No such file or directory: b\'gpgconf\'\\nStdout: -\\nStderr: -"))']
16:53:35