[fuel-menu] repo check failed in fuelmenu when providing as proxy: localhost

Bug #1542370 reported by Sergey Kulanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
In Progress
Low
Vitalii Kulanov

Bug Description

probably we need somehow to catch such issues:

1) run fuelmenu
2) select bootstrap image
3) defined http proxy as localhost
4) run check on the same tab

get traceback [1]:
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 337, in send
    conn = self.get_connection(request.url, proxies)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 246, in get_connection
    conn = proxy_manager.connection_from_url(url)
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/poolmanager.py", line 138, in connection_from_url
    u = parse_url(url)
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/url.py", line 187, in parse_url
    raise LocationParseError(url)
requests.packages.urllib3.exceptions.LocationParseError: Failed to parse: archive.ubuntu.com:8000:8000

[1] http://paste.openstack.org/show/486099/

fuelmenu version:

[root@fuel ~]# rpm -q --changelog fuelmenu
* Fri Feb 05 2016 Matthew Mosesohn <email address hidden> - 9.0.0-1.mos242
- 8273639 Fix literal string builder for puppet class
- f722fbd Merge "Fix return value for restore if no path provided"
- bc5bf98 Merge "Call l23network init for interface config"
- fba0825 Call l23network init for interface config
- 98d5814 Fix return value for restore if no path provided
- bdcaaca Merge "Consolidate externall shell execs"
- 0acccda Merge "Remove direct copying default settings.yaml to astute.yaml"
- d2a14d4 Consolidate externall shell execs
- 84d2e3f Merge "Change behavior in case when management interface is down"
- 8fe1220 Remove direct copying default settings.yaml to astute.yaml

Changed in fuel:
status: New → Confirmed
summary: - [fuel-manu] repo check failed in fuelmenu when providing as proxy:
+ [fuel-menu] repo check failed in fuelmenu when providing as proxy:
localhost
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → vkulanov (vitaliy-t)
Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

In our case http://localhost:80 is not a valid proxy server.
Besides that we have apache redirect to Fuel Web interface on port 80
(https://github.com/openstack/fuel-library/commit/d60233a0cba912faa2170f9f8979360ff0740c55
https://bugs.launchpad.net/fuel/+bug/1270187)

So if we try to use localhost as a proxy server we get url parse exception:

File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/url.py", line 187, in parse_url
    raise LocationParseError(url)
requests.packages.urllib3.exceptions.LocationParseError: Failed to parse: archive.ubuntu.com:8000:8000

Some examples (localhost as a proxy):

[root@fuel ~]# curl -x localhost:80 -I http://example.com
HTTP/1.1 301 Moved Permanently
Date: Wed, 02 Mar 2016 07:06:34 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Location: https://example.com:8443/
Content-Type: text/html; charset=iso-8859-1

[root@fuel ~]# curl -x localhost:80 -I http://example.com/test
HTTP/1.1 301 Moved Permanently
Date: Wed, 02 Mar 2016 07:52:03 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Location: http://example.com:8000/test
Content-Type: text/html; charset=iso-8859-1

[root@fuel ~]# curl -x localhost:80 -I http://example.com:8000/test
HTTP/1.1 301 Moved Permanently
Date: Wed, 02 Mar 2016 07:54:33 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Location: http://example.com:8000:8000/test
Content-Type: text/html; charset=iso-8859-1

Example for some valid proxy:

[root@fuel ~]# curl -x 195.154.231.43:80 -I http://example.com
HTTP/1.1 200 OK
Date: Wed, 02 Mar 2016 08:32:25 GMT
Server: Apache/2.2.22 (Ubuntu)
Last-Modified: Wed, 28 May 2014 10:38:19 GMT
ETag: "bc0b89-b1-4fa73693161c7"
Accept-Ranges: bytes
Content-Length: 177
Vary: Accept-Encoding
Content-Type: text/html
X-Pad: avoid browser bug

So, I think that we have to add some function that will check 'validity' of proxy server
before creating any get request through.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-menu (master)

Fix proposed to branch: master
Review: https://review.openstack.org/288401

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-menu (master)

Reviewed: https://review.openstack.org/288401
Committed: https://git.openstack.org/cgit/openstack/fuel-menu/commit/?id=9640ea2f84c1100e097b4d2138963ec416e8957d
Submitter: Jenkins
Branch: master

commit 9640ea2f84c1100e097b4d2138963ec416e8957d
Author: tivaliy <email address hidden>
Date: Fri Mar 4 13:24:41 2016 +0200

    Extend number of handled HTTP-based exceptions

    We need to handle extra HTTPError-based exceptions
    while checking repositories.

    Change-Id: I484a8e2a6c3733e183f58ce968a9c22286fc79c2
    Partial-Bug: #1542370

Fedor Zhadaev (fzhadaev)
Changed in fuel:
milestone: 9.0 → 10.0
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.