Bug 35115 - UCC-Setup and UCC-Image UMC modules are not using proxy connection
UCC-Setup and UCC-Image UMC modules are not using proxy connection
Status: CLOSED FIXED
Product: Z_Univention Corporate Client (UCC)
Classification: Unclassified
Component: UMC modules
unspecified
Other Linux
: P5 normal
: UCC 2.0-errata
Assigned To: Alexander Kläser
Moritz Muehlenhoff
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-13 11:02 CEST by Tim Petersen
Modified: 2014-06-18 07:59 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
klaeser: Patch_Available+


Attachments
Patch for correct proxy handling in _get_file_size() (1.89 KB, patch)
2014-06-13 13:05 CEST, Alexander Kläser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Petersen univentionstaff 2014-06-13 11:02:31 CEST
2014061221000375


12.06.14 11:08:17.386  MODULE      ( PROCESS ) : Die Ausführung des Kommandos uccsetup/info ist fehlgeschlagen:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute
    func( request )
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 305, in _response
    result = _multi_response(self, request)
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 432, in _response
    for res in function(self, iterator, *nones):
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 271, in _fake_func
    yield function(self, *args)
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/uccsetup/__init__.py", line 87, in info
    thinclient_image, desktop_image = util.get_latest_ucc_images()
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/uccsetup/util.py", line 359, in get_latest_ucc_images
    online_images = ucc_images.get_latest_online_ucc_image()
  File "/usr/lib/pymodules/python2.6/ucc/images.py", line 769, in get_latest_online_ucc_image
    images = get_online_ucc_images()
  File "/usr/lib/pymodules/python2.6/ucc/images.py", line 738, in get_online_ucc_images
    _get_file_size(UCC_IMAGE_INDEX_FILE)  # throws a HTTPException if URL does not exist
  File "/usr/lib/pymodules/python2.6/ucc/images.py", line 202, in _get_file_size
    connection.request('HEAD', parts.path)
  File "/usr/lib/python2.6/httplib.py", line 914, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.6/httplib.py", line 951, in _send_request
    self.endheaders()
  File "/usr/lib/python2.6/httplib.py", line 908, in endheaders
    self._send_output()
  File "/usr/lib/python2.6/httplib.py", line 780, in _send_output
    self.send(msg)
  File "/usr/lib/python2.6/httplib.py", line 739, in send
    self.connect()
  File "/usr/lib/python2.6/httplib.py", line 720, in connect
    self.timeout)
  File "/usr/lib/python2.6/socket.py", line 561, in create_connection
    raise error, msg
error: [Errno 101] Das Netzwerk ist nicht erreichbar


wget to the ucc-image-url is possible - the http proxy is corretcly set.
If the customer sets an exception in the firewall for direct access to the ucc image download server, then everything works and the images are fetched via proxy connection.
Comment 1 Moritz Muehlenhoff univentionstaff 2014-06-13 11:08:25 CEST
How is the proxy configured? Via a transparent proxy or is it configured in the setings module of the UMC?

The image module was successfully tested using a proxy
Comment 2 Tim Petersen univentionstaff 2014-06-13 11:11:19 CEST
(In reply to Moritz Muehlenhoff from comment #1)
> How is the proxy configured? Via a transparent proxy or is it configured in
> the setings module of the UMC?
> 
> The image module was successfully tested using a proxy


He configured via ucr (proxy/http) like described in the manual -> <http://docs.univention.de/handbuch-3.2.html#computers:Konfiguration_des_Proxyzugriffs>
Comment 3 Alexander Kläser univentionstaff 2014-06-13 13:05:16 CEST
Created attachment 5956 [details]
Patch for correct proxy handling in _get_file_size()

The function _get_file_size() uses httplib which does not handle proxies. I attached a patch which corrects this behaviour by using urrlib2 and registering the proxies in urllib2. (The patch has only been lightly tested, though.)
Comment 4 Alexander Kläser univentionstaff 2014-06-13 17:52:28 CEST
I tested the patch successfully also with proxy authentication. So it seems to be fine.
Comment 5 Alexander Kläser univentionstaff 2014-06-16 14:27:20 CEST
Patch has been submitted, package is being built.

ucc-image-toolkit (2.0.22-1):
* Bug #35115: make sure that proxies are handled correctly when determining
  a file size via HEAD requests
Comment 6 Moritz Muehlenhoff univentionstaff 2014-06-17 09:19:16 CEST
I could successfully download the thin client image using a transparent proxy. The HEAD requests also show up in the access.log now:


1391037247.050     20 10.200.3.125 TCP_MISS/304 264 GET http://updates.software-univention.de/3.2/maintained/3.2-2/i386/Packages.gz - DIRECT/176.9.114.147 -
1391037247.070     20 10.200.3.125 TCP_MISS/304 263 GET http://updates.software-univention.de/3.2/maintained/component/3.2-2-errata/all/Packages.gz - DIRECT/176.9.114.147 -
1391037247.091     20 10.200.3.125 TCP_MISS/304 264 GET http://updates.software-univention.de/3.2/maintained/component/3.2-2-errata/i386/Packages.gz - DIRECT/176.9.114.147 -
1391037284.122     43 10.200.3.125 TCP_MISS/200 384 HEAD http://ucc-images.software-univention.de/download/ucc-images/image-index.txt - DIRECT/176.9.114.147 text/plain
1391037284.146     21 10.200.3.125 TCP_MISS/200 455 GET http://ucc-images.software-univention.de/download/ucc-images/image-index.txt - DIRECT/176.9.114.147 text/plain
1391037284.167     19 10.200.3.125 TCP_MISS/200 337 HEAD http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-thinclient-image.img.xz.spec - DIRECT/176.9.114.147 -
1391037284.205     36 10.200.3.125 TCP_MISS/200 1081 GET http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-thinclient-image.img.xz.spec - DIRECT/176.9.114.147 -
1391037284.234     21 10.200.3.125 TCP_MISS/200 337 HEAD http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-desktop-image.img.xz.spec - DIRECT/176.9.114.147 -
1391037284.262     25 10.200.3.125 TCP_MISS/200 1063 GET http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-desktop-image.img.xz.spec - DIRECT/176.9.114.147 -
1391037284.290     20 10.200.3.125 TCP_MISS/200 348 HEAD http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-thinclient-image.img.xz - DIRECT/176.9.114.147 -
1391037284.312     20 10.200.3.125 TCP_MISS/200 346 HEAD http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-thinclient-image.img.initrd - DIRECT/176.9.114.147 -
1391037284.335     20 10.200.3.125 TCP_MISS/200 368 HEAD http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-thinclient-image.img.md5 - DIRECT/176.9.114.147 application/x-md5
1391037284.356     19 10.200.3.125 TCP_MISS/200 344 HEAD http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-thinclient-image.img.kernel - DIRECT/176.9.114.147 -
1391037284.379     20 10.200.3.125 TCP_MISS/200 338 HEAD http://ucc-images.software-univention.de/download/ucc-images/95ucc-2.0-thinclient-image.img.inst - DIRECT/176.9.114.147 -
Comment 7 Moritz Muehlenhoff univentionstaff 2014-06-17 12:14:22 CEST
When using the proxy in the non-transparent mode (i.e. by configuring it in the "Basic settings" module, HEAD requests are passed to the proxy as well:

n
1391048512.343     48 10.200.3.125 TCP_REFRESH_UNMODIFIED/200 459 GET http://ucc-images.software-univention.de/download/ucc-images/image-index.txt - DIRECT/176.9.114.147 text/plain
1391048512.391     46 10.200.3.125 TCP_REFRESH_UNMODIFIED/200 341 HEAD http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-thinclient-image.img.xz.spec - DIRECT/176.9.114.147 -
1391048512.438     45 10.200.3.125 TCP_REFRESH_UNMODIFIED/200 1085 GET http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-thinclient-image.img.xz.spec - DIRECT/176.9.114.147 -
1391048512.490     45 10.200.3.125 TCP_REFRESH_UNMODIFIED/200 341 HEAD http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-desktop-image.img.xz.spec - DIRECT/176.9.114.147 -
1391048512.537     45 10.200.3.125 TCP_REFRESH_UNMODIFIED/200 1067 GET http://ucc-images.software-univention.de/download/ucc-images/ucc-2.0-desktop-image.img.xz.spec - DIRECT/176.9.114.147 -
Comment 8 Moritz Muehlenhoff univentionstaff 2014-06-18 07:59:02 CEST
The updated version has been released to the App Center (2.0 rev2)