[Bug 1965180] Re: apt-add-repository requires --login for private repos, breaking automated workflows
Launchpad Bug Tracker
1965180 at bugs.launchpad.net
Mon Apr 4 16:20:02 UTC 2022
This bug was fixed in the package software-properties - 0.99.22
---------------
software-properties (0.99.22) jammy; urgency=medium
* If add-apt-repository is passed a complete soures.list line don't require
the --login option as that breaks automated setups. Thanks to Dan
Streetman for the fix. (LP: #1965180)
-- Brian Murray <brian at ubuntu.com> Fri, 01 Apr 2022 11:48:01 -0700
** Changed in: software-properties (Ubuntu Jammy)
Status: In Progress => Fix Released
--
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/1965180
Title:
apt-add-repository requires --login for private repos, breaking
automated workflows
Status in software-properties package in Ubuntu:
Fix Released
Status in software-properties source package in Jammy:
Fix Released
Bug description:
On Focal, in an automated environment (such as a launchpad builder), a
used can do the following workflow:
curl
"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x${FINGERPRINT}"
--output /etc/apt/trusted.gpg.d/${FINGERPRINT}.asc
apt-add-repository "deb https://${USERNAME}:${PASSWORD}@private-
ppa.launchpad.net/${REPO}/ubuntu focal main"
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Get:5 https://private-ppa.launchpad.net/$REPO/ubuntu focal InRelease [24.3 kB]
Get:6 https://private-ppa.launchpad.net/$REPO/ubuntu focal/main amd64 Packages [3288 B]
Get:7 https://private-ppa.launchpad.net/$REPO/ubuntu focal/main Translation-en [1892 B]
However, on Jammy, I get the following:
curl "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x${FINGERPRINT}" --output /etc/apt/trusted.gpg.d/${FINGERPRINT}.asc
apt-add-repository "deb https://${USERNAME}:${PASSWORD}@private-
ppa.launchpad.net/${REPO}/ubuntu jammy main"
Repository: 'deb https://private-ppa.launchpad.net/$REPO/ubuntu jammy main'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 105, in lpppa
self._lpppa = self.lpteam.getPPAByName(name=self.ppaname)
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.NotFound: HTTP Error 404: Not Found
Response headers:
---
-content-encoding: gzip
content-length: 91
content-type: text/plain;charset=utf-8
date: Wed, 16 Mar 2022 19:54:16 GMT
server: gunicorn/19.8.1
status: 404
vary: Accept-Encoding
x-powered-by: Zope (www.zope.org), Python (www.python.org)
x-request-id: ec4bd7ff-f333-4543-ba91-3b7b063fab0e
x-vcs-revision: 81acd06336f3c4be8f28a2213f7a64912593402d
---
Response body:
---
b"Object: <lp.systemhomes.WebServiceApplication object at 0x7f9652248978>, name: '$REPO'"
---
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/apt-add-repository", line 364, in <module>
sys.exit(0 if addaptrepo.main() else 1)
File "/usr/bin/apt-add-repository", line 352, in main
self.prompt_user_shortcut(shortcut)
File "/usr/bin/apt-add-repository", line 140, in prompt_user_shortcut
if shortcut.description:
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 117, in description
return self.lpppa.description
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 109, in lpppa
raise ShortcutException(msg)
softwareproperties.shortcuthandler.ShortcutException: ERROR: ppa '$REPO/proposed' not found (use --login if private)
Impish similarly breaks. Digging through changelogs, I see various
entries in Impish forward, starting with version 0.99.0 where a
refactor was done.
using `--login` is not possible in an automated setup (such as a
builder) as it starts an OAuth dance, which requires human
interaction. this will break existing automation utilizing apt-add-
repository for users when migrating to Jammy
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/1965180/+subscriptions
More information about the foundations-bugs
mailing list