"sudo pro attach <token>" fails

Bug #2058560 reported by gauss
78
This bug affects 10 people
Affects Status Importance Assigned to Milestone
ubuntu-advantage-tools (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

What happened.
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

What was expected.
Ubuntu pro free subscription would be attached to my box.

$ lsb_release -rd
Description: Ubuntu 22.04.4 LTS
Release: 22.04

$ apt-cache policy ubuntu-advantage-tools
ubuntu-advantage-tools:
  Installed: 31.2~22.04
  Candidate: 31.2~22.04
  Version table:
 *** 31.2~22.04 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages
        100 /var/lib/dpkg/status
     27.7~22.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: ubuntu-advantage-tools 31.2~22.04
ProcVersionSignature: Ubuntu 5.15.0-100.110-generic 5.15.143
Uname: Linux 5.15.0-100-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: KDE
Date: Wed Mar 20 16:16:31 2024
InstallationDate: Installed on 2019-10-02 (1630 days ago)
InstallationMedia: Ubuntu 18.04.3 LTS "Bionic Beaver" - Release amd64 (20190805)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ubuntu-advantage-tools
UpgradeStatus: Upgraded to jammy on 2023-12-13 (98 days ago)
apparmor_logs.txt:
 Mar 20 13:58:55 noether kernel: audit: type=1400 audit(1710961135.168:108): apparmor="DENIED" operation="change_onexec" info="label not found" error=-2 profile="unconfined" name="ubuntu_pro_apt_news" pid=4679 comm="(python3)"
 Mar 20 13:59:32 noether kernel: audit: type=1400 audit(1710961172.848:172): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ubuntu_pro_apt_news" pid=6835 comm="apparmor_parser"
 Mar 20 16:03:38 noether kernel: audit: type=1400 audit(1710968618.235:310): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="ubuntu_pro_apt_news" pid=28811 comm="apparmor_parser"
 Mar 20 16:08:14 noether kernel: audit: type=1400 audit(1710968894.418:311): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="ubuntu_pro_apt_news" pid=29434 comm="apparmor_parser"
cloud-id.txt-error: Invalid command specified 'cloud-id'.
ua-status.json-error: Failed running command 'pro status --format json' [exit(1)]. Message:
uaclient.conf:
 contract_url: https://contracts.canonical.com
 log_level: debug

Revision history for this message
gauss (gauss) wrote :
information type: Private → Public
tags: removed: need-amd64-retrace
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-advantage-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I think your attach command happened during a downtime of the Pro service:

["2024-03-20T16:11:17.029", "DEBUG", "ubuntupro.http", "readurl", 389, "URL [POST] response: https://contracts.canonical.com/v1/context/machines/token, headers: {'connection': 'close', 'content-length': '186', 'content-type': 'text/html', 'date': 'Wed, 20 Mar 2024 21:11:16 GMT', 'server': 'nginx/1.18.0 (Ubuntu)'}, data: <html>\r\n<head><title>500 Internal Server Error</title></head>\r\n<body>\r\n<center><h1>500 Internal Server Error</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n", {}]

Would you mind trying again please?

Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

We should have a better message for when this kind of thing happens, so people are not confused.

Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

Confirmed this error happened because we had an unexpected outage on contracts.canonical.com.
I have checked the functionality now, and everything should work fine.
Many other bugs were filed at the same time window, and I am marking them duplicates of this one for easier tracking.

- We apologise for the trouble and kindly ask anyone who have hit this to try again now
- We are going to improve the error message to reduce FUD

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.