Devise::SessionsController#create 中的 Errno::ETIMEDOUT
我正在尝试创建一个使用带有LDAP Authentication的Devise的 rails 应用程序。
不幸的是,我认为我的 LDAP 设置不正确,但是除了发生 TIMEOUT 之外,我不知道如何打印出更详细的错误信息。
这是我的 ldap 配置:
development:
host: ad.cloud.domain.com
#port: 389
#attribute: cn
base: DC=cloud,DC=domain,DC=com
#admin_user: dc=cloud,dc=domain,dc=com
#admin_password:
ssl: false
# <<: *AUTHORIZATIONS
我知道我们没有使用 SSL,因为我已经从一个类似的 PHP 应用程序移植了这个配置,但是那个 PHP 应用程序没有属性字段。也许这是我不明白的?
我发现了一些 问题,这些问题引用了如何更改错误以及它与网络连接的关系,但我找不到我的资源来了解 Net::LDAP 库以及此连接在哪里失败,我错过了什么,以及我不明白的地方。我已经验证了网络连接,还验证了使用 Windows 客户端匿名访问的 LDAP 权限。
这是输出、跟踪和转储:
Errno::ETIMEDOUT in Devise::SessionsController#create
Connection timed out - connect(2)
Rails.root: /vagrant/zeus2
Application Trace | Framework Trace | Full Trace
net-ldap (0.2.2) lib/net/ldap.rb:1102:in `initialize'
net-ldap (0.2.2) lib/net/ldap.rb:1102:in `new'
net-ldap (0.2.2) lib/net/ldap.rb:1102:in `initialize'
net-ldap (0.2.2) lib/net/ldap.rb:632:in `new'
net-ldap (0.2.2) lib/net/ldap.rb:632:in `search'
net-ldap (0.2.2) lib/net/ldap.rb:1038:in `search_root_dse'
net-ldap (0.2.2) lib/net/ldap.rb:1089:in `paged_searches_supported?'
net-ldap (0.2.2) lib/net/ldap.rb:618:in `search'
devise_ldap_authenticatable (0.6.1) lib/devise_ldap_authenticatable/ldap_adapter.rb:239:in `search_for_login'
devise_ldap_authenticatable (0.6.1) lib/devise_ldap_authenticatable/ldap_adapter.rb:117:in `dn'
devise_ldap_authenticatable (0.6.1) lib/devise_ldap_authenticatable/ldap_adapter.rb:156:in `authorized?'
devise_ldap_authenticatable (0.6.1) lib/devise_ldap_authenticatable/ldap_adapter.rb:14:in `valid_credentials?'
devise_ldap_authenticatable (0.6.1) lib/devise_ldap_authenticatable/model.rb:45:in `valid_ldap_authentication?'
activesupport (3.2.9) lib/active_support/core_ext/object/try.rb:36:in `try'
devise_ldap_authenticatable (0.6.1) lib/devise_ldap_authenticatable/model.rb:91:in `authenticate_with_ldap'
devise_ldap_authenticatable (0.6.1) lib/devise_ldap_authenticatable/strategy.rb:12:in `authenticate!'
warden (1.2.1) lib/warden/strategies/base.rb:53:in `_run!'
warden (1.2.1) lib/warden/proxy.rb:354:in `block in _run_strategies_for'
warden (1.2.1) lib/warden/proxy.rb:349:in `each'
warden (1.2.1) lib/warden/proxy.rb:349:in `_run_strategies_for'
warden (1.2.1) lib/warden/proxy.rb:319:in `_perform_authentication'
warden (1.2.1) lib/warden/proxy.rb:127:in `authenticate!'
devise (2.1.2) app/controllers/devise/sessions_controller.rb:15:in `create'
actionpack (3.2.9) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.9) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.9) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.9) lib/active_support/callbacks.rb:458:in `_run__149452621__process_action__873933735__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.9) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.9) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.9) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.9) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.9) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.9) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.9) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.9) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.9) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.9) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:36:in `call'
actionpack (3.2.9) lib/action_dispatch/routing/mapper.rb:42:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:601:in `call'
sass (3.2.3) lib/sass/plugin/rack.rb:54:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.9) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `_run__925590754__call__304840360__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.9) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.9) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.9) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.9) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.9) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.9) lib/rails/engine.rb:479:in `call'
railties (3.2.9) lib/rails/application.rb:223:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.9) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
Request
Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"secrettoken=",
"user"=>{"username"=>"user",
"password"=>"[FILTERED]",
"remember_me"=>"0"},
"commit"=>"Sign in"}
Show session dump
_csrf_token: "secrettoken="
session_id: "c1e99ab4696da4ad64f6a56cc784d0eb"
Show env dump
GATEWAY_INTERFACE: "CGI/1.1"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_CHARSET: "ISO-8859-1,utf-8;q=0.7,*;q=0.3"
HTTP_ACCEPT_ENCODING: "gzip,deflate,sdch"
HTTP_ACCEPT_LANGUAGE: "en-US,en;q=0.8"
HTTP_CACHE_CONTROL: "max-age=0"
REMOTE_ADDR: "10.0.2.2"
REMOTE_HOST: "10.0.2.2"
SERVER_NAME: "localhost"
SERVER_PROTOCOL: "HTTP/1.1"
Response
Headers:
None
谢谢!