Bug 916758

Summary: Missing or unreadable broker configuration file produces confusing stacktrace
Product: OpenShift Online Reporter: John R <john>
Component: PodAssignee: Dan McPherson <dmcphers>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.xCC: dmcphers, jhou
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-09 15:17:25 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:

Description John R 2013-02-28 20:42:58 UTC
Description of problem:

Need better message when openshift-origin-common/config.rb fails to parse a config file.

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

github.com/openshift/origin-server/master

How reproducible:

Steps to Reproduce:
1. Set to broker to development mode.
2. Run from init script.
3. Set /etc/broker-dev.conf to root:root, 640 perms.
4. Hit broker rest api.
  
Actual results:

/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-common-1.4.4/lib/openshift-origin-common/config.rb	31	in `exit'
1	/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-common-1.4.4/lib/openshift-origin-common/config.rb	31	in `rescue in initialize'
2	/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-common-1.4.4/lib/openshift-origin-common/config.rb	27	in `initialize'
3	/var/www/openshift/broker/config/environments/development.rb	41	in `new'
4	/var/www/openshift/broker/config/environments/development.rb	41	in `block in '
[...]

Expected results:

Something like this would be helpful:
Failed to open/read/parse/ingest/consume/process configuration file: /etc/openshift/broker-dev.conf


Additional info:

Comment 1 Dan McPherson 2014-03-13 21:28:08 UTC
https://github.com/openshift/origin-server/pull/4957

Comment 2 openshift-github-bot 2014-03-13 22:35:05 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/4e0567d17d6974e92b21a809f23fdbb1300edb87
Bug 916758 - Give better message on config failure

Comment 3 Jianwei Hou 2014-03-14 02:51:39 UTC
Verified on devenv_4509

1. Make the broker-dev.conf unreadable: chmod -r broker-dev.conf
2. Restart broker
3. Invoke restapi against broker: curl -k https://localhost/broker/rest/api

Result:
Got error: Could not open config file /etc/openshift/broker-dev.conf: Permission denied - /etc/openshift/broker-dev.conf is not readable