Activity log for bug #1930741

Date Who What changed Old value New value Message
2021-06-03 18:10:44 Brian Murray bug added bug
2021-06-03 18:15:04 Brian Murray 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. This would also explain why it is affecting every release. 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.
2021-06-03 18:17:10 Brian Murray tags update-excuse
2021-06-10 15:39:26 Brian Murray tags update-excuse fr-1434 update-excuse
2021-06-16 15:51:53 Julian Andres Klode summary autopkgtest failures on all (most?) releases 20apt-esm-hook.conf is missing semicolons at end of option
2021-06-16 15:52:09 Julian Andres Klode affects aptdaemon (Ubuntu) ubuntu-advantage-tools (Ubuntu)
2021-06-16 15:52:17 Julian Andres Klode ubuntu-advantage-tools (Ubuntu): status New Triaged
2021-06-16 15:52:20 Julian Andres Klode ubuntu-advantage-tools (Ubuntu): importance Undecided Critical
2021-06-16 15:56:39 Julian Andres Klode nominated for series Ubuntu Groovy
2021-06-16 15:56:39 Julian Andres Klode bug task added ubuntu-advantage-tools (Ubuntu Groovy)
2021-06-16 15:56:39 Julian Andres Klode nominated for series Ubuntu Hirsute
2021-06-16 15:56:39 Julian Andres Klode bug task added ubuntu-advantage-tools (Ubuntu Hirsute)
2021-06-16 15:56:39 Julian Andres Klode nominated for series Ubuntu Focal
2021-06-16 15:56:39 Julian Andres Klode bug task added ubuntu-advantage-tools (Ubuntu Focal)
2021-06-16 15:56:39 Julian Andres Klode nominated for series Ubuntu Impish
2021-06-16 15:56:39 Julian Andres Klode bug task added ubuntu-advantage-tools (Ubuntu Impish)
2021-06-16 15:56:39 Julian Andres Klode nominated for series Ubuntu Bionic
2021-06-16 15:56:39 Julian Andres Klode bug task added ubuntu-advantage-tools (Ubuntu Bionic)
2021-06-16 15:56:39 Julian Andres Klode nominated for series Ubuntu Xenial
2021-06-16 15:56:39 Julian Andres Klode bug task added ubuntu-advantage-tools (Ubuntu Xenial)
2021-06-16 16:10:28 Dimitri John Ledkov attachment added 0001-apt-hook-fix-invalid-20apt-esm-hook.conf-syntax.patch https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1930741/+attachment/5505047/+files/0001-apt-hook-fix-invalid-20apt-esm-hook.conf-syntax.patch
2021-06-16 16:29:03 Ubuntu Foundations Team Bug Bot tags fr-1434 update-excuse fr-1434 patch update-excuse
2021-06-16 21:08:01 Launchpad Janitor ubuntu-advantage-tools (Ubuntu Impish): status Triaged Fix Released
2021-07-09 14:48:55 Grant Orndorff 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. [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.
2021-07-15 15:40:55 Julian Andres Klode tags fr-1434 patch update-excuse fr-1434 patch regression-update update-excuse
2021-07-15 16:37:27 Chad Smith ubuntu-advantage-tools (Ubuntu Groovy): status New Won't Fix
2021-07-26 16:09:50 Launchpad Janitor ubuntu-advantage-tools (Ubuntu Hirsute): status New Fix Released
2021-07-26 16:10:33 Launchpad Janitor ubuntu-advantage-tools (Ubuntu Focal): status New Fix Released
2021-07-26 16:10:43 Launchpad Janitor ubuntu-advantage-tools (Ubuntu Bionic): status New Fix Released
2021-07-26 16:11:07 Launchpad Janitor ubuntu-advantage-tools (Ubuntu Xenial): status New Fix Released