Create/update fw_rule action with integer value hit internal error

Bug #1649833 reported by zhaobo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Unassigned

Bug Description

Use rest API to create/update a fw_rule, the body like:
{
    "firewall_rule": {
        "action": 123,
        "enabled": true,
        "name": "icmp_allow_no_limit",
        "protocol": "icmp"
    }
}

neutron server hit internal error.
2016-12-14 10:00:14.982 ERROR neutron.api.v2.resource [req-ce38611f-17ab-4973-ab2d-2744b2a2df8b admin e9c26c7ba7854fde8095e90fadc0f3bb] update failed: No details.
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource Traceback (most recent call last):
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 79, in resource
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource result = method(request=request, **args)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 612, in update
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource return self._update(request, id, body, **kwargs)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 92, in wrapped
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource setattr(e, '_RETRY_EXCEEDED', True)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource self.force_reraise()
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 88, in wrapped
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource return f(*args, **kwargs)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource ectxt.value = e.inner_exc
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource self.force_reraise()
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource return f(*args, **kwargs)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 128, in wrapped
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource traceback.format_exc())
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource self.force_reraise()
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource return f(*dup_args, **dup_kwargs)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 619, in _update
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource allow_bulk=self._allow_bulk)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 727, in prepare_request_body
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource attributes.convert_value(attr_info, res_dict, webob.exc.HTTPBadRequest)
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/attributes.py", line 326, in convert_value
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource res_dict[attr] = attr_vals['convert_to'](res_dict[attr])
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource File "/opt/stack/neutron-fwaas/neutron_fwaas/extensions/firewall.py", line 204, in convert_action_to_case_insensitive
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource return value.lower()
2016-12-14 10:00:14.982 TRACE neutron.api.v2.resource AttributeError: 'int' object has no attribute 'lower'

Tags: fwaas
zhaobo (zhaobo6)
Changed in neutron:
assignee: nobody → zhaobo (zhaobo6)
summary: - Create/update fw_rule with integer value hit internal error
+ Create/update fw_rule action with integer value hit internal error
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-fwaas (master)

Fix proposed to branch: master
Review: https://review.openstack.org/410661

Changed in neutron:
status: New → In Progress
tags: added: fwaas
Miguel Lavalle (minsel)
Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lib (master)

Fix proposed to branch: master
Review: https://review.openstack.org/411041

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron-lib (master)

Change abandoned by Armando Migliaccio (<email address hidden>) on branch: master
Review: https://review.openstack.org/411041

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron-fwaas (master)

Change abandoned by ZhaoBo (<email address hidden>) on branch: master
Review: https://review.openstack.org/410661

Changed in neutron:
assignee: zhaobo (zhaobo6) → Reedip (reedip-banerjee)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-fwaas (master)

Fix proposed to branch: master
Review: https://review.openstack.org/455772

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-fwaas (master)

Reviewed: https://review.openstack.org/455772
Committed: https://git.openstack.org/cgit/openstack/neutron-fwaas/commit/?id=518f616f3c6b5644d0e7c7d5d20e00603908982d
Submitter: Jenkins
Branch: master

commit 518f616f3c6b5644d0e7c7d5d20e00603908982d
Author: reedip <email address hidden>
Date: Tue Apr 11 21:46:59 2017 +0530

    Add additional test case for Action

    Currently , although action doesnt accept Non Text values
    due to the common converter in neutron-lib, however, there
    are no tests for action. The following patch adds a test for
    the action attribute.
    TrivialFix

    Depends-On: I6faf26d263788d21da078e570487ee4876d04efd
    Change-Id: I9a1b222189d35c22ef6421abd188272f2c0cfc6c
    Partial-Bug:#1649833

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
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.