Bug 1211132

Summary: 'volume get' invoked on a non-existing key fails with zero as a return value
Product: [Community] GlusterFS Reporter: SATHEESARAN <sasundar>
Component: cliAssignee: Atin Mukherjee <amukherj>
Status: CLOSED CURRENTRELEASE QA Contact: SATHEESARAN <sasundar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: mainlineCC: amukherj, bugs, gluster-bugs
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: glusterd
Fixed In Version: glusterfs-3.8rc2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1215547 (view as bug list) Environment:
Last Closed: 2016-06-16 12:49:31 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:    
Bug Blocks: 1215547    

Description SATHEESARAN 2015-04-13 06:10:43 UTC
Description of problem:
-----------------------
'volume get' invoked on a non-existing key returns zero as a return value

Version-Release number of selected component (if applicable):
--------------------------------------------------------------
glusterfs-3.7 nightly build

How reproducible:
-----------------
Always

Steps to Reproduce:
-------------------
1. Try to get the value of the non-existing key on the volume

(i.e) gluster volume get <vol-name> mykey

Actual results:
---------------
return value ($?) is 0

Expected results:
-----------------
return value should be non-zero, indicating the failure as the key is non-existent

Additional info:
-----------------
[root@ ~]# gluster volume get repvol mykey
volume get option: failed: Did you mean acl or allow?

[root@ ~]# echo $?
0

This affects automation - where the return value of the command will be checked for the successful execution of a command

Comment 1 Anand Avati 2015-04-14 06:16:38 UTC
REVIEW: http://review.gluster.org/10229 (glusterd: incorrect rsp.op_ret handling in volume get in cli) posted (#1) for review on master by Atin Mukherjee (amukherj)

Comment 2 Anand Avati 2015-04-21 08:49:26 UTC
REVIEW: http://review.gluster.org/10229 (glusterd: incorrect rsp.op_ret handling in volume get in cli) posted (#3) for review on master by Atin Mukherjee (amukherj)

Comment 3 Anand Avati 2015-04-27 05:17:45 UTC
COMMIT: http://review.gluster.org/10229 committed in master by Kaushal M (kaushal) 
------
commit 540fc2829bd63a2fa070c68ed105eb23145df406
Author: Atin Mukherjee <amukherj>
Date:   Mon Apr 13 10:37:55 2015 +0530

    glusterd: incorrect rsp.op_ret handling in volume get in cli
    
    Change-Id: Iabe99c06166578fc90121e7cfdca4a6a3f5328ae
    BUG: 1211132
    Signed-off-by: Atin Mukherjee <amukherj>
    Reviewed-on: http://review.gluster.org/10229
    Reviewed-by: Niels de Vos <ndevos>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Kaushal M <kaushal>

Comment 4 Nagaprasad Sathyanarayana 2015-10-25 14:43:11 UTC
Fix for this BZ is already present in a GlusterFS release. You can find clone of this BZ, fixed in a GlusterFS release and closed. Hence closing this mainline BZ as well.

Comment 5 Nagaprasad Sathyanarayana 2015-10-25 14:53:48 UTC
Fix for this bug is already made in a GlusterFS release. The cloned BZ has details of the fix and the release. Hence closing this mainline BZ.

Comment 6 Niels de Vos 2016-06-16 12:49:31 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.8.0, please open a new bug report.

glusterfs-3.8.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://blog.gluster.org/2016/06/glusterfs-3-8-released/
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user