apt-add-repository returns "user or team does not exist." when erroring out due to proxy auth needed

Bug #1537056 reported by Sven
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Confirmed
Low
Unassigned

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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-properties (Ubuntu):
status: New → Confirmed
Revision history for this message
James Lewis (james-fsck) wrote :

Just encountered this bug in 16.10, it reported the exact "user or team does not exist." error, until I added a system wide proxy.

Revision history for this message
Ashish (ashish235) wrote :

Hi @james,

Can you tell how did you add "system wide proxy"? I 'm having this issue too on 16.04.

Revision history for this message
nPatel (narendrapatel) wrote :

Just upgraded Ubuntu 16.04 LTS to 18.04.1 LTS. PPA that i added in previous version, can't add it in newer and result is same as mentioned by others "user or team does not exist."

Revision history for this message
sun (leiiiiiiiiiiiiii) wrote :

Hi,How did you finally solve this problem?
i am in add
sudo -E add-apt-repository ppa:mosquitto-dev/mosquitto-ppa
exception message:
Cannot add PPA: 'ppa:~mosquitto-dev/ubuntu/mosquitto-ppa'.
ERROR: '~mosquitto-dev' user or team does not exist.

summary: - apt-add-repository always returns "user or team does not exist." for ppa
- repos
+ apt-add-repository returns "user or team does not exist." when erroring
+ out due to proxy auth needed
Changed in software-properties (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.