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());
As Grant(https:/ /code.launchpad .net/~orndorffg rant) 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/ 4166288511f42a6 4aee694b80c7d9d 3103bb8581
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: ubuntu- advantage/ apt-esm- hook process-templates
1. A gdb backtrace from running:
/usr/lib/
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 /github. com/canonical/ ubuntu- advantage- client/ blob/main/ apt-hook/ hook.cc# L154
Upstream source here: https:/
diff --git a/apt-hook/hook.cc b/apt-hook/hook.cc upgrade( pkgCache: :PkgIterator pkg, pkgPolicy *policy, resu :VerFileIterato r pf = ver.FileList(); !pf.end(); pf++) ).Archive( ) != 0 && pf.File().Origin() == std::string( "UbuntuESM" )) ).Archive( ) != 0 && DeNull( pf.File( ).Origin( )) == std::string( "UbuntuESM" )) 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( )); upgrade( pkgCache: :PkgIterator pkg, pkgPolicy *policy, resu ).Archive( ) != 0 && pf.File().Origin() == std::string( "UbuntuESMApps" )) ).Archive( ) != 0 && DeNull( pf.File( ).Origin( )) == std::string( "UbuntuESMApps" )) 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( ));
index aed341d5..80b60c5d 100644
--- a/apt-hook/hook.cc
+++ b/apt-hook/hook.cc
@@ -151,7 +151,7 @@ static void check_esm_
{
for (pkgCache:
{
- if (pf.File(
+ if (pf.File(
{
if (std::find(
@@ -167,7 +167,7 @@ static void check_esm_
}
}
}
- if (pf.File(
+ if (pf.File(
{
if (std::find(