Real connectivity error is hidden from a user when PPA is added: ERROR: '~anonymous' user or team does not exist.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
software-properties (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
This is common in an environment where a proxy server is not properly configured via HTTP_PROXY or HTTPS_PROXY and you need to add a PPA.
The error is very cryptic unless you look at the code:
sudo add-apt-repository ppa:anonymous/
Cannot add PPA: 'ppa:~anonymous
ERROR: '~anonymous' user or team does not exist.
Code path:
def _get_suggested_
try:
msg = []
try:
try:
except PPAException:
....
def get_info_
if NEED_PYCURL:
# python2 has no cert verification so we need pycurl
return _get_https_
else:
# python3 has cert verification so we can use the buildin urllib
return _get_https_
...
def _get_https_
# this is the fallback code for python2
try:
callback = CurlCallback()
curl = pycurl.Curl()
if LAUNCHPAD_PPA_CERT:
json_data = callback.contents
except pycurl.error as e: # <--- if this errors out due to connectivity
raise PPAException("Error reading %s: %s" % (lp_url, e), e)
return json.loads(
description: | updated |
This will most likely also be triggered in the case when a self-signed CA is used to sign an https proxy server certificate.