← Back to team overview

touch-packages team mailing list archive

[Bug 1537056] [NEW] apt-add-repository always returns "user or team does not exist." for ppa repos

 

Public bug reported:

I have just installed a fresh Ubuntu 15.10 to my machine and run into
trouble with adding ppa repositories using apt-add-repository:

for e.g. running 
apt-add-repository ppa:git-core/ppa
Cannot add PPA: 'ppa:~git-core/ubuntu/ppa'.
ERROR: '~git-core' user or team does not exist.

After debugging a lot of code, I found the trouble, the used proxy-
server needs authentification but the apt-add-repository does not throw
a correct error message fro this case:

The PPAException raised here seems to be interpreted as not available,
which is rather hard to debug.

def _get_https_content_py3(lp_url):
    print("RETRIEVING URL: %s"%lp_url)
    try:
        request = urllib.request.Request(str(lp_url), headers={"Accept":" application/json"})
        lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT)
        json_data = lp_page.read().decode("utf-8", "strict")
        print("    RV: %s"%str(json_data))
    except (URLError, HTTPException) as e:
        # HTTPException doesn't have a reason but might have a string
        # representation
        print(e)
        reason = hasattr(e, "reason") and e.reason or e
        raise PPAException("Error reading %s: %s" % (lp_url, reason), e)

The last print(e) gives me the hint what went wrong:
<urlopen error Tunnel connection failed: 407 Proxy Authorization Required>

For the future it would be great to get a correct error message.

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

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to software-properties in
Ubuntu.
https://bugs.launchpad.net/bugs/1537056

Title:
  apt-add-repository always returns "user or team does not exist." for
  ppa repos

Status in software-properties package in Ubuntu:
  New

Bug description:
  I have just installed a fresh Ubuntu 15.10 to my machine and run into
  trouble with adding ppa repositories using apt-add-repository:

  for e.g. running 
  apt-add-repository ppa:git-core/ppa
  Cannot add PPA: 'ppa:~git-core/ubuntu/ppa'.
  ERROR: '~git-core' user or team does not exist.

  After debugging a lot of code, I found the trouble, the used proxy-
  server needs authentification but the apt-add-repository does not
  throw a correct error message fro this case:

  The PPAException raised here seems to be interpreted as not available,
  which is rather hard to debug.

  def _get_https_content_py3(lp_url):
      print("RETRIEVING URL: %s"%lp_url)
      try:
          request = urllib.request.Request(str(lp_url), headers={"Accept":" application/json"})
          lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT)
          json_data = lp_page.read().decode("utf-8", "strict")
          print("    RV: %s"%str(json_data))
      except (URLError, HTTPException) as e:
          # HTTPException doesn't have a reason but might have a string
          # representation
          print(e)
          reason = hasattr(e, "reason") and e.reason or e
          raise PPAException("Error reading %s: %s" % (lp_url, reason), e)

  The last print(e) gives me the hint what went wrong:
  <urlopen error Tunnel connection failed: 407 Proxy Authorization Required>

  For the future it would be great to get a correct error message.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/1537056/+subscriptions