Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetch.add_source fails for private ppa on jammy #770

Open
verterok opened this issue Apr 19, 2023 · 0 comments · May be fixed by #771
Open

fetch.add_source fails for private ppa on jammy #770

verterok opened this issue Apr 19, 2023 · 0 comments · May be fixed by #771

Comments

@verterok
Copy link

verterok commented Apr 19, 2023

This is related to lp:2017014 (and maybe lp:1991553)

When adding a private ppa via install_sources from https://github.com/stub42/layer-apt, which ends up calling charmhelpers.fetch.add_source 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
---

This is because of changes to add-apt-repository, which now treats evething as a PPA and tries to get information from launchpad via API calls. if the ppa is private, such attemps will fail and here we are now :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant