Project

General

Profile

Actions

Defect #10879

closed

Searching user causes 500 internal error

Added by Matthias Lindhorst almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Administration
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Hi Guys,

upgrading from 1.2.1 to 1.4.1 worked like a charm, except for one thing.
Whenever searching for a user (calling UserController#index with a search param) I get a 500 internal error.

The log says:

Processing UsersController#index (for xxx.xxx.xxx.xxx at 2012-05-10 18:26:29) [GET]
Parameters: {"name"=>"xyz", "action"=>"index", "group_id"=>"", "controller"=>"users", "status"=>"1"}

NoMethodError (undefined method `call' for nil:NilClass):
app/controllers/users_controller.rb:44:in `index'
passenger (3.0.12) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.12) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.12) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.12) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
passenger (3.0.12) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
passenger (3.0.12) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
passenger (3.0.12) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.12) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
passenger (3.0.12) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.12) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.12) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.12) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.12) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
passenger (3.0.12) lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
passenger (3.0.12) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.12) lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
passenger (3.0.12) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
passenger (3.0.12) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.12) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
passenger (3.0.12) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
passenger (3.0.12) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.12) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.12) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.12) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.12) helper-scripts/passenger-spawn-server:99

Rendering /xxxx/xxxx/xxxx/xxxx/xxxx/xxxx/public/500.html (500 Internal Server Error)

Line 44 of the UsersCoontroller calls the "like" scope of the User model, so i reproduced that call in my rails console resulting in the same error:

u = u.like('mlindh')
NoMethodError: undefined method `call' for nil:NilClass
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:103:in `like'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:186:in `send'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:186:in `method_missing'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/base.rb:2182:in `with_scope'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:118:in `__send__'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:118:in `with_scope'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:179:in `method_missing'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:186:in `send'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:186:in `method_missing'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/base.rb:2182:in `with_scope'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:118:in `__send__'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:118:in `with_scope'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:118:in `__send__'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:118:in `with_scope'
from /xxx/xxx/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/named_scope.rb:179:in `method_missing'
from (irb):2

As you can see in the log I used Passenger 3.0.12 and the following gems are installed:

gem list

LOCAL GEMS

actionmailer (2.3.14)
actionpack (2.3.14)
activerecord (2.3.14)
activeresource (2.3.14)
activesupport (2.3.14)
bundler (1.1.3)
coderay (1.0.6)
edavis10-object_daddy (0.4.3)
fastercsv (1.5.4)
i18n (0.4.2)
json (1.7.1, 1.7.0)
metaclass (0.0.1)
mocha (0.11.4, 0.11.3)
mysql (2.8.1)
net-ldap (0.3.1)
pg (0.13.2)
rack (1.1.3)
rails (2.3.14)
rake (0.9.2.2)
rdoc (3.12)
rmagick (2.13.1)
ruby-openid (2.1.8)
rubygems-bundler (0.9.0)
rvm (1.11.3.3)
shoulda (2.10.3)
sqlite3 (1.3.6)
tzinfo (0.3.33)

I think this behaviour may be related to Issue #10836 .

Kind regards
Matthias

Actions

Also available in: Atom PDF