On 29/11/13 18:03, Alexandre Beauclair wrote:
Hi there!

I'm currently running on Gitorious v2.4.11.
I already have an install running fine on our production Centos6 server.
I just setup a new one for our test environment, and it seems I can't login 
with an LDAP user at all. I does work for the admin created with the script 
though.

If I try entering the wrong credentials, it tells me so (so I guess it queries the LDAP 
server accordingly). If I enter the correct credentials, it gives the dreaded 
"Sorry, something went wrong" page.

Here's what I found in my logs. This appears whenever I try to log in using an 
LDAP user. Please keep in mind I'm by no means knowledgeable about Ruby, so if 
this seems obvious, it doesn't to me ;)

NoMethodError (undefined method `size' for nil:NilClass):
   lib/gitorious/authentication/ldap_authentication.rb:122:in `auto_register'
   lib/gitorious/authentication/ldap_authentication.rb:102:in `authenticate'
   lib/gitorious/authentication.rb:25:in `authenticate'
   lib/gitorious/authentication.rb:24:in `each'
   lib/gitorious/authentication.rb:24:in `authenticate'
   app/controllers/sessions_controller.rb:111:in `password_authentication'
   app/controllers/sessions_controller.rb:43:in `create'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/base.rb:1333:in
 `send'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/base.rb:1333:in
 `perform_action_without_filters'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/filters.rb:617:in
 `call_filters'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/filters.rb:610:in
 `perform_action_without_benchmark'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/benchmarking.rb:68:in
 `perform_action_without_rescue'
   
vendor/bundle/ruby/1.8/gems/activesupport-2.3.17/lib/active_support/core_ext/benchmark.rb:17:in
 `ms'
   /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/1.8/benchmark.rb:308:in 
`realtime'
   
vendor/bundle/ruby/1.8/gems/activesupport-2.3.17/lib/active_support/core_ext/benchmark.rb:17:in
 `ms'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/benchmarking.rb:68:in
 `perform_action_without_rescue'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/rescue.rb:160:in
 `perform_action_without_flash'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/flash.rb:151:in
 `perform_action'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/base.rb:532:in
 `send'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/base.rb:532:in
 `process_without_filters'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/filters.rb:606:in
 `process'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/base.rb:391:in
 `process'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/base.rb:386:in
 `call'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/routing/route_set.rb:438:in
 `call'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:87:in
 `dispatch'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:121:in
 `_call'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:130:in
 `build_middleware_stack'
   
vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:29:in
 `call'
   
vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:29:in
 `call'
   
vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
 `cache'
   
vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:9:in
 `cache'
   
vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:28:in
 `call'
   
vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
 `call'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/string_coercion.rb:25:in
 `call'
   vendor/bundle/ruby/1.8/gems/rack-1.1.6/lib/rack/head.rb:9:in `call'
   vendor/bundle/ruby/1.8/gems/rack-1.1.6/lib/rack/methodoverride.rb:24:in 
`call'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/params_parser.rb:15:in
 `call'
   vendor/bundle/ruby/1.8/gems/rails-2.3.17/lib/rails/rack/metal.rb:47:in `call'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/session/cookie_store.rb:99:in
 `call'
   
vendor/bundle/ruby/1.8/gems/activesupport-2.3.17/lib/active_support/cache/strategy/local_cache.rb:25:in
 `call'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/failsafe.rb:26:in
 `call'
   vendor/bundle/ruby/1.8/gems/rack-1.1.6/lib/rack/lock.rb:11:in `call'
   vendor/bundle/ruby/1.8/gems/rack-1.1.6/lib/rack/lock.rb:11:in `synchronize'
   vendor/bundle/ruby/1.8/gems/rack-1.1.6/lib/rack/lock.rb:11:in `call'
   
vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:106:in
 `call'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/rack/request_handler.rb:96:in
 `process_request'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_request_handler.rb:516:in
 `accept_and_process_next_request'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_request_handler.rb:274:in
 `main_loop'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in
 `start_request_handler'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in
 `send'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in
 `handle_spawn_application'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb:470:in
 `safe_fork'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in
 `handle_spawn_application'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in
 `__send__'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in
 `server_main_loop'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in
 `start_synchronously'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:180:in
 `start'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in
 `start'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:219:in
 `spawn_rails_application'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:132:in
 `lookup_or_add'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:214:in
 `spawn_rails_application'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:82:in
 `synchronize'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:79:in
 `synchronize'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:213:in
 `spawn_rails_application'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:132:in
 `spawn_application'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:275:in
 `handle_spawn_application'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in
 `__send__'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in
 `server_main_loop'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in
 `start_synchronously'
   
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/helper-scripts/passenger-spawn-server:99


I'm pretty much at a loss as to what I should do, as my configs are similar to 
the working install (adapted for the test install of course). Thanks for any 
input you can give me!

It looks like the connection.search(...) call returns nothing (nil) and the code doesn't handle that (it expects an array of results, even empty would do). I am not familiar with LDAP code in Gitorious yet but this is most probably because of some wrong LDAP settings.

We have a LDAP connection testing app that you can use. It's here: https://gitorious.org/gitorious/mainline/source/8c56a12a1348211317281b1156a44acc172d9685:ldap-wizard It was built with Gitorious 3 authentication.yml file in mind but you may try to use it with your config file. (you may need to `gem install sinatra` before running it).

Marcin

--
--
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- You received this message because you are subscribed to the Google Groups "Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to