** Description changed:
+ [Impact]
+
+ This bug caused aptdaemon to miss two configuration options that ubuntu-
+ advantage-tools relies on for updating its messaging based on apt state.
+ Apt itself parsed the options despite the syntax mistake, which led to a
+ difference in understanding between apt and aptdaemon. This difference
+ caused autopkgtest failures.
+
+ Further, because aptdaemon could not parse these two options, it may
+ result in operations triggered through aptdaemon not properly updating
+ ubuntu advantage esm messaging. This means ubuntu-advantage-tools may
+ print confusing or out of date messages related to esm in some cases.
+
+ The fix is to add the semicolons required in the apt config syntax that
+ we missed. This fix allows aptdaemon to parse all of our config
+ settings, and means apt and aptdaemon will have a shared understanding
+ of the configuration again.
+
+ [Test Plan]
+
+ These test steps assume that the proposed version of ua to release is
+ available in ppa:ua-client/staging - check with the ubuntu-advantage-
+ tools team before proceeding to make sure this is the case.
+
+ Start a container of an affected release (tested in xenial, but should work
on any affected release). Inside the container:
+ ```
+ sudo apt update
+ sudo apt install aptdaemon
+ ```
+
+ Now run the following python3 script
+ ```
+ from aptdaemon import config
+ c = config.ConfigWriter()
+ uataptconf = open("/etc/apt/apt.conf.d/20apt-esm-hook.conf")
+ lines = uataptconf.readlines()
+ print(c.parse(lines).keys())
+ uataptconf.close()
+ ```
+
+ You should see output like the following:
+ ```
+ dict_keys(['apt::install::post-invoke-success',
'apt::update::post-invoke-stats'])
+ ```
+ Note that the above only includes 2 out of the 4 intended config settings
from our config file.
+
+ Now install the fixed version:
+ ```
+ sudo add-apt-repository ppa:ua-client/staging
+ sudo apt-get update
+ sudo apt install ubuntu-advantage-tools
+ ```
+
+ And run the above python script again. You should see output like the
following:
+ ```
+ dict_keys(['apt::install::pre-invoke', 'apt::install::post-invoke-success',
'apt::update::post-invoke-stats', 'aptcli::hooks::upgrade'])
+ ```
+
+ Notice that it now finds all of the intended config settings.
+
+
+ [Where problems could occur]
+
+ The fix is adding two semicolons to the apt config file. The only
+ problem that could occur is that, if a mistake was made, a similar apt
+ config parsing problem could occur. Perhaps if this caused additional
+ config parsing problems, then our message updating hooks would be broken
+ in a different way from this bug. This would result in lack of, or out-
+ of-date, messaging about esm packages from ubuntu-advantage-tools.
+
+ [Other Info]
+
+ A hotfix was already released to impish as 27.1.1 to stop the autopkgtest
failures and unblock work that was interrupted by this bug. It successfully
solved the issue.
+
+ [Original Description]
+
Recently aptdaemon started having autopkgtest failures with its
tests.test_configparser.ConfigurationParserTestCase test. The failure
follows:
Test if credentials of repositories are store securely in a ... ok
======================================================================
ERROR: test_ (tests.test_configparser.ConfigurationParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/autopkgtest.cp3vHc/build.adU/src/tests/test_configparser.py",
line 82, in test_
config[key.lower()]]
KeyError: 'apt::install::pre-invoke'
----------------------------------------------------------------------
Ran 79 tests in 109.732s
FAILED (errors=1, skipped=21)
Test failed: <unittest.runner.TextTestResult run=79 errors=1 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=79 errors=1
failures=0>
The "APT::Install::Pre-Invoke" key is provided by /etc/apt/apt.conf.d
/20apt-esm-hook.conf which is from ubuntu-advantage-tools, so I'd guess
this started happening when it moved to -updates (on 20210513). This
would also explain why it is affecting every release.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1930741
Title:
20apt-esm-hook.conf is missing semicolons at end of option
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1930741/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs