Bug 921215 - Cannot create volumes with a . in the name
Summary: Cannot create volumes with a . in the name
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: cli
Version: pre-release
Hardware: All
OS: Unspecified
medium
low
Target Milestone: ---
Assignee: Gaurav Kumar Garg
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-13 17:55 UTC by Alex Wheeler
Modified: 2016-06-05 23:37 UTC (History)
7 users (show)

Fixed In Version: glusterfs-3.6.0beta1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-11 08:23:34 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Alex Wheeler 2013-03-13 17:55:02 UTC
Description of problem: When attempting to create a new volume with a '.' in the name, it fails and provides the usage info, with no information about why it failed.


Version-Release number of selected component (if applicable): Working on master.


How reproducible: 100%


Steps to Reproduce:
1. try to create a volume with a . in the name
2.
3.
  
Actual results:
Usage is shown, as if invalid arguments were provided.

Expected results:
Volume created, or an error message stating that the volume name was invalid.

Additional info: Working on providing a patch.

Comment 1 Alex Wheeler 2013-03-13 18:24:04 UTC
Attempted to submit the patch via rfc.sh, and got:

 ! [remote rejected] HEAD -> refs/for/master/bug-921215 (not Signed-off-by author/committer/uploader)
error: failed to push some refs to 'ssh://awheeler.org/glusterfs.git'

Comment 2 Vijay Bellur 2013-03-13 18:25:23 UTC
(In reply to comment #1)
> Attempted to submit the patch via rfc.sh, and got:
> 
>  ! [remote rejected] HEAD -> refs/for/master/bug-921215 (not Signed-off-by
> author/committer/uploader)
> error: failed to push some refs to
> 'ssh://awheeler.org/glusterfs.git'

Please use git commit --amend -s and then submit the patch via rfc.sh.

Comment 3 Alex Wheeler 2013-03-13 22:39:14 UTC
Looks like my patch missed a few things, and while create works, start does not.
Continuing to look, but this might be outside of my ability to fix.

Comment 4 Alex Wheeler 2013-03-13 23:09:33 UTC
Here is the output from the brick log:
[2013-03-13 22:59:57.518518] E [glusterfsd-mgmt.c:1559:mgmt_getspec_cbk] 0-glusterfs: failed to get the 'volume file' from server
[2013-03-13 22:59:57.518612] E [glusterfsd-mgmt.c:1627:mgmt_getspec_cbk] 0-mgmt: failed to fetch volume file (key:5.fobo.r3master.dyn.vpc31.opt-export-5fobo)

Comment 5 Dawit Alemu 2013-10-30 15:34:36 UTC
Suggesting a patch:-

The CLI, currently (on branch rhs-2.1), verifies the volume name is made up of alpha numeric characters, underscore or hyphen in cli-cmd-parser.c. If not the CLI exits without printing an error message.

i.e.
215                 for (i = 0; i < strlen (volname); i++)
 216                         if (!isalnum (volname[i]) && (volname[i] != '_') && (volname[i] != '-     '))                        
 217                                 goto out;

With the following patch the CLI informs the user a volume name may not contain an unsupported character.

diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 2741f7b..02b63a0 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -213,8 +213,11 @@ cli_cmd_volume_create_parse (const char **words, int wordcount, dict_t **opti
                         goto out;
 
                 for (i = 0; i < strlen (volname); i++)
-                        if (!isalnum (volname[i]) && (volname[i] != '_') && (volname[i] != '-'))
+                        if (!isalnum (volname[i]) && (volname[i] != '_') && (volname[i] != '-')) 
+                                cli_err ("Volume name may not contain a \"%c\"",
+                                         volname[i]);
                                 goto out;
+                        }
         }
 
         if (wordcount < 4) {

Example output:

# /usr/local/sbin/gluster volume create vol.abc transport tcp axum:/home/dalemu/play/brick7
Volume name may not contain a "."
Usage: volume create <NEW-VOLNAME> [stripe <COUNT>] [replica <COUNT>] [transport <tcp|rdma|tcp,rdma>] <NEW-BRICK> ... [force]

Comment 6 Anand Avati 2014-03-28 06:56:15 UTC
REVIEW: http://review.gluster.org/7364 (solved bug 921215 "can not create volume with a . in the name" by editing line no 210 and 531 in   cli/src/cli-cmd-parser.c file) posted (#1) for review on master by Gaurav Kumar Garg (ggarg)

Comment 7 Anand Avati 2014-03-28 07:24:21 UTC
REVIEW: http://review.gluster.org/7364 (BZ 921215 -  "can not create volume with a . in the name") posted (#2) for review on master by Gaurav Kumar Garg (ggarg)

Comment 8 Anand Avati 2014-03-28 07:24:36 UTC
REVIEW: http://review.gluster.org/7363 ( i have change cli file for bug id 921215) posted (#2) for review on master by Gaurav Kumar Garg (ggarg)

Comment 9 Anand Avati 2014-03-28 07:33:29 UTC
REVIEW: http://review.gluster.org/7364 (BZ 921215 -  "can not create volume with a . in the name") posted (#3) for review on master by Gaurav Kumar Garg (ggarg)

Comment 10 Anand Avati 2014-03-28 09:09:33 UTC
REVIEW: http://review.gluster.org/7364 (BZ 921215 -  "can not create volume with a . in the name") posted (#4) for review on master by Gaurav Kumar Garg (ggarg)

Comment 11 Anand Avati 2014-03-28 11:16:48 UTC
REVIEW: http://review.gluster.org/7364 (cli: this patch will show error message when volume name contain "." in volume name) posted (#5) for review on master by Gaurav Kumar Garg (ggarg)

Comment 12 Anand Avati 2014-04-01 09:14:38 UTC
REVIEW: http://review.gluster.org/7364 (cli: Error out when character "." is available in volume name) posted (#6) for review on master by Gaurav Kumar Garg (ggarg)

Comment 13 Anand Avati 2014-04-03 06:41:05 UTC
REVIEW: http://review.gluster.org/7364 (cli: Error out when character "." is available in volume name) posted (#7) for review on master by Gaurav Kumar Garg (ggarg)

Comment 14 Anand Avati 2014-04-03 06:51:48 UTC
REVIEW: http://review.gluster.org/7364 (cli: Error out when character "." is available in volume name) posted (#8) for review on master by Gaurav Kumar Garg (ggarg)

Comment 15 Anand Avati 2014-04-14 11:19:30 UTC
REVIEW: http://review.gluster.org/7364 (cli: Error out when character "." is available in volume name) posted (#9) for review on master by Gaurav Kumar Garg (ggarg)

Comment 16 Anand Avati 2014-04-22 05:31:12 UTC
REVIEW: http://review.gluster.org/7364 (cli: Error out when character "." is available in volume name) posted (#10) for review on master by Gaurav Kumar Garg (ggarg)

Comment 17 Anand Avati 2014-04-28 15:42:17 UTC
COMMIT: http://review.gluster.org/7364 committed in master by Vijay Bellur (vbellur) 
------
commit a3c12fdabea5ee77ab95bc65962e56083b7d0fa6
Author: ggarg <ggarg>
Date:   Fri Mar 28 12:23:17 2014 +0530

    cli: Error out when character "." is available in volume name
    
    previously it was failed without showing any information why it is failed.
    
    Now with this fix, when "." or any non alphanumeric character
    present in volume name, it will give error messages
    
    Change-Id: I17e8e69c08345c4d760f3ba333fe841e754bc9c8
    BUG: 921215
    Signed-off-by: ggarg <ggarg>
    Reviewed-on: http://review.gluster.org/7364
    Reviewed-by: Humble Devassy Chirammal <humble.devassy>
    Reviewed-by: Atin Mukherjee <amukherj>
    Reviewed-by: Vijay Bellur <vbellur>
    Tested-by: Gluster Build System <jenkins.com>

Comment 18 Anand Avati 2014-05-21 14:18:18 UTC
REVIEW: http://review.gluster.org/7831 (Added a space in the error message, while creating volume with its name containing a period (.)) posted (#1) for review on master by Satheesaran Sundaramoorthi (satheesaran)

Comment 19 Niels de Vos 2014-09-22 12:31:27 UTC
A beta release for GlusterFS 3.6.0 has been released. Please verify if the release solves this bug report for you. In case the glusterfs-3.6.0beta1 release does not have a resolution for this issue, leave a comment in this bug and move the status to ASSIGNED. If this release fixes the problem for you, leave a note and change the status to VERIFIED.

Packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update (possibly an "updates-testing" repository) infrastructure for your distribution.

[1] http://supercolony.gluster.org/pipermail/gluster-users/2014-September/018836.html
[2] http://supercolony.gluster.org/pipermail/gluster-users/

Comment 20 Niels de Vos 2014-11-11 08:23:34 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.6.1, please reopen this bug report.

glusterfs-3.6.1 has been announced [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://supercolony.gluster.org/pipermail/gluster-users/2014-November/019410.html
[2] http://supercolony.gluster.org/mailman/listinfo/gluster-users

Comment 21 Anand Avati 2015-03-13 11:11:10 UTC
REVIEW: http://review.gluster.org/7831 (cli: format the error message for better reading.) posted (#2) for review on master by Humble Devassy Chirammal (humble.devassy)

Comment 22 Anand Avati 2015-03-13 13:18:58 UTC
REVIEW: http://review.gluster.org/7831 (cli: format the error message for better reading.) posted (#3) for review on master by Humble Devassy Chirammal (humble.devassy)

Comment 23 Anand Avati 2015-03-13 13:21:44 UTC
REVIEW: http://review.gluster.org/7831 (cli: format the error message for better reading.) posted (#4) for review on master by Humble Devassy Chirammal (humble.devassy)


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