Description of problem: # vim /etc/cumin/cumin.conf ... [web] # log-file: $CUMIN_HOME/log/web.log # host: localhost ('0.0.0.0' binds to all local interfaces) host: 0.0.0.0 # port: 45672 # operator-email: [none] # update-interval: 10 ... # service cumin restart Stopping cumin: [ OK ] Starting cumin: [ OK ] # Traceback (most recent call last): File "/usr/bin/cumin-data", line 78, in ? main() File "/usr/bin/cumin-data", line 14, in main config, values, opts, args = get_configuration(CuminDataOptionParser(), CuminDataConfig) File "/usr/share/cumin/python/cumin/config.py", line 172, in get_configuration values = config.parse() File "/usr/share/cumin/python/cumin/config.py", line 30, in parse return self.parse_files(paths) File "/usr/share/cumin/python/parsley/config.py", line 13, in parse_files found = parser.read(paths) File "/usr/lib64/python2.4/ConfigParser.py", line 267, in read self._read(fp, filename) File "/usr/lib64/python2.4/ConfigParser.py", line 490, in _read raise e ConfigParser.ParsingError: File contains parsing errors: /etc/cumin/cumin.conf [line 11]: ' host: 0.0.0.0\n' Traceback (most recent call last): File "/usr/bin/cumin-web", line 51, in ? main() File "/usr/bin/cumin-web", line 14, in main config, values, opts, args = get_configuration(CuminWebOptionParser(), CuminWebConfig) File "/usr/share/cumin/python/cumin/config.py", line 172, in get_configuration values = config.parse() File "/usr/share/cumin/python/cumin/config.py", line 30, in parse return self.parse_files(paths) File "/usr/share/cumin/python/parsley/config.py", line 13, in parse_files found = parser.read(paths) File "/usr/lib64/python2.4/ConfigParser.py", line 267, in read self._read(fp, filename) File "/usr/lib64/python2.4/ConfigParser.py", line 490, in _read raise e ConfigParser.ParsingError: File contains parsing errors: /etc/cumin/cumin.conf [line 11]: ' host: 0.0.0.0\n' Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: 1. add leading space character(s) to any variable 2. service cumin start Actual results: It raises exception again and again in infinite loop. command service end with 0. Expected results: If there is any exception in cumin, service will end with non zero value. It will be able to handle variables with leading space character(s)
Revision 4770. Lines beginning with white space are an indicator of a continuation from a previous line in the Python ConfigParser class, so the parse error is actually correct from the point of view of the object we're using -- there is no preceding line that has been continued. Continuous looping should be gone. Furthermore, the parse error exception trace should be visible in master.log.
Verified in cumin-0.1.4840-1.el6.noarch Message is also written to master.log ------------------------------------------------------ Traceback (most recent call last): File "/usr/bin/cumin-admin", line 372, in <module> main() File "/usr/bin/cumin-admin", line 37, in main values = config.parse() File "/usr/share/cumin/python/cumin/config.py", line 104, in parse return self.parse_files(paths) File "/usr/share/cumin/python/parsley/config.py", line 13, in parse_files found = parser.read(paths) File "/usr/lib64/python2.6/ConfigParser.py", line 286, in read self._read(fp, filename) File "/usr/lib64/python2.6/ConfigParser.py", line 510, in _read raise e ConfigParser.ParsingError: File contains parsing errors: /etc/cumin/cumin.conf [line 16]: ' brokers: cumin/cumin@localhost:5672\n' [line 17]: ' sasl-mech-list: plain\n'
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause The configuration parser used by cumin treats a line beginning with white space as a continuation of the previous line. Putting white space at the beginning of a line in cumin.conf that is not a valid continuation of the previous line may result in a parsing error. This is expected, but previously cumin did not handle parsing errors gracefully. Consequence Errors were not clearly communicated to the user and in some prior releases the cumin service would restart the application in an endless loop. Fix Parsing errors are caught by the cumin master script and exception traces are recorded in log files under /var/log/cumin. Result A parsing error will result in a [FAILED] result when the service is started. Additionally, the exception trace produced by the parser will be recorded in a log file under /var/log/cumin (the file will depend on which cumin-data or cumin-web instance first detected the error).
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,11 +1 @@ -Cause +Cumin's configuration file parser treats a line that begins with whitespace as a continuation of the previous line. In cumin.conf, whitespace at the beginning of a line that was not a (valid) continuation of the previous line caused parsing errors which were not communicated to the user, and which could have caused the cumin service to restart the application in an endless loop. With this update, any parsing errors are caught by the init script, any exception traces are recorded in log files under the /var/log/cumin/ directory (the exact file depends on whether cumin-data or cumin-web first detected the error), and a parsing error results in the service failing upon startup (with "[FAILED]" printed to alert the user).- The configuration parser used by cumin treats a line beginning with white space as a continuation of the previous line. Putting white space at the beginning of a line in cumin.conf that is not a valid continuation of the previous line may result in a parsing error. This is expected, but previously cumin did not handle parsing errors gracefully. - -Consequence - Errors were not clearly communicated to the user and in some prior releases the cumin service would restart the application in an endless loop. - -Fix - Parsing errors are caught by the cumin master script and exception traces are recorded in log files under /var/log/cumin. - -Result - A parsing error will result in a [FAILED] result when the service is started. Additionally, the exception trace produced by the parser will be recorded in a log file under /var/log/cumin (the file will depend on which cumin-data or cumin-web instance first detected the error).
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-1249.html