glusterfs_native: Unable to delete snapshot

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

Bug Description

Run into the following error while trying to delete a snapshot,

CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf gluster --xml snapshot delete 44c78459-d9ff-44a4-9084-877a911034dd" returned: 0 in 0.188s from (pid=16307) execute /usr/lib/python2.7/site-packages/oslo_concurrency/
ERROR oslo_messaging.rpc.dispatcher
 Exception during message handling: syntax error: line 1, column 0

The partial traceback,

 File "/opt/stack/manila/manila/share/", line 571, in delete_snapshot
File "/opt/stack/manila/manila/share/drivers/", line 686, in delete_snapshot
outxml = etree.fromstring(out)
File "<string>", line 124, in XML
ParseError: syntax error: line 1, column 0

The variable 'out' which stores the XML output of the Gluster's delete snapshot command, and is parsed later in the code, gets an incorrect value that cannot be parsed. This is because the Gluster CLI runs in the interactive mode even when the stdin is not a terminal.

The faulty code from glusterfs_native driver's delete_snapshot API pasted
<code snippet>
        args = ('--xml', 'snapshot', 'delete', snapshot['id'])
            out, err = gluster_mgr.gluster_call(*args)

        outxml = etree.fromstring(out)

</code snippet>

Ramana Raja (rraja) on 2015-04-09
description: updated

Fix proposed to branch: master

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

Submitter: Jenkins
Branch: master

commit 6aac2b5693fe319dd31fd166bd78fb759712a5b9
Author: Ramana Raja <email address hidden>
Date: Fri Apr 10 01:38:10 2015 +0530

    glusterfs_native: Fix Gluster command call

    In the delete_snapshot API, the Gluster command issued to delete the
    snapshot ends up being run in the interactive mode of the
    Gluster-CLI. So instead of an XML output, the command results in a
    Gluster-CLI read error. Fix this by forcing the Gluster command to be
    run in the script mode.

    Change-Id: Ic09f59732bf08942a9d216f70f1fc969d9ae0a2d
    Closes-Bug: #1442339

Changed in manila:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2015-04-13
Changed in manila:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2015-04-30
Changed in manila:
milestone: kilo-rc1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers