← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 2019729] Re: pro attach failed

 

This bug was fixed in the package ubuntu-advantage-tools - 28.1~22.10

---------------
ubuntu-advantage-tools (28.1~22.10) kinetic; urgency=medium

  * Backport new upstream release: (LP: #2017949) to kinetic

ubuntu-advantage-tools (28.1) mantic; urgency=medium

  * New upstream release 28.1 (LP: #2017949)
    - fips: ensure shim-signed is updated to the version in the fips repo
      if necessary
    - status: fix bug where an existing status cache could influence the
      simulated status output

ubuntu-advantage-tools (28) mantic; urgency=medium

  * d/ubuntu-advantage-tools.postinst:
    - more specific regex for ua_config warning
  * d/source/lintian-overrides
    - adjust missing-build-dependency-for-dh-addon systemd override to work
      for the different but related error message on jammy onwards
  * New upstream release 28 (LP: #2017949)
    - api:
      + new endpoint: u.pro.status.is_attached.v1
      + new endpoint: u.pro.status.enabled_services.v1
    - apport: collect default log files if present for bug reports
    - apt messaging: add bionic-specific urls
    - auto-attach:
      + check for new Azure UBUNTU_PRO license on-boot of non-pro instances
      + exit 4 if attach succeeds but service enablement fails
    - cli:
      + avoid unnecessary network calls during autocomplete (GH: #2556)
      + warn users to not rely on human-readable output in scripts
    - config: no longer load uaclient.conf from current working directory
    - fix:
      + add support for --no-related flag
      + separate target USN from related USNs
    - general:
      + logs to user cache directory when run as non-root
      + fix bug where non-root commands failed with file permission error
        accessing /tmp/ubuntu-advantage (GH: #2567)
      + use system environment vars by default in sub processes (GH: #2527)
      + fall back to /usr/lib/os-release for release info
      + start logging to default log file until config is loaded
      + remove small timeout from contract checking request
      + avoid crashes when processing unicode text (LP: #2019729)
    - livepatch:
      + use uname.machine for kernel arch when checking support
        (GH: #2517)
      + display tailored warning messages for granular support statuses
    - realtime-kernel: add support for intel-iotg variant
    - reboot-required: new criteria for "yes-kernel-livepatches-applied"
      livepatch status must be either "applied" or "nothing-to-apply" and
      livepatch support status must say "supported"
    - security-status:
      + always show available/installed counts for esm packages
      + include hint to run apt-get update for up-to-date info (GH: #2443)
      + improve visibility of installed and available updates (GH: #2442)
      + change package info message hint to recommend apt-cache show
      + avoids unnecessary network calls (LP: #2015286, GH: #2536)
    - systemd: update service unit for reboot_cmds to not run if not attached
    - status:
      + add hint for pro status --all
      + better message if no services are available (LP: #1994923)
    - timer: only run timer when attached

 -- Grant Orndorff <grant.orndorff@xxxxxxxxxxxxx>  Mon, 26 Jun 2023
20:49:52 -0400

** Changed in: ubuntu-advantage-tools (Ubuntu Lunar)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/2019729

Title:
  pro attach failed

Status in ubuntu-advantage-tools package in Ubuntu:
  Fix Released
Status in ubuntu-advantage-tools source package in Xenial:
  Fix Released
Status in ubuntu-advantage-tools source package in Bionic:
  Fix Released
Status in ubuntu-advantage-tools source package in Focal:
  Fix Released
Status in ubuntu-advantage-tools source package in Jammy:
  Fix Released
Status in ubuntu-advantage-tools source package in Kinetic:
  Fix Released
Status in ubuntu-advantage-tools source package in Lunar:
  Fix Released

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.stdout.encoding is something other than
  "utf-8".

  [ 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/ubuntu-advantage/private/machine-token.json
  LC_CTYPE=es_ES.UTF-8 pro status
  # 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-client/staging
  apt install ubuntu-advantage-tools
  LC_CTYPE=es_ES.UTF-8 pro status
  # 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-05-15T15:49:04.130", "ERROR", "root", "wrapper", 1942, "Unhandled exception, please file a bug", {"exc_inf
  o": "Traceback (most recent call last):\n  File \"/usr/lib/python3/dist-packages/uaclient/cli.py\", line 1886, in
   wrapper\n    return func(*args, **kwargs)\n  File \"/usr/lib/python3/dist-packages/uaclient/cli.py\", line 1994, in main\n    return_value = args.action(args, cfg=cfg)\n  File \"/usr/lib/python3/dist-packages/uaclient/cli.py\", line 1692, in action_status\n    event.info(util.handle_unicode_characters(output))\n  File \"/usr/lib/python3/dist-packages/uaclient/event_logger.py\", line 118, in info\n    print(info_msg, file=file_type, end=end)\nUnicodeEncodeError: 'ascii' codec can't encode character '\\xfc' in position 1002: ordinal not in range(128)"}]

  then as suggested I run

  # pro status
  Unexpected error(s) occurred.
  For more details, see the log: /var/log/ubuntu-advantage.log
  To file a bug run: ubuntu-bug ubuntu-advantage-tools

  and created a bug using ubuntu-bug ubuntu-advantage-tools

  let me know if you need more info

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: ubuntu-advantage-tools 27.14.4~18.04
  ProcVersionSignature: Ubuntu 4.15.0-210.221-generic 4.15.18
  Uname: Linux 4.15.0-210-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportVersion: 2.20.9-0ubuntu7.29
  Architecture: amd64
  Date: Mon May 15 15:52:17 2023
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   SHELL=/bin/bash
  SourcePackage: ubuntu-advantage-tools
  UpgradeStatus: Upgraded to bionic on 2023-03-30 (46 days ago)
  cloud-id.txt-error: Error: path contained symlinks.
  livepatch-status.txt-error: Error: path contained symlinks.
  ua-status.json: Error: path contained symlinks.
  uaclient.conf: Error: path contained symlinks.
  ubuntu-advantage-timer.log: Error: path contained symlinks.
  ubuntu-advantage.log: Error: path contained symlinks.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/2019729/+subscriptions