add-apt-repository doesn't work behind a proxy [Ubuntu 12.04]

Bug #994569 reported by Eduard Gotwig
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Fix Released
Medium
Louis Bouchard

Bug Description

Using Ubuntu 12.04 in Virtual Box:

The software is unusable behind a proxy:

It simply waits and waits, but does get nothing.

I already got the proxy set up in "Networks" in the control center, for https.

To fix , set the https_proxy variable

https_proxy=http://www.example.com:8000/

Please also see: https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/516032

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
Michael Backhaus (mb4ckhaus) wrote :

same issue here with 12.04, though not in a virtual machine but native. env variables are set and ppa.py url entry is default with :80 by now.

Eduard Gotwig (gotwig)
summary: - add-apt-repository doesn't work behind a proxy [Ubuntu 12.10]
+ add-apt-repository doesn't work behind a proxy [Ubuntu 12.04]
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Setting up a proxy in Gnome should properly configure the https_proxy environment variable. It should be visible in /etc/environment. Is that not the case?

Furthermore, I think this is likely to have been fixed in 12.10 with switching from libcurl to urllib to retrieve data for add-apt-repository; it would be very helpful if someone could try this out on a Live CD and behind a proxy to see if the behavior has improved.

Thanks!

Changed in software-properties (Ubuntu):
status: Confirmed → Incomplete
importance: Undecided → Medium
janakaravi (janakaravi)
Changed in software-properties (Ubuntu):
assignee: nobody → janakaravi (janakaravi)
status: Incomplete → Fix Committed
Revision history for this message
Eduard Gotwig (gotwig) wrote :

So has it been fixed in 12.10 or 12.04? Please see the title of the bug report!

If its fixed in 12.10, it would be good to backport this fix!

janakaravi (janakaravi)
Changed in software-properties (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

@janakaravi - please provide some evidence regarding how this is fixed. For example a test you took to verify that comment #3 is in fact correct. Thanks!

Changed in software-properties (Ubuntu):
status: Fix Released → Incomplete
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

janakaravi: please don't assign yourself to bugs unless you plan to work on them and provide a patch for the issue.

Looks to me like add-apt-repository works just fine behind even a very restrictive proxy; however there is a catch (but not something that can be worked around in code, or that should be worked around in code).

add-apt-repository itself requires the https_proxy variable to be able to access Launchpad and get information about the PPAs, such as their descriptions, signing key, etc.

However, the *http_proxy* variable is also required, because that's what gets used by apt-key/gpg to retrieve the GPG keys signing the PPA packages.

I'll mark this as Fix Released for Quantal since it's clearly working properly; and open a task for Precise set to Incomplete until I or the original reporter can re-test on Precise with http_proxy set.

It's possible any other issues may come from sudo clearing some environment variables it shouldn't, but that should already have been fixed in Quantal and Precise.

Changed in software-properties (Ubuntu):
assignee: janakaravi (janakaravi) → nobody
status: Incomplete → Fix Released
Changed in software-properties (Ubuntu Precise):
status: New → Incomplete
importance: Undecided → Medium
Louis Bouchard (louis)
Changed in software-properties (Ubuntu Precise):
assignee: nobody → Louis Bouchard (louis-bouchard)
status: Incomplete → Fix Released
Revision history for this message
Louis Bouchard (louis) wrote :

After confirming with Mathieu, I have verified that setting both http_proxy and https_proxy environment variables will allow add-apt-repository to work as expected.

Here is an example :

root@PreciseS-kdump:~# export http_proxy="http://10.1.1.3:3128"
root@PreciseS-kdump:~# add-apt-repository -r ppa:canonical-support/support-tools
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 125, in <module>
    ppa_info = get_ppa_info_from_lp(user, ppa_name)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 84, in get_ppa_info_from_lp
    curl.perform()
pycurl.error: (7, "couldn't connect to host")
root@PreciseS-kdump:~# export https_proxy="http://10.1.1.3:3128"
root@PreciseS-kdump:~# add-apt-repository -r ppa:canonical-support/support-tools
You are about to remove the following PPA from your system:
 Data collection and diagnostic tools useful for technical support
 More info: https://launchpad.net/~canonical-support/+archive/support-tools
Press [ENTER] to continue or ctrl-c to cancel removing it

So both http_proxy and https_proxy must be setup to point to the proxy, since the add-apt-repository command itself require this information accessible

I have marked the task "Fix released" as the command works correctly

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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