Bug 1245897

Summary: gluster snapshot status --xml gives back unexpected non xml output
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Avra Sengupta <asengupt>
Component: snapshotAssignee: Avra Sengupta <asengupt>
Status: CLOSED ERRATA QA Contact: Anoop <annair>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: amukherj, ashah, asrivast, byarlaga, rhs-bugs, rjoseph, storage-qa-internal
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: RHGS 3.1.1   
Hardware: x86_64   
OS: Linux   
Whiteboard: SNAPSHOT
Fixed In Version: glusterfs-3.7.1-12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1245895 Environment:
Last Closed: 2015-10-05 07:13:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1218732, 1245077, 1245895, 1253607    
Bug Blocks: 1251815    

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