Public bug reported:

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

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

-- 
You received this bug notification because you are a member of Desktop
Packages, 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:
  New

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


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

Reply via email to