Bug 1228845 - rgw_frontends is unforgiving of whitespace and quotes.
Summary: rgw_frontends is unforgiving of whitespace and quotes.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat
Component: RGW
Version: 1.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: 1.3.2
Assignee: Matt Benjamin (redhat)
QA Contact: ceph-qe-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-05 21:38 UTC by John Wilkins
Modified: 2017-07-30 16:04 UTC (History)
11 users (show)

Fixed In Version: RHEL: ceph-0.94.5-2.el7cp Ubuntu: ceph_0.94.5-2redhat1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-29 14:42:21 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 12038 0 None None None Never
Red Hat Product Errata RHBA-2016:0313 0 normal SHIPPED_LIVE Red Hat Ceph Storage 1.3.2 bug fix and enhancement update 2016-02-29 19:37:43 UTC

Description John Wilkins 2015-06-05 21:38:05 UTC
Description of problem:

To change the port setting on Civetweb, the end user must add the following to a ceph configuration file, 

rgw_frontends = "civetweb port=80"

If the string is not enclosed in quotes, it doesn't work. If there is white space between port = 80, it doesn't work. Sometimes end users, for their own aesthetic reasons like a little bit of white space, or omitting quotes when there is only one setting. It would be nice if the parser was a bit more forgiving. 


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


How reproducible:

Every time. 


Steps to Reproduce:
1. Add [client.rgw.<node-name>]\rgw_frontends = 
2. rgw_frontends = civetweb port 80
3. rgw_frontends = civetweb port = 80
4. rgw_frontends = civetweb port=80

Etc. 

It only works if you add it as

rgw_frontends = "civetweb port=80"

It does not work if you add it as

rgw_frontends = "civetweb port = 80"

It's very finnicky. 

Actual results:


Expected results:


Additional info:

Comment 2 Sage Weil 2015-06-16 18:52:08 UTC
added upstream ticket

Comment 3 Ken Dreyer (Red Hat) 2015-07-16 01:23:39 UTC
Upstream PR is still undergoing review to master, so I'm re-targeting this to 1.3.2

Comment 4 Yehuda Sadeh 2015-09-08 17:46:33 UTC
I'm having second thoughts about the necessity of this one. It can lead to ambiguous parsing, maybe the solution here is to have rgw be more verbose when it sees such a config?

Comment 5 Yehuda Sadeh 2015-09-22 17:59:47 UTC
How about a solution where when there's a space before an equal sign in the rgw frontends configurable we dump an explicit warning?

Comment 6 Federico Lucifredi 2015-10-12 19:30:10 UTC
I think warnings are okay if we can warn uniformly for all such problems (and maybe suggest quotes where appropriate?).

Comment 7 Ken Dreyer (Red Hat) 2015-12-11 19:47:22 UTC
Matt will create a PR for this issue next week.

Comment 8 Ken Dreyer (Red Hat) 2016-01-18 21:11:43 UTC
https://github.com/ceph/ceph/pull/6944 was merged upstream; the exact commit to cherry-pick is 93497e576a946ed7e59f4a4299e447b65aa1774b , "rgw: warn on suspicious civetweb frontend parameters"

Comment 11 shilpa 2016-01-22 13:15:03 UTC
Testing this BZ on ceph-radosgw-0.94.5-3.el7cp.x86_64

From the comments I understand that we are warning about the space before and after the '=' in civetweb frontend param. 

This is my observation:

1. Without '=' b/w port and 80.

rgw_frontends = "civetweb port 80" 
or
rgw_frontends = civetweb port 80 

==============
2016-01-22 12:36:36.733979 7eff3a1cc900  0 starting handler: civetweb
2016-01-22 12:36:36.734004 7eff3a1cc900  0 civetweb: 0xaa05a0: Invalid option: 80
==============

Maybe we can warn about the missing '=' in rgw_frontends param? Ensures consistency.


2. With space.

rgw_frontends = "civetweb port = 80"

==============
2016-01-22 12:36:36.733942 7eff3a1cc900 -1 WARNING: civetweb frontend config found unexpected spacing around 'port' (ensure civetweb port parameter has the form 'port=80' with no spaces before or after '=')
2016-01-22 12:36:36.733979 7eff3a1cc900  0 starting handler: civetweb
2016-01-22 12:36:36.734004 7eff3a1cc900  0 civetweb: 0xaa05a0: Invalid option:
==============

This seems fine to me.


3. With and without quotes. Expected to start civetweb on port 80 works fine.

rgw_frontends = civetweb port=80
rgw_frontends = "civetweb port=80"

Comment 12 Yehuda Sadeh 2016-01-28 16:18:11 UTC
I don't think that introducing  more ad hoc checks for the 'port 80' use case is worth our time.

Comment 13 shilpa 2016-01-28 16:58:22 UTC
(In reply to Yehuda Sadeh from comment #12)
> I don't think that introducing  more ad hoc checks for the 'port 80' use
> case is worth our time.

Agreed. Fix works as expected. Verified.

Comment 15 errata-xmlrpc 2016-02-29 14:42:21 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, 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-2016:0313


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