Bug 916758 - Missing or unreadable broker configuration file produces confusing stacktrace
Summary: Missing or unreadable broker configuration file produces confusing stacktrace
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Dan McPherson
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-28 20:42 UTC by John R
Modified: 2014-04-09 15:17 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-09 15:17:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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


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