Defect #6196

undefined method `stringify_keys!' for #<Array:...>) when logging in, for some users only

Added by mathew murphy about 7 years ago. Updated about 7 years ago.

Status:ClosedStart date:2010-08-23
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Accounts / authentication
Target version:-
Resolution: Affected version:

Description

Processing AccountController#login (for 9.77.143.183 at 2010-08-23 12:31:54) [POST]                                                                             
  Parameters: {"back_url"=>"[CORRECT MAIN SITE URL, FILTERED]", "action"=>"login", "authenticity_token"=>"vXoesYJBWVTEeKS5gpOL2mQZbsrbi4yNj0WaXcnKYh0=", "username"=>"[CORRECT USERNAME, FILTERED]", "controller"=>"account", "password"=>"[FILTERED]", "login"=>"Login ยป"}                                                        

NoMethodError (undefined method `stringify_keys!' for #<Array:0xb511a87c>):     
  app/models/user.rb:118:in `new'                                               
  app/models/user.rb:118:in `try_to_login'                                      
  app/controllers/account_controller.rb:147:in `password_authentication'        
  app/controllers/account_controller.rb:142:in `authenticate_user'              
  app/controllers/account_controller.rb:30:in `login'                           
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/rack/request_handler.rb:81:in `process_request'                                                  
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_request_handler.rb:203:in `main_loop'                                                   
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/railz/application_spawner.rb:340:in `start_request_handler'                                      
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/railz/application_spawner.rb:298:in `handle_spawn_application'                                   
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/utils.rb:181:in `safe_fork'                                                                      
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/railz/application_spawner.rb:296:in `handle_spawn_application'                                   
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:337:in `__send__'                                                             
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:337:in `main_loop'                                                            
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:187:in `start_synchronously'                                                  
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:154:in `start'                                                                
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/railz/application_spawner.rb:192:in `start'                                                      
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/spawn_manager.rb:257:in `spawn_rails_application'                                                
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'                                             
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/spawn_manager.rb:251:in `spawn_rails_application'                                                
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'                                                
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'                                                
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/spawn_manager.rb:250:in `spawn_rails_application'                                                
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/spawn_manager.rb:153:in `spawn_application'                                                      
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/spawn_manager.rb:282:in `handle_spawn_application'                                               
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:337:in `__send__'                                                             
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:337:in `main_loop'                                                            
  /var/lib/gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_server.rb:187:in `start_synchronously'     

Weirdly, it works fine for me, but it fails for some other people.

RedMine 1.0.1
ruby 1.8.6 (2007-09-24 patchlevel 111)
Rails 2.3.8
PostgreSQL 8.2.7
Ubuntu 8.10

History

#1 Updated by mathew murphy about 7 years ago

It looks as though this is caused by my LDAP authentication code returning the attributes using [ :foo => 'bar' ] syntax instead of { :foo => 'bar' }

What isn't clear to me is why the former ever worked...

#2 Updated by Jean-Baptiste Barth about 7 years ago

  • Status changed from New to Closed

Rails 2.3.8 is not supported for the moment. stringify_keys! is part of ActiveSupport::CoreExtensions and may have changed between Rails 2.3.5 and 2.3.8. Can you read requirements and tell us if you see the same problem with supported versions ? I close the issue for the moment, reopen it if you still have problems with those versions.

#3 Updated by mathew murphy about 7 years ago

After changing my code to use curly rather than square brackets for the hash, it works--even with Rails 2.3.8.

Also available in: Atom PDF