Since 0.16.1 client breaks nova when using https

Bug #1442664 reported by Stuart McLaren
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Critical
Stuart McLaren

Bug Description

If (like nova) you use the no ssl compression option you get a stack trace:

 $ ./tools/with_venv.sh glance --debug --no-ssl-compression --os-auth-token 123 --os-image-url https://localhost:9292 image-show 123
 venv develop-inst-nodeps: /mnt/sam/git/python-glanceclient
 venv runtests: PYTHONHASHSEED='0'
 venv runtests: commands[0] | glance --debug --no-ssl-compression --os-auth-token 123 --os-image-url https://localhost:9292 image-show 123
 curl -g -i -X HEAD -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep- alive' -H 'X-Auth-Token: {SHA1}40bd001563085fc35165329ea1ff5c5ecbdbbeef' -H 'Content-Type: application/octet-stream' -- cert None --key None glance+https://localhost:9292/v1/images/123
 Traceback (most recent call last):
  File "/mnt/sam/git/python-glanceclient/glanceclient/shell.py", line 644, in main
    args.func(client, args)
  File "/mnt/sam/git/python-glanceclient/glanceclient/v1/shell.py", line 142, in do_image_show
    image_id = utils.find_resource(gc.images, args.image).id
  File "/mnt/sam/git/python-glanceclient/glanceclient/common/utils.py", line 173, in find_resource
    return manager.get(int(name_or_id))
  File "/mnt/sam/git/python-glanceclient/glanceclient/v1/images.py", line 127, in get
    % urlparse.quote(str(image_id)))
  File "/mnt/sam/git/python-glanceclient/glanceclient/common/http.py", line 259, in head
    return self._request('HEAD', url, **kwargs)
  File "/mnt/sam/git/python-glanceclient/glanceclient/common/http.py", line 209, in _request
    **kwargs)
  File "/mnt/sam/git/python-glanceclient/.tox/venv/local/lib/python2.7/site-packages/requests/sessions.py", line 464, in request
    resp = self.send(prep, **send_kwargs)
  File "/mnt/sam/git/python-glanceclient/.tox/venv/local/lib/python2.7/site-packages/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "/mnt/sam/git/python-glanceclient/.tox/venv/local/lib/python2.7/site-packages/requests/adapters.py", line 337, in send
    conn = self.get_connection(request.url, proxies)
  File "/mnt/sam/git/python-glanceclient/glanceclient/common/https.py", line 179, in get_connection
    return self._create_glance_httpsconnectionpool(url)
  File "/mnt/sam/git/python-glanceclient/glanceclient/common/https.py", line 157, in _create_glance_httpsconnectionpool
    kw = self.poolmanager.connection_kw
 AttributeError: 'PoolManager' object has no attribute 'connection_kw'
 'PoolManager' object has no attribute 'connection_kw'

Looks like this was introduced with:

 Change-Id: Ic77ce8a06d9d148a899b4b8695990fca8fdaefc5

Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :
Download full text (8.4 KiB)

To confirm this breaks nova when using https I started devstack with ssl enabled (using USE_SSL=True in localrc):

 $ keystone endpoint-list
 /usr/local/lib/python2.7/dist-packages/keystoneclient/shell.py:65: DeprecationWarning: The keystone CLI is deprecated in favor of python-openstackclient. For a Python library, continue using python-keystoneclient.
  'python-keystoneclient.', DeprecationWarning)
 +----------------------------------+-----------+----------------------------------------------+----------------------------------------------+----------------------------- --------------+----------------------------------+
 | id | region | publicurl | internalurl | adminurl | service_id |
 +----------------------------------+-----------+----------------------------------------------+----------------------------------------------+----------------------------- --------------+----------------------------------+
 | 23c027b6f16f49bcbdc16e6b55ec84cb | RegionOne | https://10.0.0.47:8774/v2/$(tenant_id)s | https://10.0.0.47:8774/v2/$(tenant_id)s | https://10.0.0.47:8774/v2/$(tenant_id)s | 86912816c15c41e8a95ad9640854e5bc |
 | 6b1e415a479b4cde904b147c7a033bac | RegionOne | https://10.0.0.47:8776/v2/$(tenant_id)s | https://10.0.0.47:8776/v2/$(tenant_id)s | https://10.0.0.47:8776/v2/$(tenant_id)s | 5d64fe58a4c3442fb2a6d3c14f2086a9 |
 | 6c7c345c3c7947e6a4495967ddbc5274 | RegionOne | https://10.0.0.47:8774/v2.1/$(tenant_id)s | https://10.0.0.47:8774/v2.1/$(tenant_id)s | https://10.0.0.47:8774/v2.1/$(tenant_id)s | 808f4486bf2c449f985654735363796a |
 | 71ebbc4e3d154bfab4089fb0ecf691f4 | RegionOne | https://10.0.0.47:8080/v1/AUTH_$(tenant_id)s | https://10.0.0.47:8080/v1/AUTH_$(tenant_id)s | https://10.0.0.47:8080 | d78100705b0c45d58b42de51a632e82a |
 | 7bbab33e0faa42ea95ac005fbb2703d6 | RegionOne | https://10.0.0.47:8776/v1/$(tenant_id)s | https://10.0.0.47:8776/v1/$(tenant_id)s | https://10.0.0.47:8776/v1/$(tenant_id)s | 1ede664498e7419ba406d6c46e96735c |
 | a802cfd711a14621a746caa08c30cca1 | RegionOne | https://10.0.0.47:8773/ | https://10.0.0.47:8773/ | https://10.0.0.47:8773/ | beaddfc4ec5740fc8ea4fde1ca9be2a5 |
 | b5f0ca15cac04f1abc1c65cfdedbb465 | RegionOne | https://10.0.0.47:5000/v2.0 | https://10.0.0.47:5000/v2.0 | https://10.0.0.47:35357/v2.0 | a64185bcae8341bc9493d0feef77713b |
 | dd279bf07a054bea992c8a58692bc7c2 | RegionOne | https://10.0.0.47:9292 | https://10.0.0.47:9292 | https://10.0.0.47:9292 | 5d048c621520435d82f61fbc055db887 |
 +----------------------------------+-----------+----------------------------------------------+----------------------------------------------+-------------------------------------------+----------------------------------+

 $ glance image-list
 +--------------------------------------+---------------------------------+----...

Read more...

Changed in python-glanceclient:
importance: Undecided → Critical
assignee: nobody → Stuart McLaren (stuart-mclaren)
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :
Changed in python-glanceclient:
status: New → In Progress
summary: - client broken since 0.16.1 when compression is disabled
+ Since 0.16.1 client breaks nova when using https
Erno Kuvaja (jokke)
tags: added: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/172453
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=c698b4e3227b4767f042e435423fcc307d7f6d5c
Submitter: Jenkins
Branch: master

commit c698b4e3227b4767f042e435423fcc307d7f6d5c
Author: Stuart McLaren <email address hidden>
Date: Fri Apr 10 14:25:28 2015 +0000

    Fix client when using no ssl compression

    Since the release of the 0.16.1 client, using the 'no ssl compression'
    option, whether on the command line, or via the library -- Nova does this by
    default -- a stack trace was generated.

    Closes-bug: 1442664
    Related-bug: 1357430

    Change-Id: I2b8ddcb0a7ae3cfccdfc20d3ba476f3b4f4ec32d

Changed in python-glanceclient:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/174293

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (stable/kilo)

Reviewed: https://review.openstack.org/174293
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=f9a2a12f178504b7ca6b31a3e1784dd5877ee018
Submitter: Jenkins
Branch: stable/kilo

commit f9a2a12f178504b7ca6b31a3e1784dd5877ee018
Author: Stuart McLaren <email address hidden>
Date: Fri Apr 10 14:25:28 2015 +0000

    Fix client when using no ssl compression

    Since the release of the 0.16.1 client, using the 'no ssl compression'
    option, whether on the command line, or via the library -- Nova does this by
    default -- a stack trace was generated.

    Closes-bug: 1442664
    Related-bug: 1357430

    Change-Id: I2b8ddcb0a7ae3cfccdfc20d3ba476f3b4f4ec32d
    (cherry picked from commit c698b4e3227b4767f042e435423fcc307d7f6d5c)

tags: added: in-stable-kilo
Thierry Carrez (ttx)
Changed in python-glanceclient:
status: Fix Committed → Fix Released
Revision history for this message
Kevin Tibi (ktibi) wrote :
Download full text (7.2 KiB)

I use glance client 0.17.2 and I have always this bug. All service listen in http but I use a proxy https on my control node. And my endpoint show url with https.

nova image-list

2015-07-27 17:16:10.472 4212 ERROR nova.api.openstack [req-804f3732-18e6-4e3e-99aa-a23e6f5ec4e8 2d3e8f76f3f9429c869e5a085837d2f1 d6f612ae52a9411f86ab5e2a79b4fd7e - - -] Caught error: 'PoolManager' object has no attribute 'connection_kw'
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack Traceback (most recent call last):
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/nova/api/openstack/__init__.py", line 125, in __call__
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack return req.get_response(self.application)
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/webob/request.py", line 1296, in send
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack application, catch_exc_info=False)
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/webob/request.py", line 1260, in call_application
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack return resp(environ, start_response)
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 634, in __call__
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack return self._call_app(env, start_response)
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 554, in _call_app
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack return self._app(env, _fake_start_response)
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack return resp(environ, start_response)
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack return resp(environ, start_response)
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/routes/middleware.py", line 131, in __call__
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack response = self.app(environ, start_response)
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack return resp(environ, start_response)
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
2015-07-27 17:16:10.472 4212 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2015-07-27 17:16:10.472 4212 TRACE nova.api.o...

Read more...

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

The fix of this bug is available since version 0.18 in the python-glanceclient [1].

[1] http://docs.openstack.org/developer/python-glanceclient/#id7

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.