Launching ua status → An unexpected error occurred: list index out of range
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Committed
|
Undecided
|
Unassigned | ||
Bionic |
Fix Committed
|
Undecided
|
Unassigned | ||
Focal |
Fix Committed
|
Undecided
|
Unassigned | ||
Jammy |
Fix Committed
|
Undecided
|
Unassigned | ||
Noble |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
If `apt` is masked by other helper tools, such as `nala`, as seen in the original description, `apt list --installed` will return data in a different format. This will cause the Pro Client to fail to parse the data, and break.
The Pro Client should not be relying on CLI output when there are Python bindings available to perform the same task - and python3-apt provides ways to list installed packages.
The fix to this bug is to rely on the programmatic integration with APT instead of calling the CLI.
[ Test Plan ]
Listing installed packages is part of the regular operation of the Pro Client in many scenarios covered by the integration / acceptance tests.
For this particular issue:
- Launch a container for the release to be tested
- install nala
- alias `apt` to `nala` in the system
- see it fail
- install the package from -proposed
- see it does not fail anymore
[ Where problems could occur ]
Switching from the CLI call to python3-apt brings the risk of wrong implementation of the integration, which would lead to a different package list to be returned by python3-apt. The regression potential is mitigated by extensive testing - unit, integration and acceptance tests rely on this functionality.
[ Original description ]
This is in 22.04
❯ ua status
An unexpected error occurred: list index out of range
For more details, see the log: /home/marco/
If you think this is a bug, please run: ubuntu-bug ubuntu-
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: ubuntu-
ProcVersionSign
Uname: Linux 6.8.0-35-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Fri Jun 7 17:42:12 2024
InstallationDate: Installed on 2010-07-10 (5081 days ago)
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
PackageArchitec
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: ubuntu-
UpgradeStatus: Upgraded to jammy on 2020-06-14 (1453 days ago)
cloud-id.txt-error: Invalid command specified 'cloud-id'.
jobs-status.json: {"metering": {"last_run": "2024-06-
uaclient.conf:
contract_url: https:/
log_level: debug
Hi Marco, thanks for reporting this
The parsing of `apt list --installed` is failing - we are trying to extract version information using the pattern, and it fails.
The root cause fix will be deployed next release. But to know what is happening here, could you please append the output of `apt list --installed`? Thanks