Bug 1427759

Summary: nfs-ganesha: Incorrect error message returned when disable fails
Product: [Community] GlusterFS Reporter: Jiffin <jthottan>
Component: glusterdAssignee: Jiffin <jthottan>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.10CC: asoman, bugs, rhinduja, rhs-bugs, sbhaloth, skoduri, storage-qa-internal, vbellur
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: glusterfs-3.10.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1427452 Environment:
Last Closed: 2017-05-31 20:45:17 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: 1442603    

Description Jiffin 2017-03-01 06:24:36 UTC
+++ This bug was initially created as a clone of Bug #1427452 +++

Description of problem:

At times. running "gluster nfs-ganesha disable" fails with below error message -

]# gluster nfs-ganesha disable
Disabling NFS-Ganesha will tear down entire ganesha cluster across the trusted pool. Do you still want to continue?
 (y/n) y
This will take a few minutes to complete. Please wait ..
nfs-ganesha: failed: nfs-ganesha is already (null)d.
# 


Here in the above error message, instead of "disabled" the string contains "(null)d". Jiffin and myself found that this issue happens mostly when this command was run without enabling nfs-ganesha global option even once in the storage pool setup.

The issue is with de-referencing NULL string in glusterd_op_stage_set_ganesha()  when priv->opts dict doesn't contain global key.

Version-Release number of selected component (if applicable):
3.10

How reproducible:
Fairly

Steps to Reproduce:
1. On a fresh setup, without enabling NFS-Ganesha, try running disable command.

Actual results:
The error message contain invalid string.

Expected results:
The error message should be proper.

Comment 1 Worker Ant 2017-03-01 06:42:23 UTC
REVIEW: https://review.gluster.org/16791 (glusterd/ganesha : throw proper error for "gluster nfs-ganesha disable") posted (#2) for review on release-3.10 by jiffin tony Thottan (jthottan)

Comment 3 Worker Ant 2017-04-19 13:35:39 UTC
REVIEW: https://review.gluster.org/16791 (glusterd/ganesha : throw proper error for "gluster nfs-ganesha disable") posted (#3) for review on release-3.10 by jiffin tony Thottan (jthottan)

Comment 4 Worker Ant 2017-04-21 09:29:21 UTC
REVIEW: https://review.gluster.org/16791 (glusterd/ganesha : throw proper error for "gluster nfs-ganesha disable") posted (#4) for review on release-3.10 by jiffin tony Thottan (jthottan)

Comment 5 Worker Ant 2017-04-24 10:32:23 UTC
COMMIT: https://review.gluster.org/16791 committed in release-3.10 by Kaleb KEITHLEY (kkeithle) 
------
commit 6026944157798e0aca087a540776c0701ab0ced6
Author: jiffin tony thottan <jthottan>
Date:   Mon Dec 7 14:38:54 2015 +0530

    glusterd/ganesha : throw proper error for "gluster nfs-ganesha disable"
    
    For first time or if "gluster nfs-ganesha enable" fails the global option
    "nfs-ganesha" won't be stored in glusterd's dictionary. In both cases the
    "gluster nfs-ganesha disable" throws following error :
    "nfs-ganesha: failed: nfs-ganesha is already (null)d."
    
    Also this patch provides the missing prompt for nfs-ganesha disable in 3.10
    
    Change-Id: I7c9fd6dabedc0cfb14c5190b3554bc63a6bc0340
    BUG: 1427759
    Signed-off-by: Jiffin Tony Thottan <jthottan>
    Reviewed-on: https://review.gluster.org/16791
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: soumya k <skoduri>
    Reviewed-by: Kaleb KEITHLEY <kkeithle>

Comment 6 Raghavendra Talur 2017-05-31 20:45:17 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.10.2, please open a new bug report.