OpenStack Compute (Nova)

/v1.1 returns a 500, /v1.1/ gives desired respons

Reported by Aaron Lee on 2011-10-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Undecided
Alex Meade

Bug Description

 $ curl -H"X-Auth-Token: --yourkey--" http://your.api/v1.1/
{"ver...

$ curl -H"X-Auth-Token: --yourkey--" http://your.api/v1.1
{"cloudServersFault": {"message": "URL or environ must be provided", "code": 500}}

It produced this exception in the api:

2011-10-03 18:08:37,089 ERROR nova.api.openstack [-] Caught error: URL or environ must be provided
Traceback (most recent call last):
  File "/home/nova/aaron/nova/nova/api/openstack/__init__.py", line 64, in __call__
    return req.get_response(self.application)
  File "/usr/local/lib/python2.6/dist-packages/webob/request.py", line 1054, in get_response
    application, catch_exc_info=False)
  File "/usr/local/lib/python2.6/dist-packages/webob/request.py", line 1023, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/local/lib/python2.6/dist-packages/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/local/lib/python2.6/dist-packages/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/local/lib/python2.6/dist-packages/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/local/lib/python2.6/dist-packages/routes/middleware.py", line 80, in __call__
    config.environ = environ
  File "/usr/local/lib/python2.6/dist-packages/routes/__init__.py", line 22, in __setattr__
    self.load_wsgi_environ(value)
  File "/usr/local/lib/python2.6/dist-packages/routes/__init__.py", line 51, in load_wsgi_environ
    result = mapper.routematch(path)
  File "/usr/local/lib/python2.6/dist-packages/routes/mapper.py", line 686, in routematch
    raise RoutesException('URL or environ must be provided')

Alex Meade (alex-meade) wrote :

"Version request URLs should always end with a trailing slash (/). If the slash is omitted, the server may respond with a 302 redirection request." -- The current v1.1 spec

So the real bug is that it should be a 302 response, not a 500 error

Alex Meade (alex-meade) on 2011-10-14
Changed in nova:
assignee: nobody → Alex Meade (alex-meade)
status: New → In Progress

Reviewed: https://review.openstack.org/886
Committed: http://github.com/openstack/nova/commit/000174461a96ca70c76c8f3a85d9bf25fe673a2d
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 000174461a96ca70c76c8f3a85d9bf25fe673a2d
Author: Alex Meade <email address hidden>
Date: Fri Oct 14 10:02:57 2011 -0400

    Redirects requests from /v#.# to /v#.#/

    Added an APIMapper to catch routemaps when the url is '' because routes.Mapper returns an error if this is the case but we want a redirect
    Fixes bug 865585
    Related to Routes issue: https://bitbucket.org/bbangert/routes/issue/37/mapper-and-false-url

    Change-Id: I5bc7cbde25726b340e110a8e62499b47e25bc0cd

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2011-11-09
Changed in nova:
milestone: none → essex-1
Thierry Carrez (ttx) on 2011-11-17
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-1 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers