Bug 1234220 - [Backup]: Glusterfind CLI commands need to verify the accepted names for session/volume, before failing with error(s)
Summary: [Backup]: Glusterfind CLI commands need to verify the accepted names for sess...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: glusterfind
Version: rhgs-3.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: RHGS 3.5.z Batch Update 3
Assignee: Shwetha K Acharya
QA Contact: Kshithij Iyer
URL:
Whiteboard:
Depends On:
Blocks: 1223636 1241494
TreeView+ depends on / blocked
 
Reported: 2015-06-22 05:59 UTC by Sweta Anandpara
Modified: 2020-12-17 04:50 UTC (History)
11 users (show)

Fixed In Version: glusterfs-6.0-38
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1241494 (view as bug list)
Environment:
Last Closed: 2020-12-17 04:50:16 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:5603 0 None None None 2020-12-17 04:50:42 UTC

Description Sweta Anandpara 2015-06-22 05:59:17 UTC
Description of problem:
Like how there are accepted conventions for password, or for creating a file, or for a volume name, similarly there must be accepted values for a session name. When a glusterfind session is created with random name having special characters, it fails with an unrelated error - '10.70.42.202 - create failed: percent_expand: unknown key %#' and this fails at every node (of the cluster) where it tries to create a session entry, thereby multiple errors are displayed on the screen. 

Ideally, whenever a glusterfind CLI is given with a session name/volume name - it should do the checks in the following order:
1. Check if the names specified in the command, fall under the valid/accepted names or not.
2. If (1) is YES, go ahead and check if the session/volume already exists or not
   If (1) is NO, stop right there and error out telling 'invalid name given for volume/session', and save the time/cycles spent in going ahead with the OP at every peer of the cluster.

Version-Release number of selected component (if applicable):
glusterfs-3.7.1-4.el6rhs.x86_64

How reproducible: Always


Steps to Reproduce:
1. Have a >2 node cluster, with volume 'vol1'.
2. Create a glusterfind session for 'vol1' with the session name as special characters

Actual results:

Step2 fails with the below error:

[root@dhcp43-191 ~]# 
[root@dhcp43-191 ~]# glusterfind create ^%#@* ozone
10.70.42.202 - create failed: percent_expand: unknown key %#

10.70.42.147 - create failed: percent_expand: unknown key %#

10.70.42.202 - create failed: percent_expand: unknown key %#

10.70.42.147 - create failed: percent_expand: unknown key %#

10.70.42.30 - create failed: percent_expand: unknown key %#

10.70.42.30 - create failed: percent_expand: unknown key %#

Command create failed in 10.70.42.202:/rhs/thinbrick1/ozone
[root@dhcp43-191 ~]# glusterfind list
SESSION                   VOLUME                    SESSION TIME             
---------------------------------------------------------------------------
fds                       ozone                     2015-06-22 14:58:44      
sesso3                    ozone                     2015-06-18 16:27:30      
sesso1                    ozone                     2015-06-19 23:20:19      
^%#@*                     ozone                     Session Corrupted        
sesso5                    ozone                     2015-06-20 00:18:03      
fdjksl                    ozone                     2015-06-22 14:58:09      
sesso2                    ozone                     2015-06-19 22:44:40      
5543                      ozone                     2015-06-22 14:59:10      
sesso4                    ozone                     2015-06-18 16:27:38      
[root@dhcp43-191 ~]# 


Expected results:

Step2 should have first verified if the session name specified is a valid session name or not. If not, it should have stopped right there, displaying an error 'Session name can have only alphanumeric characters, with _' or something on similar lines.

Comment 6 Aravinda VK 2015-08-18 09:45:56 UTC
Patch posted upstream http://review.gluster.org/#/c/11602/

Comment 10 Mike McCune 2016-03-28 23:32:32 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 11 Aravinda VK 2018-11-19 08:20:30 UTC
Validation needs to be added in `mode_create` function in `$SRC/tools/glusterfind/src/main.py`

Comment 12 Shwetha K Acharya 2019-03-20 09:32:20 UTC
Patch posted upstream https://review.gluster.org/#/c/glusterfs/+/11602/

Comment 13 Yaniv Kaul 2019-12-02 10:43:53 UTC
(In reply to Shwetha K Acharya from comment #12)
> Patch posted upstream https://review.gluster.org/#/c/glusterfs/+/11602/

I assume it can get devel-ack+ now?

Comment 23 errata-xmlrpc 2020-12-17 04:50:16 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 (glusterfs bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2020:5603


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