glance registry v2 doesn't work

Bug #1302345 reported by Sam Morrison
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Erno Kuvaja

Bug Description

Glance v2 registry API still doesn't work in Icehouse. This time thankfully the fix is pretty simple

Basically this is because the "configure_registry_client()" method in registry/client/v2/api.py isn't called anywhere in the code.
Adding this call to the get_registry_client method fixes everything.

This is a pretty critical bug so I'm hoping this can be fixed for when Icehouse is released?

2014-04-04 16:33:25.536 14975 DEBUG routes.middleware [7b235057-41cb-46a3-b397-fef7b250bb58 c0645ff94b864d3d84c438d9855f9cea 9427903ca1544f0795ba4117d55ed9b2 - - -] Matched GET /images __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:100
2014-04-04 16:33:25.537 14975 DEBUG routes.middleware [7b235057-41cb-46a3-b397-fef7b250bb58 c0645ff94b864d3d84c438d9855f9cea 9427903ca1544f0795ba4117d55ed9b2 - - -] Route path: '/images', defaults: {'action': u'index', 'controller': <glance.common.wsgi.Resource object at 0x7f76e4d6d390>} __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:102
2014-04-04 16:33:25.539 14975 DEBUG routes.middleware [7b235057-41cb-46a3-b397-fef7b250bb58 c0645ff94b864d3d84c438d9855f9cea 9427903ca1544f0795ba4117d55ed9b2 - - -] Match dict: {'action': u'index', 'controller': <glance.common.wsgi.Resource object at 0x7f76e4d6d390>} __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:103
2014-04-04 16:33:25.541 14975 DEBUG glance.common.client [7b235057-41cb-46a3-b397-fef7b250bb58 c0645ff94b864d3d84c438d9855f9cea 9427903ca1544f0795ba4117d55ed9b2 - - -] Constructed URL: http://None:9191/rpc _construct_url /usr/lib/python2.7/dist-packages/glance/common/client.py:411
2014-04-04 16:33:25.561 14975 INFO glance.wsgi.server [7b235057-41cb-46a3-b397-fef7b250bb58 c0645ff94b864d3d84c438d9855f9cea 9427903ca1544f0795ba4117d55ed9b2 - - -] Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line 384, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 378, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/keystoneclient/middleware/auth_token.py", line 582, in __call__
    return self.app(env, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 378, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/paste/urlmap.py", line 206, in __call__
    return app(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 644, in __call__
    request, **action_args)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 668, in dispatch
    return method(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/api/v2/images.py", line 91, in index
    member_status=member_status)
  File "/usr/lib/python2.7/dist-packages/glance/api/authorization.py", line 99, in list
    images = self.image_repo.list(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/domain/proxy.py", line 89, in list
    items = self.base.list(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/api/policy.py", line 183, in list
    return super(ImageRepoProxy, self).list(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/domain/proxy.py", line 89, in list
    items = self.base.list(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/domain/proxy.py", line 89, in list
    items = self.base.list(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/domain/proxy.py", line 89, in list
    items = self.base.list(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/db/__init__.py", line 75, in list
    member_status=member_status)
  File "/usr/lib/python2.7/dist-packages/glance/db/registry/api.py", line 50, in wrapper
    return func(client, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/db/registry/api.py", line 142, in image_get_all
    admin_as_user=admin_as_user)
  File "/usr/lib/python2.7/dist-packages/glance/common/rpc.py", line 273, in method_proxy
    return self.do_request(item, **kw)
  File "/usr/lib/python2.7/dist-packages/glance/common/rpc.py", line 239, in do_request
    'kwargs': kwargs}])
  File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 66, in wrapped
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/rpc.py", line 225, in bulk_request
    body)
  File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 66, in wrapped
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 386, in do_request
    headers=copy.deepcopy(headers))
  File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 83, in wrapped
    return func(self, method, url, body, headers)
  File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 550, in _do_request
    raise exception.ClientConnectionError(e)
ClientConnectionError: [Errno -2] Name or service not known
2014-04-04 16:33:25.568 14975 INFO glance.wsgi.server [7b235057-41cb-46a3-b397-fef7b250bb58 c0645ff94b864d3d84c438d9855f9cea 9427903ca1544f0795ba4117d55ed9b2 - - -] 128.250.116.173 - - [04/Apr/2014 16:33:25] "GET /v2/images?limit=20 HTTP/1.1" 500 139 0.047958

Erno Kuvaja (jokke)
Changed in glance:
status: New → Confirmed
assignee: nobody → Erno Kuvaja (jokke)
Revision history for this message
Erno Kuvaja (jokke) wrote :

Thanks Sam,

The proposed fix indeed worked. Before pushing change to review, I will try to implement simple test for this.

Changed in glance:
status: Confirmed → In Progress
Erno Kuvaja (jokke)
tags: added: icehouse-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Changed in glance:
importance: Undecided → High
milestone: none → icehouse-rc2
Thierry Carrez (ttx)
tags: removed: icehouse-rc-potential
Revision history for this message
Erno Kuvaja (jokke) wrote :

I haven't been able to find any elegant way to test this change. I think what we would need to do for future is to plan how we get the api v2 tests running once with sqlalchemy and once with registry. That would at least ensure that changes that would break registry does not slip in.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/85313
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=1ac30bbd667aa5266ddb2967198dceba787a6653
Submitter: Jenkins
Branch: master

commit 1ac30bbd667aa5266ddb2967198dceba787a6653
Author: Erno Kuvaja <email address hidden>
Date: Fri Apr 4 10:55:23 2014 +0100

    Fixes Glance Registry V2 client

    Add an optional configuration step to glance.db.get_api().

    This step is then used in glance.db.registry.api in order to ensure that
    the registry client has been configured in time for the registry db
    driver's use.

    Closes bug: #1302345

    Change-Id: Id2c52c423b411ec20bdfa76ee91837c98b1613ef
    Co-Authored-By: Mark J. Washenberger <email address hidden>

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/86937

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/86954

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (milestone-proposed)

Reviewed: https://review.openstack.org/86937
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=abf2dd8ee8ea116205d661e57f8dda6627e2f5c1
Submitter: Jenkins
Branch: milestone-proposed

commit abf2dd8ee8ea116205d661e57f8dda6627e2f5c1
Author: Erno Kuvaja <email address hidden>
Date: Fri Apr 4 10:55:23 2014 +0100

    Fixes Glance Registry V2 client

    Add an optional configuration step to glance.db.get_api().

    This step is then used in glance.db.registry.api in order to ensure that
    the registry client has been configured in time for the registry db
    driver's use.

    Closes bug: #1302345

    Change-Id: Id2c52c423b411ec20bdfa76ee91837c98b1613ef
    Co-Authored-By: Mark J. Washenberger <email address hidden>

Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: icehouse-rc2 → 2014.1
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.