/usr/lib/ubuntu-advantage/esm_cache.py:AttributeError:/usr/lib/ubuntu-advantage/esm_cache.py@21:__init__:parse_config:safe_load:load:get_single_data:construct_document:construct_yaml_map:construct_mapping:construct_mapping
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Undecided
|
Renan Rodrigo | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Users who have a non-standard python installation will get errors when u-a-t scripts run (including during apt update for most users - even if not attached to Ubuntu Pro). This happens when u-a-t tries to use yaml functionality but the version of yaml installed by the user is not compatible with what u-a-t expects.
The issue is mitigated by logging an error and exiting when yaml fails to safe_load/
[Test Case]
This will be covered by our full test run for u-a-t 27.14.
The specific test that covers this scenario can be inspected here:
https:/
[Regression Potential]
The fix relies on importing yaml functionality from uaclient.yaml - if in any code we import directly from yaml, it will bypass this fix and fail in the same scenario as this bug does. We need to pay attention to not import yaml directly in any other module.
The fix also involves re-exporting the yaml functions, if we missed an export that another piece of code relies on, then that would cause an unhandled exception.
[Discussion]
Until recently our position had been: non-standard python install -> unsupported. This fix is deals with the error in a best-effort implementation to avoid crashes and automatic reports from errors.ubuntu.com, which can block phasing for no reason.
[Original Description]
The Ubuntu Error Tracker has been receiving reports about a problem regarding ubuntu-
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://
Changed in ubuntu-advantage-tools (Ubuntu): | |
assignee: | nobody → Renan Rodrigo (renanrodrigo) |
description: | updated |
description: | updated |
description: | updated |
tags: |
added: verification-done-kinetic removed: verification-dope-kinetic |
Hi, advantage- tools can do to fully avoid the issue.
to be clear this is a the consequence of installing non ubuntu-archive python libs (which is fine) into paths that will by used by the systems python (not fine) and therefore there is not much ubuntu-
We had the very same report by a user back in summer 2022 in bug 1981120
Back than it was agreed that we can not fully support all theoretical possible combinations of python and there was no further feedback since then.
But seeing a few more (=2 so far) of these crashes I wonder if this would be another case which - while impossible to fix - we should at least fail more gracefully on.
It seems to happen always at the same spot, so how about catching this exact combination of AttributeError: module 'collections' has no attribute 'Hashable' and logging a "most likely you face this issue ..." message before bailing out more graceful than a traceback?