exception in multinode - object has no attribute 'get_subnets'

Bug #1572507 reported by Yuli
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
DragonFlow
Invalid
Low
Unassigned

Bug Description

In multinode environment - in a CN host.

2016-04-20 13:52:15.867 10907 ERROR dragonflow.controller.df_local_controller
2016-04-20 13:52:16.879 10907 INFO dragonflow.controller.df_local_controller [-] Updating remote logical port = {u'parent_name': None, u'macs': [u'fa:16:3e:dd:27:b5'], u'name': u'b1cb1727-67c9-4745-ab32-e015b9f26ee3', u'chassis': u'ubuntu', u'lswitch': u'df7619e2-678d-4a75-9b28-7a7338377798', u'enabled': True, u'topic': u'b0a58f61de184ae388c3c00d4068082b', u'ips': [u'10.0.0.3', u'fd60:574a:d089:0:f816:3eff:fedd:27b5'], u'device_owner': u'compute:one', u'port_security': [u'fa:16:3e:dd:27:b5'], u'tunnel_key': 1, u'external_ids': {u'neutron:port_name': u''}, u'tag': None, u'security_groups': [u'e6f4233a-7d23-4635-8ea3-db370dd8e5d9']}{'is_local': False, 'ofport': 2, 'local_network_id': 1}, original port = {u'parent_name': None, u'macs': [u'fa:16:3e:dd:27:b5'], u'name': u'b1cb1727-67c9-4745-ab32-e015b9f26ee3', u'chassis': u'ubuntu', u'lswitch': u'df7619e2-678d-4a75-9b28-7a7338377798', u'enabled': True, u'topic': u'b0a58f61de184ae388c3c00d4068082b', u'ips': [u'10.0.0.3', u'fd60:574a:d089:0:f816:3eff:fedd:27b5'], u'device_owner': u'compute:one', u'port_security': [u'fa:16:3e:dd:27:b5'], u'tunnel_key': 1, u'external_ids': {u'neutron:port_name': u''}, u'tag': None, u'security_groups': [u'e6f4233a-7d23-4635-8ea3-db370dd8e5d9']}{'is_local': False, 'ofport': 2, 'local_network_id': 1}
2016-04-20 13:52:16.884 10907 INFO dragonflow.controller.df_local_controller [-] Adding new local logical port = {u'parent_name': None, u'macs': [u'fa:16:3e:ec:59:0c'], u'name': u'a6386045-56e3-4369-b444-db8c3005ab2b', u'chassis': u'dfstack', u'lswitch': u'df7619e2-678d-4a75-9b28-7a7338377798', u'enabled': True, u'topic': u'b0a58f61de184ae388c3c00d4068082b', u'ips': [u'10.0.0.4', u'fd60:574a:d089:0:f816:3eff:feec:590c'], u'device_owner': u'compute:two', u'port_security': [u'fa:16:3e:ec:59:0c'], u'tunnel_key': 2, u'external_ids': {u'neutron:port_name': u''}, u'tag': None, u'security_groups': [u'e6f4233a-7d23-4635-8ea3-db370dd8e5d9']}{'is_local': True, 'ofport': 3, 'local_network_id': 1}
2016-04-20 13:52:16.888 10907 WARNING dragonflow.controller.df_local_controller [-] run_db_poll - suppressing exception
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller [-] 'NoneType' object has no attribute 'get_subnets'
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller Traceback (most recent call last):
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller File "/opt/stack/dragonflow/dragonflow/controller/df_local_controller.py", line 129, in run_db_poll
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller self.port_mappings()
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller File "/opt/stack/dragonflow/dragonflow/controller/df_local_controller.py", line 330, in port_mappings
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller self.logical_port_updated(lport)
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller File "/opt/stack/dragonflow/dragonflow/controller/df_local_controller.py", line 212, in logical_port_updated
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller self.open_flow_app.notify_add_local_port(lport)
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller File "/opt/stack/dragonflow/dragonflow/controller/ryu_base_app.py", line 86, in notify_add_local_port
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller self.dispatcher.dispatch('add_local_port', lport=lport)
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller File "/opt/stack/dragonflow/dragonflow/controller/dispatcher.py", line 43, in dispatch
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller handler(*args, **kwargs)
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller File "/opt/stack/dragonflow/dragonflow/controller/dhcp_app.py", line 343, in add_local_port
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller if not self._is_dhcp_enabled_on_network(lport, network_id):
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller File "/opt/stack/dragonflow/dragonflow/controller/dhcp_app.py", line 288, in _is_dhcp_enabled_on_network
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller subnet = self._get_subnet_by_port(lport)
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller File "/opt/stack/dragonflow/dragonflow/controller/dhcp_app.py", line 271, in _get_subnet_by_port
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller subnets = l_switch.get_subnets()
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller AttributeError: 'NoneType' object has no attribute 'get_subnets'
2016-04-20 13:52:16.889 10907 ERROR dragonflow.controller.df_local_controller

Yuli (stremovsky)
Changed in dragonflow:
importance: Undecided → High
Revision history for this message
Yuli (stremovsky) wrote :

it turned out that lswitch table is empty

I got another exception related to this problem:

2016-04-20 14:07:34.277 DEBUG RyuDFAdapter [-] move onto config mode from (pid=1194) hello_handler /usr/local/lib/python2.7/dist-packages/ryu/controller/ofp_handler.py:185
2016-04-20 14:07:34.278 DEBUG RyuDFAdapter [-] switch features ev version=0x4,msg_type=0x6,msg_len=0x20,xid=0x7b319b5a,OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=267145071754569,n_buffers=256,n_tables=254) from (pid=1194) switch_features_handler /usr/local/lib/python2.7/dist-packages/ryu/controller/ofp_handler.py:196
2016-04-20 14:07:34.285 ERROR ryu.controller.controller [-] Error in the datapath 0000f2f78f1afd49 from ('10.100.100.8', 60524)
2016-04-20 14:07:34.285 ERROR ryu.lib.hub [-] hub: uncaught exception: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 52, in _launch
    func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 402, in datapath_connection_factory
    datapath.serve()
  File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 320, in serve
    self._recv_loop()
  File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 115, in deactivate
    method(self)
  File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 225, in _recv_loop
    handler(ev)
  File "/opt/stack/dragonflow/dragonflow/controller/ryu_base_app.py", line 151, in switch_features_handler
    self.dispatcher.dispatch('switch_features_handler', ev)
  File "/opt/stack/dragonflow/dragonflow/controller/dispatcher.py", line 43, in dispatch
    handler(*args, **kwargs)
  File "/opt/stack/dragonflow/dragonflow/controller/dhcp_app.py", line 75, in switch_features_handler
    self._install_flows_on_switch_up()
  File "/opt/stack/dragonflow/dragonflow/controller/dhcp_app.py", line 427, in _install_flows_on_switch_up
    self.add_local_port(port)
  File "/opt/stack/dragonflow/dragonflow/controller/dhcp_app.py", line 343, in add_local_port
    if not self._is_dhcp_enabled_on_network(lport, network_id):
  File "/opt/stack/dragonflow/dragonflow/controller/dhcp_app.py", line 288, in _is_dhcp_enabled_on_network
    subnet = self._get_subnet_by_port(lport)
  File "/opt/stack/dragonflow/dragonflow/controller/dhcp_app.py", line 271, in _get_subnet_by_port
    subnets = l_switch.get_subnets()
AttributeError: 'NoneType' object has no attribute 'get_subnets'

Revision history for this message
Yuli (stremovsky) wrote :

I had this bug because lswitch and lrouter objects were missing in dragonflow db.

After reinstalling this problem dissapperead.

Changed in dragonflow:
importance: High → Low
Revision history for this message
Shlomo (shlominar) wrote :

I got the same bug in multi-node env.
I tried to run ./unstack and ./stack again and it didn't solved the issue.
We need to set this bug as High.

summary: - exception in multinode
+ exception in multinode - object has no attribute 'get_subnets'
Revision history for this message
Shlomo (shlominar) wrote :

Reproduction steps:
1) load CN (in addition to the controller)
2) create new VM on the new CN

result:
- you got the exception in the DF screen

Revision history for this message
Pete Birley (petebirley) wrote :

I also go this, and the etcd service failed to deploy correctly, after restarting etcd and running 'df-db init' from the controller node and everything came up fine.

wenyan (wenyan)
Changed in dragonflow:
assignee: nobody → wenyan (wenyan)
wenyan (wenyan)
Changed in dragonflow:
assignee: wenyan (wenyan) → nobody
Li Ma (nick-ma-z)
Changed in dragonflow:
status: New → Invalid
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.