glusterFS_native_driver: create share from snapshot is broken

Bug #1495382 reported by karthick on 2015-09-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
High
Ramana Raja

Bug Description

creating share from a snapshot is broken for glusterfs_native_driver, it fails with - AttributeError: 'ShareSnapshotInstance' object has no attribute 'share'

snippet of logs:

31mShare instance 3d065e67-b71a-4567-be31-4279b9134d89 failed on creation.^[[00m
2015-09-11 09:51:54.782 ^[[01;33mWARNING manila.share.manager [^[[01;36mreq-81732921-488d-465f-b4c1-d593a35307d0 ^[[00;36m096d7e8ecef647cebcb4ed6f612528b8 fb8fa8ea06294a45976b7887c930c412^[[01;33m] ^[[01;35m^[[01;33mShare instance information in exception can not be written to db because it contains {} and it is not a dictionary.^[[00m
2015-09-11 09:51:54.807 ^[[01;31mERROR oslo_messaging.rpc.dispatcher [^[[01;36mreq-81732921-488d-465f-b4c1-d593a35307d0 ^[[00;36m096d7e8ecef647cebcb4ed6f612528b8 fb8fa8ea06294a45976b7887c930c412^[[01;31m] ^[[01;35m^[[01;31mException during message handling: 'ShareSnapshotInstance' object has no attribute 'share'^[[00m
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00mTraceback (most recent call last):
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m executor_callback))
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m executor_callback)
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m result = func(ctxt, **new_args)
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/opt/stack/manila/manila/share/manager.py", line 108, in wrapped
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m return f(self, *args, **kwargs)
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/opt/stack/manila/manila/share/manager.py", line 765, in create_share_instance
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m {'status': constants.STATUS_ERROR}
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 195, in __exit__
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m six.reraise(self.type_, self.value, self.tb)
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/opt/stack/manila/manila/share/manager.py", line 733, in create_share_instance
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m share_server=share_server)
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/opt/stack/manila/manila/share/drivers/glusterfs/layout.py", line 128, in create_share_from_snapshot
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m return self.layout.create_share_from_snapshot(context, share, *a, **kw)
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/opt/stack/manila/manila/share/drivers/glusterfs/layout_volume.py", line 448, in create_share_from_snapshot
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m old_gmgr = self._share_manager(snapshot['share'])
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m File "/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/models.py", line 54, in __getitem__
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00m return getattr(self, key)
^[[01;31m2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher ^[[01;35m^[[00mAttributeError: 'ShareSnapshotInstance' object has no attribute 'share'

Csaba Henk (chenk) wrote :

Karthick, can you please provide logs that are clear from the ANSI terminal escape sequences (cf. http://en.wikipedia.org/wiki/ANSI_escape_code). If you open the log files with "less -R" then they will render properly and you can copy & paste from that.

Csaba Henk (chenk) wrote :
Download full text (3.3 KiB)

OK, this time I cleaned it up it by hand:

Share instance 3d065e67-b71a-4567-be31-4279b9134d89 failed on creation.
2015-09-11 09:51:54.782 WARNING manila.share.manager [req-81732921-488d-465f-b4c1-d593a35307d0 096d7e8ecef647cebcb4ed6f612528b8 fb8fa8ea06294a45976b7887c930c412] Share instance information in exception can not be written to db because it contains {} and it is not a dictionary.
2015-09-11 09:51:54.807 ERROR oslo_messaging.rpc.dispatcher [req-81732921-488d-465f-b4c1-d593a35307d0 096d7e8ecef647cebcb4ed6f612528b8 fb8fa8ea06294a45976b7887c930c412] Exception during message handling: 'ShareSnapshotInstance' object has no attribute 'share'
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 108, in wrapped
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher return f(self, *args, **kwargs)
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 765, in create_share_instance
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher {'status': constants.STATUS_ERROR}
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 195, in __exit__
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 733, in create_share_instance
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher share_server=share_server)
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/drivers/glusterfs/layout.py", line 128, in create_share_from_snapshot
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher return self.layout.create_share_from_snapshot(context, share, *a, **kw)
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/drivers/glusterfs/layout_volume.py", line 448, in create_share_from_snapshot
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher old_gmgr = self._share_manager(snapshot['share'])
2015-09-11 09:51:54.807 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/models.py", line 54, in __getitem__
2015-09-11 09:5...

Read more...

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

Changed in manila:
assignee: nobody → Ramana Raja (rraja)
status: New → In Progress
Changed in manila:
milestone: none → liberty-rc1
importance: Undecided → High

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

commit cf7bc890fcdfbcae314603395889f0329b7eb70a
Author: Ramana Raja <email address hidden>
Date: Tue Sep 15 12:34:08 2015 +0530

    glusterfs: Fix use of ShareSnapshotInstance object

    Previously, a 'ShareSnapshot' object was passed to the driver's API
    method by share's manager.py during a create_share_from_snapshot call.
    Now, a 'ShareSnapshotInstance' object is passed to the driver during
    the same call. The object no longer has the attribute 'share' used by
    the driver code, and in it's place has the attribute 'share_instance'.
    So replace use of 'share' attribute with 'share_instance'.

    Change-Id: Ibea11b33772f24609f9cd3180d61ab7f6307c1b8
    Closes-Bug: #1495382

Changed in manila:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2015-09-22
Changed in manila:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2015-10-15
Changed in manila:
milestone: liberty-rc1 → 1.0.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers