[R5.0-176]- update default security group without any rules throws error 500

Bug #1786500 reported by alok kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Committed
High
Nagendra Prasath
Trunk
Fix Committed
High
Nagendra Prasath

Bug Description

185 def delete_security_group_rules(self, sg_id, **kwargs):
186 import pdb;pdb.set_trace()
187 sg = self._vnc.security_group_read(id=sg_id)
188 -> sg.set_security_group_entries(None)
189 self._vnc.security_group_update(sg)
(Pdb) sg_id
u'b11328a4-c070-40ae-93ee-ee9532b49f70'
(Pdb) sg.set_security_group_entries(None)
(Pdb) self._vnc.security_group_update(sg)
*** HttpError: HTTP Status: 500 Content: <type 'exceptions.AttributeError'>
Python 2.7.5: /usr/bin/python
Fri Aug 10 20:22:22 2018

Traceback (most recent call last):
  File "tcutils/wrappers.py", line 78, in wrapper
    result = function(self, *args, **kwargs)
  File "scripts/securitygroup/test_regression.py", line 593, in test_default_sg
    self.sg1_fix.delete_all_rules(sg_id)
  File "/contrail-test/fixtures/security_group.py", line 89, in delete_all_rules
    self.orch.delete_security_group_rules(sg_id=sg_id, project_id=self.project_id, option=self.option)
  File "/contrail-test/fixtures/openstack.py", line 263, in delete_security_group_rules
    return super(OpenstackOrchestrator, self).delete_security_group_rules(sg_id=sg_id, **kwargs)
  File "/contrail-test/fixtures/orchestrator.py", line 187, in delete_security_group_rules
    return self.vnc_h.delete_security_group_rules(sg_id, **kwargs)
  File "/contrail-test/fixtures/contrailapi.py", line 188, in delete_security_group_rules
    self._vnc.security_group_update(sg)
  File "/usr/lib/python2.7/site-packages/vnc_api/vnc_api.py", line 51, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vnc_api/vnc_api.py", line 719, in _object_update
    OP_PUT, uri, data=json_body)
  File "/usr/lib/python2.7/site-packages/vnc_api/vnc_api.py", line 1019, in _request_server
    retry_after_authn=retry_after_authn, retry_count=retry_count)
  File "/usr/lib/python2.7/site-packages/vnc_api/vnc_api.py", line 1099, in _request
    raise HttpError(status, content)
HttpError: HTTP Status: 500 Content: <type 'exceptions.AttributeError'>
Python 2.7.5: /usr/bin/python
Fri Aug 10 17:11:15 2018

.....
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 4305, in _put_common
    ok, result = stateful_update()
  File "/usr/lib/python2.7/site-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 4236, in stateful_update
    prop_collection_updates=req_prop_coll_updates)
  File "/usr/lib/python2.7/site-packages/vnc_cfg_api_server/vnc_cfg_types.py", line 4659, in pre_dbe_update
    {}).get('policy_rule', []))
AttributeError: 'NoneType' object has no attribute 'get'

setup info:
'nodem16', 'nodem17', 'nodem18', 'nodem19', 'nodem20', 'nodem5', 'nodea10'

env.roledefs = {
    'all': [host1, host2, host3, host4, host5, host6, host7],
    'contrail-controller': [host1,host2,host3],
    'openstack': [host1,host2,host3],
    'contrail-analytics': [host1,host2,host3],
    'contrail-analyticsdb': [host1,host2,host3],
    'contrail-lb': [host7],
    'contrail-compute': [host4,host5,host6],
    'build': [host_build],
}
host1 = 'root@10.204.216.105'
host2 = 'root@10.204.216.106'
host3 = 'root@10.204.216.107'
host4 = 'root@10.204.216.108'
host5 = 'root@10.204.216.109'
host6 = 'root@10.204.216.94'
host7 = 'root@10.204.216.48'

Revision history for this message
alok kumar (kalok) wrote :

test logs: /cs-shared/bugs/logs/logs_p

Jeba Paulaiyan (jebap)
tags: added: contrail-networking releaseblocker
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R5.0

Review in progress for https://review.opencontrail.org/45540
Submitter: Nagendra Prasath (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/45549
Submitter: Nagendra Prasath (<email address hidden>)

Revision history for this message
Nagendra Prasath (npchandran) wrote :

@Alok to reconfirm if its still seen in 178 or above.

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/45540
Committed: http://github.com/Juniper/contrail-controller/commit/7dbe56d114d3ba98335b498d20c23707a2f58d25
Submitter: Zuul v3 CI (<email address hidden>)
Branch: R5.0

commit 7dbe56d114d3ba98335b498d20c23707a2f58d25
Author: Nagendra Maynattamai <email address hidden>
Date: Mon Aug 13 16:05:49 2018 -0700

Handle security_group_entries = None when retrieving policy_rules
Closes-Bug: 1786500

'security_group_entries' can be set to None. Retrieve policy_rule
as an empty list in that case.

Change-Id: I9ad7d3f297dfe2ed84ce7ec543c6480d4da82dfc

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/45549
Committed: http://github.com/Juniper/contrail-controller/commit/52342fd36335918c28dafd9d99d4bff24e725715
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 52342fd36335918c28dafd9d99d4bff24e725715
Author: Nagendra Maynattamai <email address hidden>
Date: Mon Aug 13 16:05:49 2018 -0700

Handle security_group_entries = None when retrieving policy_rules
Closes-Bug: 1786500

'security_group_entries' can be set to None. Retrieve policy_rule
as an empty list in that case.

Change-Id: I9ad7d3f297dfe2ed84ce7ec543c6480d4da82dfc

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.