Error not meaningful if glance-registry service not running

Bug #996648 reported by Lorin Hochstein
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Sulochan Acharya

Bug Description

If the glance-api service is running but the glance-registry service is not, the user gets the following error message:

$ glance index
Failed to show index. Got error:
The request returned 500 Internal Server Error

The response body:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 210, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 279, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1086, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1055, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/keystone/middleware/auth_token.py", line 176, in __call__
    return self.app(env, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 210, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 279, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1086, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1055, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, 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 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 210, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 477, in __call__
    request, **action_args)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 494, in dispatch
    return method(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/api/v1/images.py", line 134, in index
    images = registry.get_images_list(req.context, **params)
  File "/usr/lib/python2.7/dist-packages/glance/registry/__init__.py", line 129, in get_images_list
    return c.get_images(**kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/registry/client.py", line 77, in get_images
    res = self.do_request("GET", "/images", params=params)
  File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 58, in wrapped
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 420, in do_request
    headers=headers)
  File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 75, in wrapped
    return func(self, method, url, body, headers)
  File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 557, in _do_request
    raise exception.ClientConnectionError(e)
ClientConnectionError: There was an error connecting to a server
Details: [Errno 111] ECONNREFUSED

It would be much more helpful if the error was something that more explicitly described the problem to the user, such as:

$ glance index
ERROR: The glance-api service was not able to connect to the glance-registry service.
Possible sources of error:
 * the glance-registry service is not running
 * In glance-api.conf, the registry_host or registry_port settings are incorrect

Revision history for this message
Brian Waldon (bcwaldon) wrote :

Thanks for filing this, I definitely agree.

Changed in glance:
status: New → Confirmed
importance: Undecided → Low
Changed in glance:
assignee: nobody → Sulochan Acharya (sulochan-acharya)
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/9916

Changed in glance:
status: Confirmed → In Progress
Brian Waldon (bcwaldon)
Changed in glance:
milestone: none → folsom-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/9916
Committed: http://github.com/openstack/glance/commit/7956c2bec87b75f59f1453c531f9b1557a6196a5
Submitter: Jenkins
Branch: master

commit 7956c2bec87b75f59f1453c531f9b1557a6196a5
Author: Sulochan Acharya <email address hidden>
Date: Tue Jul 17 09:22:36 2012 -0500

    Dont show stack trace on command line for service error.

    - Fix bug 996648

    Currently if the Registry service is not running, any glance command
    will show the Internal server error exception response body on the command line.
    This fix proposes to hide that trace with a more generic message. Users can
    still see the trace on log file in debug.

    Change-Id: Ia86c42002ae8daabe0d7ad92a2017f1869b10853

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: folsom-3 → 2012.2
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.