schema error(UnboundLocalError) while updating policy leading to loss of traffic

Bug #1421113 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Fix Committed
High
Sachin Bansal
R2.1
Fix Committed
High
Sachin Bansal

Bug Description

R2.1 Build 26 Ubuntu 14.04 multi node setup

p1 is applied to vn2 and vn1 with Rules :
deny protocol tcp network vn1 ports any <> network vn1 ports any
deny protocol any 10.1.1.9/32 ports any <> 10.1.1.3/32 ports any
pass protocol any network vn1 ports any <> network vn2 ports any services srx1

Now , the second rule is updated (from deny->pass) so that traffic is allowed from 10.1.1.9 to 10.1.1.3

The below schema error is seen continuously ( every second)
Network policy shows the updated values. But the access-control-list continues to have the old rule (the one with deny)

Logs will be in http://10.204.216.50/Docs/bugs/#

<type 'exceptions.UnboundLocalError'>
Python 2.7.6: /usr/bin/python
Thu Feb 12 12:18:55 2015

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

 /usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py in launch_arc(transformer=<schema_transformer.to_bgp.SchemaTransformer object>, ssrc_mapc=<cfgm_common.ifmap.client.client instance>)
 3279 pollreq = PollRequest(arc_mapc.get_session_id())
 3280 result = arc_mapc.call('poll', pollreq)
 3281 transformer.process_poll_result(result)
 3282 except Exception as e:
 3283 if type(e) == socket.error:
transformer = <schema_transformer.to_bgp.SchemaTransformer object>
transformer.process_poll_result = <bound method SchemaTransformer.process_poll_res...ema_transformer.to_bgp.SchemaTransformer object>>
result = '<?xml version="1.0" encoding="UTF-8" standalone=...lResult></ns2:response></ns3:Body></ns3:Envelope>'

 /usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py in process_poll_result(self=<schema_transformer.to_bgp.SchemaTransformer object>, poll_result_str='<?xml version="1.0" encoding="UTF-8" standalone=...lResult></ns2:response></ns3:Body></ns3:Envelope>')
 2957
 2958 if action.simple_action:
 2959 virtual_network.add_connection(connected_network)
 2960
 2961 # end for acl_rule_list
virtual_network = <schema_transformer.to_bgp.VirtualNetworkST object>
virtual_network.add_connection = <bound method VirtualNetworkST.add_connection of...hema_transformer.to_bgp.VirtualNetworkST object>>
connected_network undefined
<type 'exceptions.UnboundLocalError'>: local variable 'connected_network' referenced before assignment
    __class__ = <type 'exceptions.UnboundLocalError'>
    __delattr__ = <method-wrapper '__delattr__' of exceptions.UnboundLocalError object>
    __dict__ = {}
    __doc__ = 'Local name referenced but not bound to a value.'
    __format__ = <built-in method __format__ of exceptions.UnboundLocalError object>
    __getattribute__ = <method-wrapper '__getattribute__' of exceptions.UnboundLocalError object>
    __getitem__ = <method-wrapper '__getitem__' of exceptions.UnboundLocalError object>
    __getslice__ = <method-wrapper '__getslice__' of exceptions.UnboundLocalError object>
    __hash__ = <method-wrapper '__hash__' of exceptions.UnboundLocalError object>
    __init__ = <method-wrapper '__init__' of exceptions.UnboundLocalError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of exceptions.UnboundLocalError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of exceptions.UnboundLocalError object>
    __repr__ = <method-wrapper '__repr__' of exceptions.UnboundLocalError object>
    __setattr__ = <method-wrapper '__setattr__' of exceptions.UnboundLocalError object>
    __setstate__ = <built-in method __setstate__ of exceptions.UnboundLocalError object>
    __sizeof__ = <built-in method __sizeof__ of exceptions.UnboundLocalError object>
    __str__ = <method-wrapper '__str__' of exceptions.UnboundLocalError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __unicode__ = <built-in method __unicode__ of exceptions.UnboundLocalError object>
    args = ("local variable 'connected_network' referenced before assignment",)
    message = "local variable 'connected_network' referenced before assignment"

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 3281, in launch_arc
    transformer.process_poll_result(result)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 2959, in process_poll_result
    virtual_network.add_connection(connected_network)
UnboundLocalError: local variable 'connected_network' referenced before assignment

<type 'exceptions.UnboundLocalError'>
Python 2.7.6: /usr/bin/python
Thu Feb 12 12:18:57 2015

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

 /usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py in launch_arc(transformer=<schema_transformer.to_bgp.SchemaTransformer object>, ssrc_mapc=<cfgm_common.ifmap.client.client instance>)
 3279 pollreq = PollRequest(arc_mapc.get_session_id())
 3280 result = arc_mapc.call('poll', pollreq)
 3281 transformer.process_poll_result(result)
 3282 except Exception as e:
 3283 if type(e) == socket.error:
transformer = <schema_transformer.to_bgp.SchemaTransformer object>
transformer.process_poll_result = <bound method SchemaTransformer.process_poll_res...ema_transformer.to_bgp.SchemaTransformer object>>
result = '<?xml version="1.0" encoding="UTF-8" standalone=...lResult></ns2:response></ns3:Body></ns3:Envelope>'

 /usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py in process_poll_result(self=<schema_transformer.to_bgp.SchemaTransformer object>, poll_result_str='<?xml version="1.0" encoding="UTF-8" standalone=...lResult></ns2:response></ns3:Body></ns3:Envelope>')
 2957
 2958 if action.simple_action:
 2959 virtual_network.add_connection(connected_network)
 2960
 2961 # end for acl_rule_list
virtual_network = <schema_transformer.to_bgp.VirtualNetworkST object>
virtual_network.add_connection = <bound method VirtualNetworkST.add_connection of...hema_transformer.to_bgp.VirtualNetworkST object>>
connected_network undefined
<type 'exceptions.UnboundLocalError'>: local variable 'connected_network' referenced before assignment
    __class__ = <type 'exceptions.UnboundLocalError'>
    __delattr__ = <method-wrapper '__delattr__' of exceptions.UnboundLocalError object>
    __dict__ = {}
    __doc__ = 'Local name referenced but not boundto a value.'
    __format__ = <built-in method __format__ of exceptions.UnboundLocalError object>
    __getattribute__ = <method-wrapper '__getattribute__' of exceptions.UnboundLocalError object>
    __getitem__ = <method-wrapper '__getitem__' of exceptions.UnboundLocalError object>
    __getslice__ = <method-wrapper '__getslice__' of exceptions.UnboundLocalError object>
    __hash__ = <method-wrapper '__hash__' of exceptions.UnboundLocalError object>
    __init__ = <method-wrapper '__init__' of exceptions.UnboundLocalError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of exceptions.UnboundLocalError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of exceptions.UnboundLocalError object>
    __repr__ = <method-wrapper '__repr__' of exceptions.UnboundLocalError object>
    __setattr__ = <method-wrapper '__setattr__' of exceptions.UnboundLocalError object>
    __setstate__ = <built-in method __setstate__ of exceptions.UnboundLocalError object>
    __sizeof__ = <built-in method __sizeof__ of exceptions.UnboundLocalError object>
    __str__ = <method-wrapper '__str__' of exceptions.UnboundLocalError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __unicode__ = <built-in method __unicode__ of exceptions.UnboundLocalError object>
    args = ("local variable 'connected_network' referenced before assignment",)
    message = "local variable 'connected_network' referenced before assignment"

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 3281, in launch_arc
    transformer.process_poll_result(result)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 2959, in process_poll_result
    virtual_network.add_connection(connected_network)
UnboundLocalError: local variable 'connected_network' referenced before assignment

Tags: blocker config
Revision history for this message
Vedamurthy Joshi (vedujoshi) wrote :

It is easily reproducible with the above steps

Sachin Bansal (sbansal)
Changed in juniperopenstack:
status: New → In Progress
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/7422
Committed: http://github.org/Juniper/contrail-controller/commit/24cb2cb133419c4c43e71425c593687bdb7c6d98
Submitter: Zuul
Branch: R2.1

commit 24cb2cb133419c4c43e71425c593687bdb7c6d98
Author: Sachin Bansal <email address hidden>
Date: Fri Feb 13 09:39:08 2015 -0800

Check for connected_network before creating connection

Change-Id: Ib3d69f735923a430a58a397cd8c632e57366b427
Closes-Bug: 1421113
(cherry picked from commit 500cb9f50ef824442e6d5d13576f6ec152fa0cff)

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

Reviewed: https://review.opencontrail.org/7420
Committed: http://github.org/Juniper/contrail-controller/commit/500cb9f50ef824442e6d5d13576f6ec152fa0cff
Submitter: Zuul
Branch: master

commit 500cb9f50ef824442e6d5d13576f6ec152fa0cff
Author: Sachin Bansal <email address hidden>
Date: Fri Feb 13 09:39:08 2015 -0800

Check for connected_network before creating connection

Change-Id: Ib3d69f735923a430a58a397cd8c632e57366b427
Closes-Bug: 1421113

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