kytos-ng / of_lldp

Kytos LLDP Openflow Network Application (NApp)

Home Page:https://kytos-ng.github.io/api/of_lldp.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'NoneType' object has no attribute 'switch'

viniarck opened this issue · comments

After handshake looks like port desc hasn't been received and it assumed an interface would be there when trying to process a loop

2022-11-18 11:06:11,195 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_8) Flow forwarded to switch 00:00:00:00:00:00:00:05 to be deleted. Flow: {'flows': [{'switch': '00:00:00:00:00:00:00:05', 'table_id': 0, 'match': {'dl_src': 'ee:ee:ee:ee:ee:06'}, 'priority': 50000, 'idle_timeout': 0, 'hard_timeout': 0, 'cookie': 0, 'id': '754893a472b6a5f76e1c32a5ac107ab3', 'stats': {'byte_count': 0, 'duration_sec': 206, 'duration_nsec': 211270123, 'packet_count': 0}, 'cookie_mask': 0, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'port': 4294967293, 'action_type': 'output'}]}]}]}
2022-11-18 11:06:11,195 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_8) Consistency check: alien flow on switch 00:00:00:00:00:00:00:05
2022-11-18 11:06:11,197 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_8) Flow forwarded to switch 00:00:00:00:00:00:00:05 to be deleted. Flow: {'flows': [{'switch': '00:00:00:00:00:00:00:05', 'table_id': 0, 'match': {'dl_src': 'ee:ee:ee:ee:ee:01'}, 'priority': 50000, 'idle_timeout': 0, 'hard_timeout': 0, 'cookie': 0, 'id': '0c1dd5854ce6536df74bff5ffc3af4c7', 'stats': {'byte_count': 0, 'duration_sec': 206, 'duration_nsec': 209883700, 'packet_count': 0}, 'cookie_mask': 0, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'port': 4294967293, 'action_type': 'output'}]}]}]}
2022-11-18 11:06:11,198 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_8) Consistency check: alien flow on switch 00:00:00:00:00:00:00:05
2022-11-18 11:06:11,200 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_8) Flow forwarded to switch 00:00:00:00:00:00:00:05 to be deleted. Flow: {'flows': [{'switch': '00:00:00:00:00:00:00:05', 'table_id': 0, 'match': {'dl_src': 'ee:ee:ee:ee:ee:04'}, 'priority': 50000, 'idle_timeout': 0, 'hard_timeout': 0, 'cookie': 0, 'id': '2faf52d8a430b7b6ba8ae4816261b252', 'stats': {'byte_count': 0, 'duration_sec': 206, 'duration_nsec': 207449347, 'packet_count': 0}, 'cookie_mask': 0, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'port': 4294967293, 'action_type': 'output'}]}]}]}
2022-11-18 11:06:11,200 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_8) Consistency check: alien flow on switch 00:00:00:00:00:00:00:05
2022-11-18 11:06:11,201 - INFO [kytos.napps.kytos/flow_manager] (thread_pool_sb_8) Flow forwarded to switch 00:00:00:00:00:00:00:05 to be deleted. Flow: {'flows': [{'switch': '00:00:00:00:00:00:00:05', 'table_id': 0, 'match': {'dl_src': 'ee:ee:ee:ee:ee:02'}, 'priority': 50000, 'idle_timeout': 0, 'hard_timeout': 0, 'cookie': 0, 'id': '1574b17803b080daa62a97f6ca3975ff', 'stats': {'byte_count': 0, 'duration_sec': 206, 'duration_nsec': 215348422, 'packet_count': 0}, 'cookie_mask': 0, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'port': 4294967293, 'action_type': 'output'}]}]}]}
2022-11-18 11:06:11,203 - ERROR [kytos.core.helpers] (MainThread) alisten_to handler: <function Main.on_ofpt_packet_in at 0x7f3948501ee0>, args: (<Main(of_lldp, started 139882705868544)>, KytosEvent('kytos/of_core.v0x04.messages.in.ofpt_packet_in', {'message': PacketIn(xid=UBInt32(1961641659)), 'source': Connection('X', 53706, <asyncio.TransportSocket fd=116, family=[AddressFamily.AF](http://addressfamily.af/)_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('X', 6653), raddr=('X', 53706)>, Switch('00:00:00:00:00:00:00:01'), <ConnectionState.ESTABLISHED: 2>)}, -1000)) traceback: Traceback (most recent call last):,   File "/root/dev/kytos/kytos/core/helpers.py", line 216, in handler_context,     result = await handler(*args),   File "/home/amlight/py39-kytos/var/lib/kytos/napps/kytos/of_lldp/main.py", line 317, in on_ofpt_packet_in,     await self.loop_manager.process_if_looped(interface_a, interface_b),   File "/home/amlight/py39-kytos/var/lib/kytos/napps/../napps/kytos/of_lldp/managers/loop_manager.py", line 63, in process_if_looped,     dpid_a = interface_a.switch.dpid, AttributeError: 'NoneType' object has no attribute 'switch',
2022-11-18 11:06:11,204 - ERROR [kytos.core.helpers] (MainThread) alisten_to handler: <function Main.on_ofpt_packet_in at 0x7f3948501ee0>, args: (<Main(of_lldp, started 139882705868544)>, KytosEvent('kytos/of_core.v0x04.messages.in.ofpt_packet_in', {'message': PacketIn(xid=UBInt32(675600036)), 'source': Connection('X', 53706, <asyncio.TransportSocket fd=116, family=[AddressFamily.AF](http://addressfamily.af/)_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('X', 6653), raddr=('X, 53706)>, Switch('00:00:00:00:00:00:00:01'), <ConnectionState.ESTABLISHED: 2>)}, -1000)) traceback: Traceback (most recent call last):,   File "/root/dev/kytos/kytos/core/helpers.py", line 216, in handler_context,     result = await handler(*args),   File "/home/amlight/py39-kytos/var/lib/kytos/napps/kytos/of_lldp/main.py", line 317, in on_ofpt_packet_in,     await self.loop_manager.process_if_looped(interface_a, interface_b),   File "/home/amlight/py39-kytos/var/lib/kytos/napps/../napps/kytos/of_lldp/managers/loop_manager.py", line 63, in process_if_looped,     dpid_a = interface_a.switch.dpid, AttributeError: 'NoneType' object has no attribute 'switch',
2022-11-18 11:06:11,206 - ERROR [kytos.core.helpers] (MainThread) alisten_to handler: <function Main.on_ofpt_packet_in at 0x7f3948501ee0>, args: (<Main(of_lldp, started 139882705868544)>, KytosEvent('kytos/of_core.v0x04.messages.in.ofpt_packet_in', {'message': PacketIn(xid=UBInt32(2070192430)), 'source': 

thanks for catching this @jab1982