← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1731112] [NEW] Raise error when pass not support protocol value during sg_rule creation

 

Public bug reported:

repro
--------
neutron security-group-rule-create test --direction ingress --protocol 115 --port-range-min 22 --port-range-max 22
Request Failed: internal server error while processing your request.

This will raise 500 internal error.

Log
--------
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 127, in wrapped
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    LOG.debug("Retry wrapper got retriable exception: %s", e)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    self.force_reraise()
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    six.reraise(self.type_, self.value, self.tb)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return f(*dup_args, **dup_kwargs)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/api/v2/base.py", line 548, in _create
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    obj = do_create(body)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/api/v2/base.py", line 530, in do_create
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    request.context, reservation.reservation_id)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    self.force_reraise()
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    six.reraise(self.type_, self.value, self.tb)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/api/v2/base.py", line 523, in do_create
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return obj_creator(request.context, **kwargs)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/securitygroups_rpc_base.py", line 56, in create_security_group_rule
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    security_group_rule)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 162, in wrapped
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return method(*args, **kwargs)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 92, in wrapped
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    setattr(e, '_RETRY_EXCEEDED', True)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    self.force_reraise()
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    six.reraise(self.type_, self.value, self.tb)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 88, in wrapped
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return f(*args, **kwargs)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 150, in wrapper
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    ectxt.value = e.inner_exc
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    self.force_reraise()
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    six.reraise(self.type_, self.value, self.tb)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 138, in wrapper
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return f(*args, **kwargs)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 127, in wrapped
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    LOG.debug("Retry wrapper got retriable exception: %s", e)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    self.force_reraise()
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    six.reraise(self.type_, self.value, self.tb)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return f(*dup_args, **dup_kwargs)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/securitygroups_db.py", line 343, in create_security_group_rule
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    res = self._create_security_group_rule(context, security_group_rule)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/securitygroups_db.py", line 394, in _create_security_group_rule
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    sg_rule = sg_obj.SecurityGroupRule(context, **args)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/objects/base.py", line 334, in __init__
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    super(NeutronDbObject, self).__init__(*args, **kwargs)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/objects/base.py", line 105, in __init__
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    super(NeutronObject, self).__init__(context, **kwargs)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 307, in __init__
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    setattr(self, key, kwargs[key])
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 72, in setter
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    field_value = field.coerce(self, name, value)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 195, in coerce
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return self._type.coerce(obj, attr, value)
ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 317, in coerce
ERROR neutron.api.v2.resource ^[[01;35m^[[00m    raise ValueError(msg)
ERROR neutron.api.v2.resource ^[[01;35m^[[00mValueError: Field value 115 is invalid

** Affects: neutron
     Importance: Undecided
         Status: New

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

Title:
  Raise error when pass not support protocol value during sg_rule
  creation

Status in neutron:
  New

Bug description:
  repro
  --------
  neutron security-group-rule-create test --direction ingress --protocol 115 --port-range-min 22 --port-range-max 22
  Request Failed: internal server error while processing your request.

  This will raise 500 internal error.

  Log
  --------
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 127, in wrapped
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    LOG.debug("Retry wrapper got retriable exception: %s", e)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    self.force_reraise()
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    six.reraise(self.type_, self.value, self.tb)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return f(*dup_args, **dup_kwargs)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/api/v2/base.py", line 548, in _create
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    obj = do_create(body)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/api/v2/base.py", line 530, in do_create
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    request.context, reservation.reservation_id)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    self.force_reraise()
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    six.reraise(self.type_, self.value, self.tb)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/api/v2/base.py", line 523, in do_create
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return obj_creator(request.context, **kwargs)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/securitygroups_rpc_base.py", line 56, in create_security_group_rule
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    security_group_rule)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 162, in wrapped
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return method(*args, **kwargs)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 92, in wrapped
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    setattr(e, '_RETRY_EXCEEDED', True)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    self.force_reraise()
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    six.reraise(self.type_, self.value, self.tb)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 88, in wrapped
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return f(*args, **kwargs)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 150, in wrapper
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    ectxt.value = e.inner_exc
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    self.force_reraise()
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    six.reraise(self.type_, self.value, self.tb)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 138, in wrapper
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return f(*args, **kwargs)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 127, in wrapped
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    LOG.debug("Retry wrapper got retriable exception: %s", e)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    self.force_reraise()
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    six.reraise(self.type_, self.value, self.tb)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return f(*dup_args, **dup_kwargs)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/securitygroups_db.py", line 343, in create_security_group_rule
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    res = self._create_security_group_rule(context, security_group_rule)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/securitygroups_db.py", line 394, in _create_security_group_rule
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    sg_rule = sg_obj.SecurityGroupRule(context, **args)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/objects/base.py", line 334, in __init__
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    super(NeutronDbObject, self).__init__(*args, **kwargs)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/objects/base.py", line 105, in __init__
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    super(NeutronObject, self).__init__(context, **kwargs)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 307, in __init__
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    setattr(self, key, kwargs[key])
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 72, in setter
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    field_value = field.coerce(self, name, value)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 195, in coerce
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    return self._type.coerce(obj, attr, value)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m  File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 317, in coerce
  ERROR neutron.api.v2.resource ^[[01;35m^[[00m    raise ValueError(msg)
  ERROR neutron.api.v2.resource ^[[01;35m^[[00mValueError: Field value 115 is invalid

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