Share migration KeyError on dict.pop

Bug #1555630 reported by Rodrigo Barbieri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
High
Rodrigo Barbieri

Bug Description

Call at (https://github.com/openstack/manila/blob/cdab09b822d38e58b2249863310a9ae2f8eb7dfe/manila/data/manager.py#L107) should have a second argument as "None" to not throw exception when key is not found. Such scenario occurs whenever an error before copy happens.

See trace below:

2016-03-10 07:07:45.459 ERROR manila.data.manager [req-86db3546-2dfd-436b-b48c-53c937451239 6ee9e16b78b543ea8af939250ac71546 d9c2f2b5081949048feb0965b4e6ff2b] Failed to copy contents from instance 3009b301-9805-427a-ac03-e3e60318de40 to instance c29355e3-f9e4-42bb-860d-ce1ac0c6ff06.
2016-03-10 07:07:45.459 TRACE manila.data.manager Traceback (most recent call last):
2016-03-10 07:07:45.459 TRACE manila.data.manager File "/opt/stack/manila/manila/data/manager.py", line 90, in migration_start
2016-03-10 07:07:45.459 TRACE manila.data.manager migration_info_dest)
2016-03-10 07:07:45.459 TRACE manila.data.manager File "/opt/stack/manila/manila/data/manager.py", line 170, in _copy_share_data
2016-03-10 07:07:45.459 TRACE manila.data.manager src_share, share_instance_id, dest_share_instance_id)
2016-03-10 07:07:45.459 TRACE manila.data.manager File "/opt/stack/manila/manila/data/helper.py", line 182, in allow_access_to_data_service
2016-03-10 07:07:45.459 TRACE manila.data.manager dest_share_instance_id)
2016-03-10 07:07:45.459 TRACE manila.data.manager File "/opt/stack/manila/manila/data/helper.py", line 88, in _allow_data_access
2016-03-10 07:07:45.459 TRACE manila.data.manager dest_share_instance_id, access_ref, allow=True)
2016-03-10 07:07:45.459 TRACE manila.data.manager File "/opt/stack/manila/manila/data/helper.py", line 150, in _change_data_access_to_instance
2016-03-10 07:07:45.459 TRACE manila.data.manager self.context, self.db, instance, self.wait_access_rules_timeout)
2016-03-10 07:07:45.459 TRACE manila.data.manager File "/opt/stack/manila/manila/utils.py", line 702, in wait_for_access_update
2016-03-10 07:07:45.459 TRACE manila.data.manager raise exception.ShareMigrationFailed(reason=msg)
2016-03-10 07:07:45.459 TRACE manila.data.manager ShareMigrationFailed: Share migration failed: Timeout trying to update access rules on share instance c29355e3-f9e4-42bb-860d-ce1ac0c6ff06. Timeout was 180 seconds.
2016-03-10 07:07:45.459 TRACE manila.data.manager
2016-03-10 07:07:45.462 WARNING manila.db.sqlalchemy.models [req-86db3546-2dfd-436b-b48c-53c937451239 6ee9e16b78b543ea8af939250ac71546 d9c2f2b5081949048feb0965b4e6ff2b] Property 'host' is deprecated. Please use appropriate property from share instance.
2016-03-10 07:07:45.464 DEBUG oslo_messaging._drivers.amqpdriver [req-86db3546-2dfd-436b-b48c-53c937451239 6ee9e16b78b543ea8af939250ac71546 d9c2f2b5081949048feb0965b4e6ff2b] CAST unique_id: fe913911fe284841ae9600868a3fa247 exchange 'openstack' topic 'manila-share' from (pid=13552) _send /usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py:454
2016-03-10 07:07:45.492 ERROR oslo_messaging.rpc.dispatcher [req-86db3546-2dfd-436b-b48c-53c937451239 6ee9e16b78b543ea8af939250ac71546 d9c2f2b5081949048feb0965b4e6ff2b] Exception during message handling: u'4123147d-1670-4fd6-9bb6-5dddc84cffc6'
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 138, in _dispatch_and_reply
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher incoming.message))
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 183, in _dispatch
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 127, in _do_dispatch
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/manila/manila/data/manager.py", line 107, in migration_start
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher self.busy_tasks_shares.pop(share_id)
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher KeyError: u'4123147d-1670-4fd6-9bb6-5dddc84cffc6'
2016-03-10 07:07:45.492 TRACE oslo_messaging.rpc.dispatcher

Changed in manila:
assignee: nobody → Rodrigo Barbieri (rodrigo-barbieri2010)
milestone: none → mitaka-rc1
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

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

Changed in manila:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/291258
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=b8e9ae892ab9c8c7c17a99450e0ff9d0b1787afc
Submitter: Jenkins
Branch: master

commit b8e9ae892ab9c8c7c17a99450e0ff9d0b1787afc
Author: Rodrigo Barbieri <email address hidden>
Date: Thu Mar 10 12:45:05 2016 -0300

    Fix Share Migration KeyError on dict.pop

    In Share migration it is always trying to remove the Copy object
    from dictionary, even if it has not been added yet. So, dict.pop()
    should include second argument to not throw exception.

    Improved unit test to cover this variation.

    Closes-bug: #1555630
    Change-Id: If81c14cbeb03e41501d825cab000ceb1aa2cae7c

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 2.0.0

This issue was fixed in the openstack/manila 2.0.0 release.

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.