Bug 853481 - Poor error handling when /etc/ldap_fluff.yml is not readable
Poor error handling when /etc/ldap_fluff.yml is not readable
Status: CLOSED WONTFIX
Product: CloudForms Cloud Engine
Classification: Red Hat
Component: aeolus-conductor (Show other bugs)
1.0.0
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Scott Seago
Rehana
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-31 13:01 EDT by Matt Wagner
Modified: 2014-08-17 18:27 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-17 14:25:25 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matt Wagner 2012-08-31 13:01:28 EDT
Description of problem:
If the ldap_fluff.yml file is not readable, our error messaging is pretty terrible: we display a flash message that says "exit".


Version-Release number of selected component (if applicable):
Observed on master.


How reproducible:
Only when (1) using LDAP authentication, and (2) the Conductor process does not have permission to read /etc/ldap_fluff.yml. #2 should not occur in production unless file permissions/owernship get messed up.


Steps to Reproduce:
1. Configure Conductor to use LDAP authentication (in settings.yml)
2. Ensure that Conductor cannot read /etc/ldap_fluff.yml (for me, this happens when running from source as me, but in an RPM install you could chown the file to some random user, or chmod it to bad permissions.)
3. Attempt to log into Conductor.


Actual results:
A flash message with the text "exit" is displayed, and a stack trace (will place in first comment) is put in the logs.


Expected results:
An error message giving some indication of what is actually wrong is displayed.


Additional info:
I don't believe this is terribly likely to affect too many customers or to appear in production setups, but if it does happen, it's an awful experience, and the only way to debug it is to read the source and piece together what is happening.
Comment 1 Matt Wagner 2012-08-31 13:02:42 EDT
Here is what is displayed in the log -- ldap_fluff calls "exit" in this error condition, and we appear to catch that as an exception and just display it as a flash message.

Started POST "/user_session" for 127.0.0.1 at Fri Aug 31 12:49:39 -0400 2012
Processing by UserSessionsController#create as HTML
  Parameters: {"password"=>"[FILTERED]", "authenticity_token"=>"SFXlOgJV+iiagfZMmSkR93QrbQM1DdipWHVGLKF/2w4=", "commit"=>"Login", "login"=>"admin", "utf8"=>"✓"}
Warden is authenticating admin against ldap
exit
/home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/ldap_fluff-0.1.1/lib/ldap_fluff/config.rb:47:in `exit'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/ldap_fluff-0.1.1/lib/ldap_fluff/config.rb:47:in `initialize'
 /home/mawagner/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/singleton.rb:94:in `new'
 /home/mawagner/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/singleton.rb:94:in `instance'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/ldap_fluff-0.1.1/lib/ldap_fluff/ldap_fluff.rb:8:in `initialize'
 /media/SSD/n1zyy/conductor/src/lib/ldap.rb:21:in `new'
 /media/SSD/n1zyy/conductor/src/lib/ldap.rb:21:in `valid_ldap_authentication?'
 /media/SSD/n1zyy/conductor/src/app/models/user.rb:119:in `authenticate_using_ldap'
 /media/SSD/n1zyy/conductor/src/config/initializers/warden.rb:80:in `authenticate!'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/warden-1.2.0/lib/warden/strategies/base.rb:53:in `_run!'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/warden-1.2.0/lib/warden/proxy.rb:332:in `_run_strategies_for'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/warden-1.2.0/lib/warden/proxy.rb:327:in `each'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/warden-1.2.0/lib/warden/proxy.rb:327:in `_run_strategies_for'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/warden-1.2.0/lib/warden/proxy.rb:300:in `_perform_authentication'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/warden-1.2.0/lib/warden/proxy.rb:113:in `authenticate!'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rails_warden-0.5.6/lib/rails_warden/controller_mixin.rb:54:in `authenticate!'
 /media/SSD/n1zyy/conductor/src/app/controllers/user_sessions_controller.rb:30:in `create'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/abstract_controller/base.rb:167:in `process_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_controller/metal/rendering.rb:10:in `process_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/abstract_controller/callbacks.rb:18:in `process_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:447:in `_run__1200753359__process_action__136913554__callbacks'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `send'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `send'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/abstract_controller/callbacks.rb:17:in `process_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_controller/metal/rescue.rb:29:in `process_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `instrument'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `instrument'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activerecord-3.2.3/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/abstract_controller/base.rb:121:in `process'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/abstract_controller/rendering.rb:45:in `process'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_controller/metal.rb:203:in `dispatch'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_controller/metal.rb:246:in `action'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:73:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:36:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/journey-1.0.3/lib/journey/router.rb:68:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/journey-1.0.3/lib/journey/router.rb:56:in `each'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/journey-1.0.3/lib/journey/router.rb:56:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:600:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/warden-1.2.0/lib/warden/manager.rb:35:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/warden-1.2.0/lib/warden/manager.rb:34:in `catch'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/warden-1.2.0/lib/warden/manager.rb:34:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/sass-3.1.18/lib/sass/../sass/plugin/rack.rb:54:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-1.4.1/lib/rack/conditionalget.rb:35:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/head.rb:14:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/flash.rb:242:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/cookies.rb:338:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activerecord-3.2.3/lib/active_record/query_cache.rb:64:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:467:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `_run__1583444106__call__4__callbacks'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `send'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `send'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:65:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/railties-3.2.3/lib/rails/rack/logger.rb:26:in `call_app'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/railties-3.2.3/lib/rails/rack/logger.rb:16:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/request_id.rb:22:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-restful_submit-1.2.2/lib/rack/rack-restful_submit.rb:25:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/activesupport-3.2.3/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/actionpack-3.2.3/lib/action_dispatch/middleware/static.rb:62:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/railties-3.2.3/lib/rails/engine.rb:479:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/railties-3.2.3/lib/rails/application.rb:220:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/railties-3.2.3/lib/rails/rack/log_tailer.rb:14:in `call'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/thin-1.3.1/lib/thin/connection.rb:80:in `pre_process'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/thin-1.3.1/lib/thin/connection.rb:78:in `pre_process'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/thin-1.3.1/lib/thin/connection.rb:53:in `process'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/thin-1.3.1/lib/thin/connection.rb:38:in `receive_data'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-1.4.1/lib/rack/handler/thin.rb:13:in `run'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/railties-3.2.3/lib/rails/commands/server.rb:70:in `start'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/railties-3.2.3/lib/rails/commands.rb:55
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
 /home/mawagner/.rvm/gems/ruby-1.8.7-p357@conductor-latejuly/gems/railties-3.2.3/lib/rails/commands.rb:50
 script/rails:6:in `require'
 script/rails:6
  Rendered layouts/error.html.haml within layouts/application (0.3ms)
  Rendered layouts/_new_notification.html.haml (0.3ms)
  Rendered layouts/_footer.html.haml (0.1ms)
  Rendered layouts/converge-ui/_header_layout.haml (0.2ms)
  Rendered layouts/converge-ui/base.haml (0.5ms)
  Rendered layouts/converge-ui/shell_layout.haml (2.9ms)
Completed 500 Internal Server Error in 109ms (Views: 106.8ms | ActiveRecord: 0.0ms)
Comment 3 Scott Seago 2013-09-17 14:25:25 EDT
Cloud Engine/conductor 2.0 is not currently planned; this code is no longer maintained.

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