Bug 1245897 - gluster snapshot status --xml gives back unexpected non xml output
Summary: gluster snapshot status --xml gives back unexpected non xml output
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: snapshot
Version: rhgs-3.1
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
: RHGS 3.1.1
Assignee: Avra Sengupta
QA Contact: Anoop
URL:
Whiteboard: SNAPSHOT
Depends On: 1218732 1245077 1245895 1253607
Blocks: 1251815
TreeView+ depends on / blocked
 
Reported: 2015-07-23 05:41 UTC by Avra Sengupta
Modified: 2016-09-17 12:55 UTC (History)
7 users (show)

Fixed In Version: glusterfs-3.7.1-12
Doc Type: Bug Fix
Doc Text:
Clone Of: 1245895
Environment:
Last Closed: 2015-10-05 07:13:41 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1845 0 normal SHIPPED_LIVE Moderate: Red Hat Gluster Storage 3.1 update 2015-10-05 11:06:22 UTC

Description Avra Sengupta 2015-07-23 05:41:24 UTC
+++ This bug was initially created as a clone of Bug #1245895 +++

+++ This bug was initially created as a clone of Bug #1218732 +++

Description of problem:
Command 'gluster snapshot status --xml' outputs text that is not part of the xml. This inconsistency breaks my code which only has a reason to expect xml data as input.

Version-Release number of selected component (if applicable):
Seen in 3.6.2.

How reproducible:
Always.

Steps to Reproduce: 
1. Create at least a 2 node cluster.
2. Create 1 volume.
3. Make sure you don't have any snapshots.

Actual results:
root@gfs-test-1:~# gluster snapshot status --xml
No snapshots present
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr>(null)</opErrstr>
  <snapStatus>
    <snapshots/>
  </snapStatus>
</cliOutput> 

Expected results:
root@gfs-test-1:~# gluster snapshot status --xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr>(null)</opErrstr>
  <snapStatus>
    <snapshots/>
  </snapStatus>
</cliOutput> 


Additional info:
Is this 'null' in the output on purpose? 
  <opErrstr>(null)</opErrstr> 
Other commands like 'gluster snapshot info --xml' show '<opErrstr/>'.


I am marking this as high priority since I parse this output and expect the output to be consistent.

Comment 2 Avra Sengupta 2015-08-05 11:13:42 UTC
Fix sent upstream for review at xml output: Fix non-uniform opErrstr xml output

Comment 5 Avra Sengupta 2015-08-25 12:32:13 UTC
Marking this bugs as dependent on 1245077, as the fix for text output is sent as part of the fix of 1245077 which also has the same issue.

Comment 7 Shashank Raj 2015-09-01 07:40:24 UTC
Verified this bug with glusterfs-3.7.1-14.el7rhgs.x86_64 build and its working as expected.

Steps followed as below:

1) Created a cluster of 4 nodes.
2) Created a 4x3 dis-rep volume.
3) without creating any snapshot, following are the outputs of commands:

[root@dhcp35-148 ~]# gluster snapshot status --xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr/>
  <snapStatus>
    <snapshots/>
  </snapStatus>
</cliOutput>

[root@dhcp35-148 ~]# gluster snapshot info --xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr/>
  <snapInfo>
    <count>0</count>
    <snapshots/>
  </snapInfo>
</cliOutput>

[root@dhcp35-148 ~]# gluster snapshot list --xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr/>
  <snapList>
    <count>0</count>
  </snapList>
</cliOutput>


The output of all of the above snapshot commands is consistent and is according to what is expected.

Hence marking this bug as Verified.

Comment 9 errata-xmlrpc 2015-10-05 07:13:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-1845.html


Note You need to log in before you can comment on or make changes to this bug.