pro attach failed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
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 | ||
Lunar |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
Accounts with unicode characters in their contract information are unable to run `pro status` if their terminal doesn't support unicode characters, which is also the last step of a `pro attach`. Attaches should still work, but it is impossible to confirm because `pro status` doesn't work.
The fix is to ignore unicode characters when printing the output of `pro status` if python.
[ Test Plan ]
Recreate the bug:
Start a bionic container and perform the following to insert a unicode character into the account name and try to run status with a locale that causes python to try to print only ascii (note this only affects xenial and bionic - on focal and later python will still treat output as utf-8)
```
pro attach $TOKEN
sed -i 's/"name": "[a-zA-Z ]\+"/"name": "ü"/g' /var/lib/
LC_CTYPE=
# see crash
```
To see the fix, install the new version (currently in staging PPA, but for SRU verification it will be in -proposed) and try again
```
add-apt-repository ppa:ua-
apt install ubuntu-
LC_CTYPE=
# no crash - unicode character is not printed
```
[ Where problems could occur ]
This works by ignoring non-ascii characters when python thinks the stdout encoding is something other than utf-8. This could result in not printing unicode characters in some situations where it would actually be okay.
Since we're ignoring unicode characters in these situations, we could misrepresent certain strings, such as account names. This could be confusing.
[ Original Description ]
# lsb_release -rd
Description: Ubuntu 18.04.6 LTS
Release: 18.04
# pro --version
27.14.4~18.04
I wanted to attach the server to our new Ubuntu pro subscribtion. so I run:
# pro attach <MY_TOKEN>
that fails with:
["2023-
o": "Traceback (most recent call last):\n File \"/usr/
wrapper\n return func(*args, **kwargs)\n File \"/usr/
then as suggested I run
# pro status
Unexpected error(s) occurred.
For more details, see the log: /var/log/
To file a bug run: ubuntu-bug ubuntu-
and created a bug using ubuntu-bug ubuntu-
let me know if you need more info
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: ubuntu-
ProcVersionSign
Uname: Linux 4.15.0-210-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.9-0ubuntu7.29
Architecture: amd64
Date: Mon May 15 15:52:17 2023
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
SHELL=/bin/bash
SourcePackage: ubuntu-
UpgradeStatus: Upgraded to bionic on 2023-03-30 (46 days ago)
cloud-id.txt-error: Error: path contained symlinks.
livepatch-
ua-status.json: Error: path contained symlinks.
uaclient.conf: Error: path contained symlinks.
ubuntu-
ubuntu-
information type: | Private → Public |
tags: | removed: need-amd64-retrace |
description: | updated |
Hi vspano,
Thanks for reporting this bug. We will make the Pro client more robust to this type of errors. But just to see if we can create a better test case for this issue, which language pack are you using in the machine ? I just want to double if the problem might be related to this