** Description changed: + [Impact] + + When users create an airgapped environement, they may create APT mirrors + for the ESM services that share a common base URL. For example, in this + bug here, the user was mirroring their services one: + + http://landscaperepo.com/repository/standalone/ubuntu/dists/bionic-esm-apps-security + http://landscaperepo.com/repository/standalone/ubuntu/dists/bionic-esm-apps-updates + http://landscaperepo.com/repository/standalone/ubuntu/dists/bionic-esm-infra-security/ + http://landscaperepo.com/repository/standalone/ubuntu/dists/bionic-esm-infra-updates/ + http://landscaperepo.com/repository/standalone/ubuntu/dists/fips-bionic/ + http://landscaperepo.com/repository/standalone/ubuntu/dists/jammy-esm-apps-security/ + + As we can see, all services share the + http://landscaperepo.com/repository/standalone/ APT url. + Since the Pro client was looking for unique urls to distinguish enabled services in the machine, this setup was not working. + + Now, instead of looking at the APT url, we are also looking at the suite + (i.e. bionic-esm-apps-security) + + If we identify that both APT url and suite are in the output of apt-cache policy + with the right permission number, we say that the service is enabled. + + This will unblock users that want to use the same APT url for their + airgapped setup. + + Additionally, we have discussed this issue with the Landscape team and + they assured us that we will always have an unique combination of APT + url and suite. + + + [Test cases] + + We have setup an integration test for this scenario on the Pro client codebase. + We will link the test result here. + + [ Regression Potential ] + + We believe we are now improving our check to see if the service is + enabled or not, as we are now considering a combination that we now will + be unique. Therefore, the only regression potential we can think is the + situation were we mistakenly create that combination (APT url + suite) + or check it in a wrong way in the output of apt-cache policy. + + However, we believe our integration tests should be enough to assert + that this is not the case. + + [ Original Description] + contract server is airgapped and running uaclient is pointing to the airgapped contract server to get entitlements Additionally, using a landscape server and it's underlying reprepro to mirror ESM and FIPs for airgap, this forces using http apt update is working over landscape over multiple repos. pro attach subscriptioncontract, is working next pro enable service is creating /etc/apt/auth.conf.d/90ubuntu-advantage with correct apt entry, apt update can pickup the airgapped repo but with warning of http:// For example: pro enable esm-apps Service Status is not getting updating pro status is showing after enablement of esm-apps SERVICE ENTITLED STATUS DESCRIPTION esm-apps yes disabled Expanded Security Maintenance for Applications esm-infra yes disabled Expanded Security Maintenance for Infrastructure Editing 90ubuntu-advantage to append http:// get rids of the apt update working but service status is not changing. Issuing pro enable esm-apps appends another entry and is a loop ubuntu-advantage.log is showing the following ["2023-08-11T16:54:20.596", "DEBUG", "uaclient.files.files", "read", 55, "File does not exist: /var/lib/ubuntu-advantage/user-config.json", {}] ["2023-08-11T16:54:22.233", "DEBUG", "root", "subp", 634, "Failed running command 'apt-cache policy' [exit(100)]. Message: E: Problem renaming the file /var/cache/apt/pkgcache.bin.K4g76Q to /var/cache/apt/pkgcache.bin - rename (2: No such file or directory)\nW: You may want to run apt-get update to correct these problems\nE: The package cache file is corrupted\n", {}] ["2023-08-11T16:54:22.233", "WARNING", "root", "subp", 636, "Stderr: E: Problem renaming the file /var/cache/apt/pkgcache.bin.K4g76Q to /var/cache/apt/pkgcache.bin - rename (2: No such file or directory)\nW: You may want to run apt-get update to correct these problems\nE: The package cache file is corrupted\n\nStdout: ", {}] ["2023-08-11T16:54:22.234", "DEBUG", "root", "subp", 640, "Failed running command 'apt-cache policy' [exit(100)]. Message: E: Problem renaming the file /var/cache/apt/pkgcache.bin.K4g76Q to /var/cache/apt/pkgcache.bin - rename (2: No such file or directory)\nW: You may want to run apt-get update to correct these problems\nE: The package cache file is corrupted\n Retrying 3 more times.", {}] ["2023-08-11T16:54:23.213", "DEBUG", "root", "_subp", 581, "Ran cmd: apt-get update, rc: 0 stderr: b''", {}] - - For auditing purposes the status of subscription and it's services is important to be correct. Additionally to insure correct packages for fips get installed. + For auditing purposes the status of subscription and it's services is + important to be correct. Additionally to insure correct packages for + fips get installed.
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2031192 Title: Enabling of Pro Services Does Not Update when using airgapped mirrors over http:// To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/2031192/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs