Comment 0 for bug 1442339

Revision history for this message
Ramana Raja (rraja) wrote :

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/processutils.py:22
ERROR oslo_messaging.rpc.dispatcher
 Exception during message handling: syntax error: line 1, column 0

The partial traceback,

 File "/opt/stack/manila/manila/share/manager.py", line 571, in delete_snapshot
share_server=share_server)
File "/opt/stack/manila/manila/share/drivers/glusterfs_native.py", 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 is stores the XML output of the Gluster 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
below,
<code snippet>
        args = ('--xml', 'snapshot', 'delete', snapshot['id'])
        try:
            out, err = gluster_mgr.gluster_call(*args)
        ...

       outxml = etree.fromstring(out)

</code snippet>