Description of problem: gluster volume info <nonexistent_volname> --xml and gluster volume status <nonexistent_volname> --xml return 0 Version-Release number of selected component (if applicable): 3.7.5-19 and earlier How reproducible: Everytime Steps to Reproduce: 1. Start glusterd 2. Execute gluster volume info <nonexistent_volume> --xml # gluster volume info sdksjsdjl --xml; echo $? 3. Execute gluster volume status <nonexistent_volume> --xml # gluster volume info sdksjsdjl --xml; echo $? Actual results: Both commands output a return code of 0. Without --xml, they return 1. Expected results: Both commands with nonexistent volume and --xml option should return a non-zero returncode (preferably 1 to match command without --xml) Additional info: [root@x ~]# gluster volume info sdksjsdjl --xml; echo $? <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cliOutput> <opRet>0</opRet> <opErrno>0</opErrno> <opErrstr/> <volInfo> <volumes> <count>0</count> </volumes> </volInfo> </cliOutput> 0 [root@x ~]# gluster volume status sdksjsdjl --xml; echo $? <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cliOutput> <opRet>-1</opRet> <opErrno>30800</opErrno> <opErrstr>Volume sdksjsdjl does not exist</opErrstr> <cliOp>volStatus</cliOp> <output>Volume sdksjsdjl does not exist</output> </cliOutput> 0 [root@x ~]# gluster volume info sdksjsdjl; echo $? Volume sdksjsdjl does not exist 1 [root@x ~]# gluster volume status sdksjsdjl; echo $? Volume sdksjsdjl does not exist 1
http://review.gluster.org/13843 is merged into upstream.
I've updated the summary since the issue is only with info command.
Upstream mainline : http://review.gluster.org/13843 Upstream 3.8 : http://review.gluster.org/14863 And the fix is available in rhgs-3.2.0 as part of rebase to GlusterFS 3.8.4.
Verified this Bug on 3.2.0 # cat /etc/redhat-storage-release Red Hat Gluster Storage Server 3.2.0 # cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.3 (Maipo) # rpm -qa | grep gluster glusterfs-3.8.4-2.el7rhgs.x86_64 glusterfs-cli-3.8.4-2.el7rhgs.x86_64 gluster-nagios-common-0.2.4-1.el7rhgs.noarch glusterfs-libs-3.8.4-2.el7rhgs.x86_64 glusterfs-client-xlators-3.8.4-2.el7rhgs.x86_64 glusterfs-api-3.8.4-2.el7rhgs.x86_64 glusterfs-server-3.8.4-2.el7rhgs.x86_64 gluster-nagios-addons-0.2.8-1.el7rhgs.x86_64 vdsm-gluster-4.17.33-1.el7rhgs.noarch glusterfs-fuse-3.8.4-2.el7rhgs.x86_64 glusterfs-geo-replication-3.8.4-2.el7rhgs.x86_64 python-gluster-3.8.4-2.el7rhgs.noarch Steps: 1.Start glusterd 2. Execute gluster volume info <nonexistent_volume> --xml # gluster volume info dist_replicaa --xml; echo $? 3. Execute gluster volume status <nonexistent_volume> --xml # gluster volume info dist_replicaa --xml; echo $? Output: [root@dhcp37-55 bricks]# gluster v info dist_replicaa --xml ; echo $? <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cliOutput> <opRet>-1</opRet> <opErrno>30806</opErrno> <opErrstr>Volume does not exist</opErrstr> <volInfo> <volumes> <count>0</count> </volumes> </volInfo> </cliOutput> 0 [root@dhcp37-55 bricks]# gluster v status dist_replicaa --xml ; echo $? <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cliOutput> <opRet>-1</opRet> <opErrno>30800</opErrno> <opErrstr>Volume dist_replicaa does not exist</opErrstr> <cliOp>volStatus</cliOp> <output>Volume dist_replicaa does not exist</output> </cliOutput> 0 [root@dhcp37-55 bricks]# gluster v status dist_replicaa ; echo $? Volume dist_replicaa does not exist 1 [root@dhcp37-55 bricks]# gluster v info dist_replicaa ; echo $? Volume dist_replicaa does not exist 1 Both XML command return code of 1 Without --xml, return code 1 Hence marking this Bug as Verified
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-2017-0486.html