Public bug reported:

When I run `add-apt-repository ppa:maas/stable` I get a python
traceback.

What I expected to happen:
An error message saying that I'm not authorized.

What actually happened:
Output:
```
ubuntu@maas-deb:/root$ sudo add-apt-repository ppa:maas/stable
PPA publishes dbgsym, you may need to include 'main/debug' component
Repository: 'Types: deb
URIs: https://ppa.launchpadcontent.net/maas/stable/ubuntu/
Suites: noble
Components: main
'
Description:
tag:launchpad.net:2008:redacted
More info: https://launchpad.net/~maas/+archive/ubuntu/stable
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 452, in <module>
    sys.exit(0 if addaptrepo.main() else 1)
                  ^^^^^^^^^^^^^^^^^
  File "/usr/bin/add-apt-repository", line 445, in main
    shortcut.add()
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", 
line 226, in add
    self.add_source()
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", 
line 316, in add_source
    self._add_deb822_source()
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", 
line 265, in _add_deb822_source
    if self.trustedparts_content:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 154, in 
trustedparts_content
    key = self.lpppa.getSigningKeyData()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 
642, in __call__
    response, content = self.root._browser._request(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 
484, in _request
    raise error
lazr.restfulclient.errors.Unauthorized: HTTP Error 401: Unauthorized
Response headers:
---
-content-encoding: gzip
content-length: 67
content-security-policy: frame-ancestors 'self';
content-type: text/plain;charset=utf-8
date: Fri, 07 Mar 2025 08:54:07 GMT
server: gunicorn
status: 401
strict-transport-security: max-age=15552000
transfer-encoding: chunked
vary: Accept,Accept-Encoding
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-launchpad-revision: aa29ae0fff49e4e804b39147c9f259d2fb023199
x-lazr-notifications: []
x-powered-by: Zope (www.zope.org), Python (www.python.org)
x-request-id: 30829ea9-c510-4219-ae2f-640053954575
x-vcs-revision: aa29ae0fff49e4e804b39147c9f259d2fb023199
x-xss-protection: 1; mode=block
---
Response body:
---
b"(<Archive object>, 'getSigningKeyData', 'launchpad.SubscriberView')"
---

```

Ubuntu release: Ubuntu 24.04.2 LTS
Package version:
```
$ apt-cache policy software-properties-common
software-properties-common:
  Installed: 0.99.49.1
  Candidate: 0.99.49.1
  Version table:
 *** 0.99.49.1 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.99.48 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
```

** Affects: software-properties (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to software-properties in
Ubuntu.
https://bugs.launchpad.net/bugs/2101141

Title:
  Python traceback in add-apt-repository

Status in software-properties package in Ubuntu:
  New

Bug description:
  When I run `add-apt-repository ppa:maas/stable` I get a python
  traceback.

  What I expected to happen:
  An error message saying that I'm not authorized.

  What actually happened:
  Output:
  ```
  ubuntu@maas-deb:/root$ sudo add-apt-repository ppa:maas/stable
  PPA publishes dbgsym, you may need to include 'main/debug' component
  Repository: 'Types: deb
  URIs: https://ppa.launchpadcontent.net/maas/stable/ubuntu/
  Suites: noble
  Components: main
  '
  Description:
  tag:launchpad.net:2008:redacted
  More info: https://launchpad.net/~maas/+archive/ubuntu/stable
  Adding repository.
  Press [ENTER] to continue or Ctrl-c to cancel.
  Traceback (most recent call last):
    File "/usr/bin/add-apt-repository", line 452, in <module>
      sys.exit(0 if addaptrepo.main() else 1)
                    ^^^^^^^^^^^^^^^^^
    File "/usr/bin/add-apt-repository", line 445, in main
      shortcut.add()
    File 
"/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 
226, in add
      self.add_source()
    File 
"/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 
316, in add_source
      self._add_deb822_source()
    File 
"/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 
265, in _add_deb822_source
      if self.trustedparts_content:
         ^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 154, 
in trustedparts_content
      key = self.lpppa.getSigningKeyData()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 
642, in __call__
      response, content = self.root._browser._request(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 
484, in _request
      raise error
  lazr.restfulclient.errors.Unauthorized: HTTP Error 401: Unauthorized
  Response headers:
  ---
  -content-encoding: gzip
  content-length: 67
  content-security-policy: frame-ancestors 'self';
  content-type: text/plain;charset=utf-8
  date: Fri, 07 Mar 2025 08:54:07 GMT
  server: gunicorn
  status: 401
  strict-transport-security: max-age=15552000
  transfer-encoding: chunked
  vary: Accept,Accept-Encoding
  x-content-type-options: nosniff
  x-frame-options: SAMEORIGIN
  x-launchpad-revision: aa29ae0fff49e4e804b39147c9f259d2fb023199
  x-lazr-notifications: []
  x-powered-by: Zope (www.zope.org), Python (www.python.org)
  x-request-id: 30829ea9-c510-4219-ae2f-640053954575
  x-vcs-revision: aa29ae0fff49e4e804b39147c9f259d2fb023199
  x-xss-protection: 1; mode=block
  ---
  Response body:
  ---
  b"(<Archive object>, 'getSigningKeyData', 'launchpad.SubscriberView')"
  ---

  ```

  Ubuntu release: Ubuntu 24.04.2 LTS
  Package version:
  ```
  $ apt-cache policy software-properties-common
  software-properties-common:
    Installed: 0.99.49.1
    Candidate: 0.99.49.1
    Version table:
   *** 0.99.49.1 500
          500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
          100 /var/lib/dpkg/status
       0.99.48 500
          500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/2101141/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to