Ubuntu

version upgrade via update-manager or do-release-upgrade does not work with proxy authentication

Reported by Henning Moll on 2009-11-09
72
This bug affects 13 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Medium
Unassigned
Karmic
Medium
Unassigned
Lucid
Medium
Unassigned

Bug Description

Binary package hint: update-manager

My system (Ubuntu 9.10) is behind a proxy which requires authentication. The credentials are stored in gconf. I always checked the correctness of environment variable http_proxy before running a command from command line.Normal actions in update-manager (1:0.111.9) work. I am able to get normal package updates. So in this part, update-manger handles my auth-proxy correctly. Without the credentials, the proxy would not handle any requests.

But i am not able to do a distribution upgrade, neither with update-manager nor do-release-upgrade. update-manager does not show the notification "a new version of ubuntu...", do-release-upgrade fails with:

$ sudo env | grep http_proxy; sudo /usr/bin/do-release-upgrade
 [sudo] password for user:
 http_proxy=http://user:<email address hidden>:3128/
 Checking for a new ubuntu release
 No new release found

The jaunty-proposed package 1:0.111.10 does not solve my problem. The notification "a new version of ubuntu..." is still not shown.
There are some patches in bug report #446552 which help a bit:
Both of Michaels patches (applied on 1:0.111.9) solve my problem for the gui update-manager. But both did not help for do-release-update.
The reason for failing on do-release-update is, that the problem is - at least partially - independend of url_downloadable. One problem exists in /usr/share/pyshared/UpdateManager/Core/MetaRelease.py around line 251. The code generates
 407: ('Proxy Authentication Required', 'You must authenticate with this proxy before proceeding.'), So i assume that the fix of the patch has to be applied on more places.

Michael Vogt (mvo) on 2009-11-13
Changed in update-manager (Ubuntu Karmic):
status: New → Confirmed
importance: Undecided → Medium
Changed in update-manager (Ubuntu Lucid):
status: New → Confirmed
importance: Undecided → Medium
milestone: none → lucid-alpha-1
Michael Vogt (mvo) on 2009-12-09
Changed in update-manager (Ubuntu Lucid):
milestone: lucid-alpha-1 → lucid-alpha-2
Bruce Labitt (bdlabitt) wrote :

This bug is present in Jaunty. I am behind a proxy and use ntlmaps-0.9.9.0.1 to get through our corporate proxy.
Normal updates function correctly thru the proxy.

update-manager version = 1:0.111.10

update-manager does not show an upgrade option 'button'
Software Sources >> Updates >> Release upgrade is selected to "Normal releases"

$ sudo env | grep http_proxy; sudo /usr/bin/do-release-upgrade
http_proxy=http://127.0.0.1:5865/ <== my ntlmaps proxy
Checking for a new ubuntu release
No new release found

Is there a workaround for upgrading from jaunty to karmic?
an apt file to edit? global replace jaunty with karmic ?

Michael Vogt (mvo) on 2010-01-14
Changed in update-manager (Ubuntu Lucid):
milestone: lucid-alpha-2 → lucid-alpha-3
Steve Langasek (vorlon) on 2010-02-26
Changed in update-manager (Ubuntu Lucid):
milestone: lucid-alpha-3 → ubuntu-10.04-beta-1
Fabio Isgrò (dr.gogeta86) wrote :

For me doesn't work at al behind a M$ ISA server authenticated or not

Steve Langasek (vorlon) on 2010-03-19
Changed in update-manager (Ubuntu Lucid):
milestone: ubuntu-10.04-beta-1 → ubuntu-10.04-beta-2
Barry Warsaw (barry) wrote :

Does this affect Lucid's version of Update Manager, i.e. 1:0.133.11? By my testing, both update-manager and do-release-upgrade are going through the proxy when set via the environment variable.

Barry Warsaw (barry) wrote :

I'm marking this as incomplete for Lucid because I've confirmed that the proxies work as expected. So barring additional information I do not believe this affects Lucid any more.

Changed in update-manager (Ubuntu Lucid):
status: Confirmed → Invalid
milestone: ubuntu-10.04-beta-2 → none
status: Invalid → Incomplete

FWIW I attached a patch to to bug #446552 that rewrites url_downloadable use urllib2 which may (should I think) fix this bug as well. It was mentioned that a urllib2 based fix was more ideal than the environment based workaround, but I suppose if it's working, it's working.

http://launchpadlibrarian.net/37562858/use-urllib2-in-url_downloadable-3.diff

Helge Stenström (h-stenstrom) wrote :

Maybe this bug affects me too. My computer used to be a desktop, but I've removed screen and keyboard, so I guess it's a server. It's behind a proxy that doesn't require authentication. I log in to the computer on the intranet using ssh.

Nothing happens in at least 10 minutes after

helge@ws4370:~$ sudo do-release-upgrade
[sudo] password for helge:
Checking for a new ubuntu release

so I abort using ctrl-C, and get:

^CTraceback (most recent call last):
  File "/usr/bin/do-release-upgrade", line 61, in <module>
    fetcher.run()
  File "/usr/lib/python2.6/dist-packages/UpdateManager/Core/DistUpgradeFetcherCore.py", line 235, in run
    if not self.fetchDistUpgrader():
  File "/usr/lib/python2.6/dist-packages/UpdateManager/Core/DistUpgradeFetcherCore.py", line 203, in fetchDistUpgrader
    uri = self._expandUri(self.new_dist.upgradeToolSig)
  File "/usr/lib/python2.6/dist-packages/UpdateManager/Core/DistUpgradeFetcherCore.py", line 178, in _expandUri
    new_uri = self.mirror_from_sources_list(uri, self.DEFAULT_MIRROR)
  File "/usr/lib/python2.6/dist-packages/UpdateManager/Core/DistUpgradeFetcherCore.py", line 164, in mirror_from_sources_list
    if url_downloadable(mirror_uri, self._debug):
  File "/usr/lib/python2.6/dist-packages/UpdateManager/Core/utils.py", line 105, in url_downloadable
    c.request("HEAD", path)
  File "/usr/lib/python2.6/httplib.py", line 898, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.6/httplib.py", line 935, in _send_request
    self.endheaders()
  File "/usr/lib/python2.6/httplib.py", line 892, in endheaders
    self._send_output()
  File "/usr/lib/python2.6/httplib.py", line 764, in _send_output
    self.send(msg)
  File "/usr/lib/python2.6/httplib.py", line 723, in send
    self.connect()
  File "/usr/lib/python2.6/httplib.py", line 704, in connect
    self.timeout)
  File "/usr/lib/python2.6/socket.py", line 507, in create_connection
    sock.connect(sa)
  File "<string>", line 1, in connect
KeyboardInterrupt
helge@ws4370:~$

When I used the update-manager, regular updates went fine, but when I clicked the Upgrade button for the new release (10.04 LTS), the program stopped responding. When aborted with ctrl-c, I got a similar printout.

I have http_proxy and ftp_proxy set:
helge@ws4370:~$ env |grep proxy
http_proxy=http://example.com:8080
ftp_proxy=http://example.com:8080

(but not to example.com, actually)

Same issue here as Helge's. Behind a non-authenticating proxy, I get the Upgrade button but update-manager freezes when clicked. Do-release-upgrade stuck at 'Checking new release'. As always, ftp/http/https proxies properly set in env as well as in Proxies.

Henning Moll (drscott) wrote :

I also confirm that the problem is (meanwhile?) independent of a proxy having authentication or not. I tested both cases.

do-release-upgrade works (!), but it needs ages directly after the start. In my opinion it is waiting for a timeout.

The problem lies still in url_downloadable. If this function returns false, do-release-upgrade falls back to the main server. The remaining part of the application runs happily (and fast) with that fallback.

url_downloadable seems to block on some systems, waiting for a timeout. Thus it may last a very long time before the programm continoues. Maybe this depends on the network or the proxy or its configuration.

The fallback code exists in _expandUri. Modifiying the code that it always just returns the fallback server (= it doesn't use url_downloadable directly or indirectly anymore) resolves the problem immediately.

The patch from Thomas (#5) also works, but in my opinion it removes the support of ftp uris?

Changed in update-manager (Ubuntu Lucid):
status: Incomplete → Confirmed
Henning Moll (drscott) wrote :

The karmic-proposed package of update-manager seems to also fix this. See bug #446552

Stefan Sauer (ensonic) wrote :

I face the same problem when upgrading from karmic to lucid. The change proposed in comment #5 gets me going.

It needs a small modification though - the finally: clause is wrong:
  File "/usr/lib/python2.6/dist-packages/UpdateManager/Core/utils.py", line 113, in url_downloadable
    resp.close()

7oby (tobias-hain) wrote :

Bug is still present in Ubuntu 10.10 Maverick when trying to Upgrade to 11.04 Natty.

Proxy: without Authentication
Proxy Settings: Only present in System settings - not using environment variables
Didn't try suggested fix in #5 since I discovered the bug after successfully upgrading w/o proxy.

Changed in update-manager (Ubuntu Karmic):
status: Confirmed → Fix Committed
Changed in update-manager (Ubuntu Lucid):
status: Confirmed → Fix Committed
Changed in update-manager (Ubuntu):
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers