sudo ua attach is not working
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Medium
|
shawn audet | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Hirsute |
Fix Released
|
Undecided
|
Unassigned | ||
Impish |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
This bug impacts users which:
- Do not have the '/usr/bin/cloud-id' command in their system,
- Do have the '/var/lib/
- Have a non-standard (by cloud-init definitions) content in the '/var/lib/
This is an unusual situation, given that the presence of the 'result.json' file with the absence of the 'cloud-id' command is observed on official Trusty images, but from Xenial onwards 'cloud-id' should be there. Even in the case where the command is not there, the file generated by cloud-init will have the required information.
Since we are doing the SRU process for Xenial onwards, the solution for those problems is to rely only on cloud-id when trying to determine the cloud type, and assuming not on cloud when the command is not present or if it fails.
https:/
[Test Case]
To reproduce:
With ubuntu-
- Make sure cloud-id is not there:
$ sudo mv /usr/bin/cloud-id /usr/bin/
- Make sure to have the result.json file with non-standard (empty, for instance) content:
$ sudo mv /var/lib/
$ sudo touch /var/lib/
- Try to attach a token using "ua attach"
- Verify that it fails
To verify the fix:
Repeat the above process using ubuntu-advantage tools 27.3, and verify that the attach operation succeeds.
[Regression Potential]
When running on a non-cloud system, this fix brings no impact, as we expect cloud-id to be absent and we are not running on cloud.
When running on a specific cloud, this fix brings the scenario where we should detect the cloud and are unable to, due to problems with cloud-init. This is minor though, given that if cloud-init didn't run properly, the instance has more problems than this one. Besides that, considering no-cloud when not in aws/azure/gcp has no impact on UA at all, and those three providers have images with cloud-id working properly.
No official Ubuntu image should be affected by this change.
[Discussion]
As stated above, this is an unusual situation, which led to an improvement to the cloud detection in UA.
[Original Description]
sudo ua status
Unexpected error(s) occurred.
For more details, see the log: /var/log/
To file a bug run: ubuntu-bug ubuntu-
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: ubuntu-
ProcVersionSign
Uname: Linux 4.15.0-153-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.24
Architecture: amd64
Date: Mon Aug 16 19:14:53 2021
InstallationDate: Installed on 2019-08-12 (735 days ago)
InstallationMedia:
SourcePackage: ubuntu-
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in ubuntu-advantage-tools (Ubuntu): | |
status: | Incomplete → Triaged |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
Changed in ubuntu-advantage-tools (Ubuntu): | |
assignee: | nobody → shawn audet (thabeast1) |
Thanks for the bug report. Do you have any interesting details in the log file referenced?
/var/log/ ubuntu- advantage. log
Marking incomplete while we collect information on what's failed.
Thanks!