can't add private ppa raw entry wihout lp login

Bug #2017014 reported by Guillermo Gonzalez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
New
Undecided
Unassigned

Bug Description

When moving a server from focal to jammy, the basic charm layer and charm-helpers assumes add-apt-repository allows adding bare/raw source list lines.

While running somtething like:

add-apt-repository --yes "deb https://user:<email address hidden>/owner/ppa-name/ubuntu jammy main"

it fails with:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 364, in <module>
    sys.exit(0 if addaptrepo.main() else 1)
  File "/usr/bin/add-apt-repository", line 357, in main
    shortcut.add()
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 222, in add
    self.add_key()
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 398, in add_key
    if not all((self.trustedparts_file, self.trustedparts_content)):
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 141, in trustedparts_content
    key = self.lpppa.getSigningKeyData()
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 592, in __call__
    response, content = self.root._browser._request(
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 429, in _request
    raise error
lazr.restfulclient.errors.Unauthorized: HTTP Error 401: Unauthorized
Response headers:
---
-content-encoding: gzip
content-length: 78
content-security-policy: frame-ancestors 'self';
content-type: text/plain;charset=utf-8
date: Wed, 19 Apr 2023 13:36:06 GMT
server: gunicorn
status: 401
strict-transport-security: max-age=15552000
vary: Accept,Accept-Encoding
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-launchpad-revision: 473868c1cc6b58a9bc722c23840374c93a7a274b
x-lazr-notifications: []
x-powered-by: Zope (www.zope.org), Python (www.python.org)
x-request-id: 7744610e-481a-4489-ad5b-e9288c8b7588
x-vcs-revision: 473868c1cc6b58a9bc722c23840374c93a7a274b
x-xss-protection: 1; mode=block
---
Response body:
---
b"(<Archive at 0x7f23f8b32a30>, 'getSigningKeyData', 'launchpad.SubscriberView')"

I think is is an unhandled error in the PPAShortcutHandler and it should continue to the next one in the loop at, at least as the uri is not a `ppa:` one, see: https://git.launchpad.net/ubuntu/+source/software-properties/tree/softwareproperties/shortcuts.py?id=2bac9c4702ca203e4a2a5c12f00f50a223251e2d

Tags: jammy
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Looked at the a bit closer and it seems that the PPAShortcutHandler is trying to handle the above raw sources.list line and trying to contact launchpad.

In this setup, which is quite common for servers, the charm takes care of calling add-apt-repository but also handles the GPG keys on it's own.

description: updated
Ken Sharp (kennybobs)
tags: added: jammy
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.