Comment 3 for bug 1929123

Revision history for this message
Chad Smith (chad.smith) wrote :

As Grant(https://code.launchpad.net/~orndorffgrant) mentioned in internal channels.

This likely could be related to the same Focal and later errors we are now seeing https://errors.ubuntu.com/problem/4166288511f42a64aee694b80c7d9d3103bb8581

We think the issue might be due to the apt origin of some configured repository not being present yet, or somehow properly configured.

To confirm, can we get the customer to provide us with:
  1. A gdb backtrace from running:
/usr/lib/ubuntu-advantage/apt-esm-hook process-templates

  2. Please also attach `apt-cache policy` output

  3. Maybe it's worth running this attached binary (test-apt-esm-hook) which has the following patch applied to our apt-esm-hook
Upstream source here: https://github.com/canonical/ubuntu-advantage-client/blob/main/apt-hook/hook.cc#L154

diff --git a/apt-hook/hook.cc b/apt-hook/hook.cc
index aed341d5..80b60c5d 100644
--- a/apt-hook/hook.cc
+++ b/apt-hook/hook.cc
@@ -151,7 +151,7 @@ static void check_esm_upgrade(pkgCache::PkgIterator pkg, pkgPolicy *policy, resu
    {
       for (pkgCache::VerFileIterator pf = ver.FileList(); !pf.end(); pf++)
       {
- if (pf.File().Archive() != 0 && pf.File().Origin() == std::string("UbuntuESM"))
+ if (pf.File().Archive() != 0 && DeNull(pf.File().Origin()) == std::string("UbuntuESM"))
          {
             if (std::find(res.esm_i_packages.begin(), res.esm_i_packages.end(), pkg.Name()) == res.esm_i_packages.end()) {
                 res.esm_i_packages.push_back(pkg.Name());
@@ -167,7 +167,7 @@ static void check_esm_upgrade(pkgCache::PkgIterator pkg, pkgPolicy *policy, resu
                 }
             }
          }
- if (pf.File().Archive() != 0 && pf.File().Origin() == std::string("UbuntuESMApps"))
+ if (pf.File().Archive() != 0 && DeNull(pf.File().Origin()) == std::string("UbuntuESMApps"))
          {
             if (std::find(res.esm_a_packages.begin(), res.esm_a_packages.end(), pkg.Name()) == res.esm_a_packages.end()) {
                 res.esm_a_packages.push_back(pkg.Name());