[Bug 2017014] Re: can't add private ppa raw entry wihout lp login
Guillermo Gonzalez
2017014 at bugs.launchpad.net
Wed Apr 19 17:31:03 UTC 2023
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 changed:
+ 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:secrets@private-
ppa.launchpad.net/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
+ 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
+ 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
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to software-properties in Ubuntu.
https://bugs.launchpad.net/bugs/2017014
Title:
can't add private ppa raw entry wihout lp login
Status in software-properties package in Ubuntu:
New
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:secrets@private-
ppa.launchpad.net/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
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/2017014/+subscriptions
More information about the foundations-bugs
mailing list