nb db migration

Bug #1644111 reported by Hong Hui Xiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DragonFlow
In Progress
High
Unassigned

Bug Description

The following error can be observed when restart df-local-controller after updating code recently. It is because the a new field name unique_key was added to lswitch[1] recently. However, old data in nb db will not have such field, because the old data was created before the code.

The workaround might be re-create all data in nb db, which is not a good way for a legacy user. A feasible fix will be adding unique_key to lswitch when found it is missing, other feasible fix might be provide script to update the nb db.

[1] https://review.openstack.org/#/c/394017/

2016-11-23 15:14:33.231 ERROR dragonflow.controller.dispatcher [-] Dragonflow application 'DHCPApp' failed in update_logical_switch
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher Traceback (most recent call last):
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher File "/opt/stack/dragonflow/dragonflow/controller/dispatcher.py", line 46, in dispatch
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher handler(*args, **kwargs)
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher File "/opt/stack/dragonflow/dragonflow/controller/dhcp_app.py", line 454, in update_logical_switch
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher self._install_dhcp_unicast_match_flow(dhcp_ip, network_id)
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher File "/opt/stack/dragonflow/dragonflow/controller/dhcp_app.py", line 512, in _install_dhcp_unicast_match_flow
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher const.DHCP_TABLE, match=match)
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher File "/opt/stack/dragonflow/dragonflow/controller/df_base_app.py", line 58, in add_flow_go_to_table
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher priority=priority, match=match)
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher File "/opt/stack/dragonflow/dragonflow/controller/df_base_app.py", line 99, in mod_flow
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher datapath.send_msg(message)
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher File "/usr/lib/python2.7/site-packages/ryu/controller/controller.py", line 344, in send_msg
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher msg.serialize()
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher File "/usr/lib/python2.7/site-packages/ryu/ofproto/ofproto_parser.py", line 211, in serialize
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher self._serialize_body()
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher File "/usr/lib/python2.7/site-packages/ryu/ofproto/ofproto_v1_3_parser.py", line 2679, in _serialize_body
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher match_len = self.match.serialize(self.buf, offset)
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher File "/usr/lib/python2.7/site-packages/ryu/ofproto/ofproto_v1_3_parser.py", line 1011, in serialize
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher field_offset)
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher File "/usr/lib/python2.7/site-packages/ryu/ofproto/oxx_fields.py", line 250, in _serialize
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher value_len = len(value)
2016-11-23 15:14:33.231 TRACE dragonflow.controller.dispatcher TypeError: object of type 'NoneType' has no len()

Hong Hui Xiao (xiaohhui)
Changed in dragonflow:
assignee: nobody → Hong Hui Xiao (xiaohhui)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to dragonflow (master)

Fix proposed to branch: master
Review: https://review.openstack.org/401210

Changed in dragonflow:
status: New → In Progress
Revision history for this message
Omer Anson (omer-anson) wrote : Re: TypeError: object of type 'NoneType' has no len()

Set to medium, since it is not expected that a user will upgrade the Dragonflow code (yet, and without a migration script).

Feel free to re-prioritise if you see fit.

Note the discussion on the proposed patch on how to deal with NB database migrations.

Changed in dragonflow:
importance: Undecided → Medium
Hong Hui Xiao (xiaohhui)
summary: - TypeError: object of type 'NoneType' has no len()
+ nb db migration
Revision history for this message
Omer Anson (omer-anson) wrote :

Should be completed for Queens

Changed in dragonflow:
importance: Medium → High
Omer Anson (omer-anson)
Changed in dragonflow:
assignee: Hong Hui Xiao (xiaohhui) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on dragonflow (master)

Change abandoned by Sean McGinnis (<email address hidden>) on branch: master
Review: https://review.opendev.org/496837

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Sean McGinnis (<email address hidden>) on branch: master
Review: https://review.opendev.org/401210

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.