← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1169811] Re: Translate NoMoreFloatingIps exception in floating ip create API

 

** Changed in: nova
       Status: Fix Committed => Fix Released

** Changed in: nova
    Milestone: None => havana-1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1169811

Title:
  Translate NoMoreFloatingIps exception in floating ip create API

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  In tempest test  test_allocate_floating_ip_from_nonexistent_pool an
  attempt is made to allocate a floating ip from a non existant pool.
  Nova correctly returns a 404, but leaves a stacktrace in the log files

  2013-04-17 11:25:54    DEBUG [routes.middleware] Matched POST /418618d2fea641f69e6966afafe33e0c/os-floating-ips
  2013-04-17 11:25:54    DEBUG [routes.middleware] Route path: '/{project_id}/os-floating-ips', defaults: {'action': u'crea
  te', 'controller': <nova.api.openstack.wsgi.Resource object at 0x31eaf10>}
  2013-04-17 11:25:54    DEBUG [routes.middleware] Match dict: {'action': u'create', 'controller': <nova.api.openstack.wsgi
  .Resource object at 0x31eaf10>, 'project_id': u'418618d2fea641f69e6966afafe33e0c'}
  2013-04-17 11:25:54    DEBUG [nova.api.openstack.wsgi] Action: 'create', body: <?xml version="1.0" encoding="UTF-8"?>
  <pool >non_exist_pool</pool>
  2013-04-17 11:25:54    DEBUG [nova.api.openstack.wsgi] Calling method <bound method FloatingIPController.create of <nova.
  api.openstack.compute.contrib.floating_ips.FloatingIPController object at 0x2f7bad0>>
  2013-04-17 11:25:54    DEBUG [nova.quota] Created reservations ['a2d9fde5-fd43-42be-9c8d-abd4c15d311e']
  2013-04-17 11:25:54    DEBUG [nova.quota] Rolled back reservations ['a2d9fde5-fd43-42be-9c8d-abd4c15d311e']
  2013-04-17 11:25:54    ERROR [nova.api.openstack] Caught error: Zero floating ips available.
  Traceback (most recent call last):
    File "/srv/compile/openstack/nova/nova/api/openstack/__init__.py", line 81, in __call__
      return req.get_response(self.application)
    File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
      application, catch_exc_info=False)
    File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application
      app_iter = application(self.environ, start_response)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
      return resp(environ, start_response)
    File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 451, in __call__
      return self.app(env, start_response)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
      return resp(environ, start_response)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
      return resp(environ, start_response)
    File "/usr/local/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
      response = self.app(environ, start_response)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
      return resp(environ, start_response)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
     resp = self.call_func(req, *args, **self.kwargs)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
      return self.func(req, *args, **kwargs)
    File "/srv/compile/openstack/nova/nova/api/openstack/wsgi.py", line 899, in __call__
      content_type, body, accept)
    File "/srv/compile/openstack/nova/nova/api/openstack/wsgi.py", line 951, in _process_stack
      action_result = self.dispatch(meth, request, action_args)
    File "/srv/compile/openstack/nova/nova/api/openstack/wsgi.py", line 1030, in dispatch
      return method(req=request, **action_args)
    File "/srv/compile/openstack/nova/nova/api/openstack/compute/contrib/floating_ips.py", line 161, in create
      address = self.network_api.allocate_floating_ip(context, pool)
    File "/srv/compile/openstack/nova/nova/network/api.py", line 90, in wrapped
      return func(self, context, *args, **kwargs)
    File "/srv/compile/openstack/nova/nova/network/api.py", line 212, in allocate_floating_ip
      context.project_id, False, pool)
    File "/srv/compile/openstack/nova/nova/utils.py", line 1349, in wrapper
      return func(*args, **kwargs)
    File "/srv/compile/openstack/nova/nova/network/floating_ips.py", line 240, in allocate_floating_ip
      QUOTAS.rollback(context, reservations)
    File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
      self.gen.next()
    File "/srv/compile/openstack/nova/nova/network/floating_ips.py", line 227, in allocate_floating_ip
      pool)
    File "/srv/compile/openstack/nova/nova/db/api.py", line 257, in floating_ip_allocate_address
      return IMPL.floating_ip_allocate_address(context, project_id, pool)
    File "/srv/compile/openstack/nova/nova/db/sqlalchemy/api.py", line 113, in wrapper
      return f(*args, **kwargs)
    File "/srv/compile/openstack/nova/nova/db/sqlalchemy/api.py", line 679, in floating_ip_allocate_address
      raise exception.NoMoreFloatingIps()
  NoMoreFloatingIps: Zero floating ips available.
  2013-04-17 11:25:54     INFO [nova.api.openstack] http://192.168.1.18:8774/v2/418618d2fea641f69e6966afafe33e0c/os-floating-ips returned with HTTP 404
  2013-04-17 11:25:54    DEBUG [nova.api.openstack.wsgi] Returning 404 to user: NoMoreFloatingIps: Zero floating ips availa
  g-ips returned with HTTP 404
  2013-04-17 11:25:54    DEBUG [nova.api.openstack.wsgi] Returning 404 to user: NoMoreFloatingIps: Zero floating ips available. 
  2013-04-17 11:25:54     INFO [nova.osapi_compute.wsgi.server] 192.168.1.18 "POST /v2/418618d2fea641f69e6966afafe33e0c/os-floating-ips HTTP/1.1" status: 404 len: 351 time: 0.0572748

  We should catch the exception and raise an HTTPNotFound instead so we
  don't leave a confusing stack trace when in an expected code path

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1169811/+subscriptions