← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1252921] Re: showing nonexistent NetworkGateway throws 500 instead of 404

 

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

** Changed in: neutron
    Milestone: None => icehouse-1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1252921

Title:
  showing nonexistent NetworkGateway throws 500 instead of 404

Status in OpenStack Neutron (virtual network service):
  Fix Released

Bug description:
  
  I'm implementing nvp network gateway to heat.

    https://blueprints.launchpad.net/heat/+spec/resource-type-nvp-
  network-gateway

  Heat would check resource existence by resource-show after resource deleted.
  However, show_network_gateway returns 500 instead of 404 when nvp network gateway isn't exist.
  The result of this situation is that Heat is unable to delete nvp network gateway.

  I think, neutron should return 404 when resource isn't exist.

  Curl:

  $ curl -i http://172.23.56.142:9696/v2.0/network-gateways/b5afd4a9-eb71-4af7-a082-8fc625a35b61 -X GET -H "X-Auth-Token: 56c136ee847f476f9f0ba4c2ca78ae4b" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-neutronclient"
  HTTP/1.1 500 Internal Server Error
  Content-Type: application/json; charset=UTF-8
  Content-Length: 88
  Date: Mon, 18 Nov 2013 10:30:44 GMT

  {"NeutronError": "Request Failed: internal server error while
  processing your request."}

  Log:

  2013-11-18 18:18:03.315 25570 DEBUG keystoneclient.middleware.auth_token [-] Received request from user: 54012987ac014457b9a0a8bcc10928ae with project_id : ed684e101d3243a69db07e744acad6f2 and roles: admin  _build_user_headers /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:922
  2013-11-18 18:18:03.316 25570 DEBUG routes.middleware [-] Matched GET /network-gateways/3fe90063-9e96-45be-8989-335f582962be.json __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:100
  2013-11-18 18:18:03.317 25570 DEBUG routes.middleware [-] Route path: '/network-gateways/:(id).:(format)', defaults: {'action': u'show', 'controller': <wsgify at 65809104 wrapping <function resource at 0x3ebbf50>>} __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:102
  2013-11-18 18:18:03.317 25570 DEBUG routes.middleware [-] Match dict: {'action': u'show', 'controller': <wsgify at 65809104 wrapping <function resource at 0x3ebbf50>>, 'id': u'3fe90063-9e96-45be-8989-335f582962be', 'format': u'json'} __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:103
  2013-11-18 18:18:03.324 25570 ERROR neutron.api.v2.resource [-] show failed
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource Traceback (most recent call last):
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 84, in resource
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource     result = method(request=request, **args)
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 290, in show
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource     parent_id=parent_id),
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 258, in _item
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource     obj = obj_getter(request.context, id, **kwargs)
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/plugins/nicira/NeutronPlugin.py", line 1951, in get_network_gateway
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource     id, fields)
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/plugins/nicira/dbexts/nicira_networkgw_db.py", line 248, in get_network_gateway
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource     gw_db = self._get_network_gateway(context, id)
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/plugins/nicira/dbexts/nicira_networkgw_db.py", line 133, in _get_network_gateway
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource     return self._get_by_id(context, NetworkGateway, gw_id)
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/db_base_plugin_v2.py", line 145, in _get_by_id
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource     return query.filter(model.id == id).one()
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2190, in one
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource     raise orm_exc.NoResultFound("No row was found for one()")
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource NoResultFound: No row was found for one()
  2013-11-18 18:18:03.324 25570 TRACE neutron.api.v2.resource 
  2013-11-18 18:18:05.061 25570 DEBUG neutron.openstack.common.rpc.amqp [-] received {u'_context_roles': [u'admin'], u'_msg_id': u'3ce98f89ac844d2a8d38e0ae231ff447', u'_context_read_deleted': u'no', u'_reply_q': u'reply_70a7a3f33d8f4417b5225404d435d264', u'_context_tenant_id': None, u'args': {u'devices': [u'tap3fc478a3-07', u'tapfa59a846-8b', u'tapba4de5a8-85']}, u'namespace': None, u'_unique_id': u'44f59887e1084f9898cdcc57d3bcff78', u'_context_is_admin': True, u'version': u'1.1', u'_context_project_id': None, u'_context_timestamp': u'2013-11-14 10:51:59.225787', u'_context_user_id': None, u'method': u'security_group_rules_for_devices'} _safe_log /opt/stack/neutron/neutron/openstack/common/rpc/common.py:276
  2013-11-18 18:18:05.061 25570 DEBUG neutron.openstack.common.rpc.amqp [-] unpacked context: {'user_id': None, 'roles': [u'admin'], 'tenant_id': None, 'is_admin': True, 'timestamp': u'2013-11-14 10:51:59.225787', 'project_id': None, 'read_deleted': u'no'} _safe_log /opt/stack/neutron/neutron/openstack/common/rpc/common.py:276

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