← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1520601] [NEW] FWaaS - GET /v2.0/fw/firewalls with colomn selection returns 500

 

Public bug reported:

Current FWaaS, colomn selection doesn't work correctly without "id".
Actually, following result should be expected:

  v2.0/fw/firewalls?fields=name
    => {"firewalls": [{"name": "fw1"}, {"name": "fw2"}]}

However, it occurs 500(Internal Server Error) as follows:

[Condition]
  REST-API request (CLI can use colomn selection)

[How to confirm]
$ source devstack/openrc admin admin
$ export TOKEN=`openstack token issue|grep ' id '|get_field 2`
$ curl -s -X GET -H "x-auth-token:$TOKEN" localhost:9696/v2.0/fw/firewalls|jq "."
{
  "firewalls": [
    {
      "description": "",
      "id": "2f291bd0-e4cc-474d-92b8-3ea3aaa0b935",
      "firewall_policy_id": "a5ccb8ae-760f-47c6-ac9a-4a2078b2bc63",
      "tenant_id": "cb3d9e782f4c4537989a904a8cbefc69",
      "admin_state_up": true,
      "name": "fw1",
      "router_ids": [
        "ae06e6f6-39e1-446b-b06f-f3ed6c6ad605"
      ],
      "status": "ACTIVE"
    },
    {
      "description": "",
      "id": "6a102aee-4a48-4cc8-8f90-2a4cb97ad92a",
      "firewall_policy_id": "fde08235-c377-48ea-951e-11e42abe2c72",
      "tenant_id": "cb3d9e782f4c4537989a904a8cbefc69",
      "admin_state_up": true,
      "name": "fw2",
      "router_ids": [
        "dd37ca9b-4bde-4d4c-a097-570da542293f"
      ],
      "status": "ACTIVE"
    }
  ]
}

$ curl -i -X GET -H "x-auth-token:$TOKEN" localhost:9696/v2.0/fw/firewalls?fields=name
HTTP/1.1 500 Internal Server Error
Content-Type: application/json; charset=UTF-8
Content-Length: 150
X-Openstack-Request-Id: req-03ae14dd-32e5-4ee7-87e2-efd7df272e09
Date: Fri, 27 Nov 2015 14:09:49 GMT

{"NeutronError": {"message": "Request Failed: internal server error
while processing your request.", "type": "HTTPInternalServerError",
"detail": ""}}

[Environment]
  devstack

[Version]
  trunk

[q-svc.log]
DEBUG neutron_fwaas.db.firewall.firewall_db [req-acc3d252-d0ea-458e-ad74-8209eeeeb8a0 admin cb3d9e782f4c4537989a904a8cbefc69] get_firewalls() ca
firewalls /opt/stack/neutron-fwaas/neutron_fwaas/db/firewall/firewall_db.py:381
ERROR neutron.api.v2.resource [req-acc3d252-d0ea-458e-ad74-8209eeeeb8a0 admin cb3d9e782f4c4537989a904a8cbefc69] index failed
TRACE neutron.api.v2.resource Traceback (most recent call last):
TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 83, in resource
TRACE neutron.api.v2.resource     result = method(request=request, **args)
TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 340, in index
TRACE neutron.api.v2.resource     return self._items(request, True, parent_id)
TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 267, in _items
TRACE neutron.api.v2.resource     obj_list = obj_getter(request.context, **kwargs)
TRACE neutron.api.v2.resource   File "/opt/stack/neutron-fwaas/neutron_fwaas/services/firewall/fwaas_plugin.py", line 382, in get_firewalls
TRACE neutron.api.v2.resource     fw_current_rtrs = self.get_firewall_routers(context, fw['id'])
TRACE neutron.api.v2.resource KeyError: 'id'

The cause is that referring 'id' after filtering.

** Affects: neutron
     Importance: Undecided
     Assignee: Yushiro FURUKAWA (y-furukawa-2)
         Status: New


** Tags: fwaas

** Changed in: neutron
     Assignee: (unassigned) => Yushiro FURUKAWA (y-furukawa-2)

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

Title:
  FWaaS - GET /v2.0/fw/firewalls with colomn selection returns 500

Status in neutron:
  New

Bug description:
  Current FWaaS, colomn selection doesn't work correctly without "id".
  Actually, following result should be expected:

    v2.0/fw/firewalls?fields=name
      => {"firewalls": [{"name": "fw1"}, {"name": "fw2"}]}

  However, it occurs 500(Internal Server Error) as follows:

  [Condition]
    REST-API request (CLI can use colomn selection)

  [How to confirm]
  $ source devstack/openrc admin admin
  $ export TOKEN=`openstack token issue|grep ' id '|get_field 2`
  $ curl -s -X GET -H "x-auth-token:$TOKEN" localhost:9696/v2.0/fw/firewalls|jq "."
  {
    "firewalls": [
      {
        "description": "",
        "id": "2f291bd0-e4cc-474d-92b8-3ea3aaa0b935",
        "firewall_policy_id": "a5ccb8ae-760f-47c6-ac9a-4a2078b2bc63",
        "tenant_id": "cb3d9e782f4c4537989a904a8cbefc69",
        "admin_state_up": true,
        "name": "fw1",
        "router_ids": [
          "ae06e6f6-39e1-446b-b06f-f3ed6c6ad605"
        ],
        "status": "ACTIVE"
      },
      {
        "description": "",
        "id": "6a102aee-4a48-4cc8-8f90-2a4cb97ad92a",
        "firewall_policy_id": "fde08235-c377-48ea-951e-11e42abe2c72",
        "tenant_id": "cb3d9e782f4c4537989a904a8cbefc69",
        "admin_state_up": true,
        "name": "fw2",
        "router_ids": [
          "dd37ca9b-4bde-4d4c-a097-570da542293f"
        ],
        "status": "ACTIVE"
      }
    ]
  }

  $ curl -i -X GET -H "x-auth-token:$TOKEN" localhost:9696/v2.0/fw/firewalls?fields=name
  HTTP/1.1 500 Internal Server Error
  Content-Type: application/json; charset=UTF-8
  Content-Length: 150
  X-Openstack-Request-Id: req-03ae14dd-32e5-4ee7-87e2-efd7df272e09
  Date: Fri, 27 Nov 2015 14:09:49 GMT

  {"NeutronError": {"message": "Request Failed: internal server error
  while processing your request.", "type": "HTTPInternalServerError",
  "detail": ""}}

  [Environment]
    devstack

  [Version]
    trunk

  [q-svc.log]
  DEBUG neutron_fwaas.db.firewall.firewall_db [req-acc3d252-d0ea-458e-ad74-8209eeeeb8a0 admin cb3d9e782f4c4537989a904a8cbefc69] get_firewalls() ca
  firewalls /opt/stack/neutron-fwaas/neutron_fwaas/db/firewall/firewall_db.py:381
  ERROR neutron.api.v2.resource [req-acc3d252-d0ea-458e-ad74-8209eeeeb8a0 admin cb3d9e782f4c4537989a904a8cbefc69] index failed
  TRACE neutron.api.v2.resource Traceback (most recent call last):
  TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 83, in resource
  TRACE neutron.api.v2.resource     result = method(request=request, **args)
  TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 340, in index
  TRACE neutron.api.v2.resource     return self._items(request, True, parent_id)
  TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 267, in _items
  TRACE neutron.api.v2.resource     obj_list = obj_getter(request.context, **kwargs)
  TRACE neutron.api.v2.resource   File "/opt/stack/neutron-fwaas/neutron_fwaas/services/firewall/fwaas_plugin.py", line 382, in get_firewalls
  TRACE neutron.api.v2.resource     fw_current_rtrs = self.get_firewall_routers(context, fw['id'])
  TRACE neutron.api.v2.resource KeyError: 'id'

  The cause is that referring 'id' after filtering.

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


Follow ups