UnboundLocalError: local variable 'resp_headers' referenced before assignment

Bug #816817 reported by Antony Messerli
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Rick Harris

Bug Description

2011-07-27 07:21:14 DEBUG [routes.middleware] Initialized with method overriding = True, and path info altering = True
2011-07-27 07:21:14 DEBUG [eventlet.wsgi.server] (17689) wsgi starting up on http://0.0.0.0:9292/
2011-07-27 07:21:47 DEBUG [glance.api.middleware.version_negotiation] Processing request: GET /v1/images/9 Accept: */*
2011-07-27 07:21:47 DEBUG [glance.api.middleware.version_negotiation] Matched versioned URI. Version: 1.0
2011-07-27 07:21:47 DEBUG [routes.middleware] Matched GET /images/9
2011-07-27 07:21:47 DEBUG [routes.middleware] Route path: '/images/:(id)', defaults: {'action': u'show', 'controller': <glance.common.wsgi.Resource object at 0x15cea50>}
2011-07-27 07:21:47 DEBUG [routes.middleware] Match dict: {'action': u'show', 'controller': <glance.common.wsgi.Resource object at 0x15cea50>, 'id': u'9'}
2011-07-27 07:21:47 DEBUG [glance.api.v1.images] image cache DISABLED, retrieving image '9' from store
2011-07-27 07:21:47 DEBUG [eventlet.wsgi.server] Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 113, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 113, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 113, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.6/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 311, in __call__
    request, **action_args)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 328, in dispatch
    return method(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/api/v1/images.py", line 243, in show
    image_iterator = get_from_store(image)
  File "/usr/lib/pymodules/python2.6/glance/api/v1/images.py", line 196, in get_from_store
    options=self.options)
  File "/usr/lib/pymodules/python2.6/glance/store/__init__.py", line 86, in get_from_backend
    return backend_class.get(loc, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/store/swift.py", line 170, in get
    obj_size = int(resp_headers['content-length'])
UnboundLocalError: local variable 'resp_headers' referenced before assignment
2011-07-27 07:21:47 DEBUG [eventlet.wsgi.server] XX.XX.XX.XX - - [27/Jul/2011 07:21:47] "GET /v1/images/9 HTTP/1.0" 500 3672 0.035693

Running Rev 160. Get a 500 when attempting a build or "wget http://XX.XX.XX.XX:9292/v1/images/9"

Related branches

Revision history for this message
Antony Messerli (antonym) wrote :

Also added a raise to get some more info:

011-07-27 07:52:23 DEBUG [eventlet.wsgi.server] Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 113, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 113, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.6/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 311, in __call__
    request, **action_args)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 328, in dispatch
    return method(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/api/v1/images.py", line 243, in show
    image_iterator = get_from_store(image)
  File "/usr/lib/pymodules/python2.6/glance/api/v1/images.py", line 196, in get_from_store
    options=self.options)
  File "/usr/lib/pymodules/python2.6/glance/store/__init__.py", line 86, in get_from_backend
    return backend_class.get(loc, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/store/swift.py", line 169, in get
    raise e
ClientException: Cannot handle protocol scheme for url u'storage101.ord1.clouddrive.com/auth/v1.0'
2011-07-27 07:52:23 DEBUG [eventlet.wsgi.server] 10.13.136.188 - - [27/Jul/2011 07:52:23] "GET /v1/images/9 HTTP/1.0" 500 3013 0.025708

Jay Pipes (jaypipes)
Changed in glance:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Jay Pipes (jaypipes)
milestone: none → diablo-3
Changed in glance:
assignee: Jay Pipes (jaypipes) → Rick Harris (rconradharris)
status: Confirmed → In Progress
Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: diablo-3 → 2011.3
status: Fix Committed → Fix Released
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.