ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Error 500 when removing user from group (Bug #889)


Added by Jesse Long at 2012-02-15 07:37 am. Updated at 2012-03-01 01:26 am.


Status:Open Start date:2012-02-15
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Remote issue URL: Affected version:3.0.0

Description

After upgrading from Redmine 1.1.0 to ChiliProject 3.0.0, attempt to change the groups to which a user belongs, deselect current group (only belongs to 1 group), and select other new group, click save. I get error 500.

URL is http://my.site/users/13/edit in the Groups tab.

production.log entry:

Processing UsersController#update (for 41.133.76.144 at 2012-02-15 09:18:05) [PUT]
  Parameters: {"_method"=>"put", "authenticity_token"=>"4XtmoH/Q1bCaXTs3fJ2w6kY/cu0wQx5qYb2G7Ja5gaw=", "user"=>{"group_ids"=>["42", ""]}, "commit"=>"Save", "controller" 
=>"users", "action"=>"update", "id"=>"13"}

NoMethodError (undefined method `id' for nil:NilClass):
  app/models/member.rb:68:in `before_destroy'
  app/models/member_role.rb:38:in `remove_member_if_empty'
  app/models/group.rb:47:in `each'
  app/models/group.rb:47:in `block in user_removed'
  app/models/group.rb:46:in `user_removed'
  app/models/user.rb:44:in `block in <class:User>'
  lib/redmine/safe_attributes.rb:74:in `safe_attributes='
  app/controllers/users_controller.rb:139:in `update'
  <internal:prelude>:10:in `synchronize'

... and passenger stand alone stack...


Associated revisions

Revision de5b0ad0
Added by Jean-Philippe Lang at 2008-03-23 09:34 am

Translations (closes #875, #876, #889, #891, #909):
  • Norwegian added (Kai Olav Fredriksen)
  • Finnish updated (Antti Perkiömäki)
  • Czech updated (Maxim KruÅ¡ina)
  • Russian updated (Michael Pirogov)
  • Polish updated (Mariusz Olejnik)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1289 e93f8b46-1217-0410-a6f0-8f06a7374b81

History

Updated by Felix Schäfer at 2012-03-01 01:26 am

I can't reproduce this but had a look at where in the code this happens and I don't really understand why this happens. Did or do you use any plugin, especially one managing users, groups or projects?

Could you open a rails console (in your chiliproject directory, run RAILS_ENV=production script/console -s, it will run in sandbox mode, i.e. nothing should happen to your data) and run:

Member.all.select {|m| m.project.nil?}

Normally this should return an empty array [], if it doesn't you probably have some data corruption we'll have to take care of.

Also available in: Atom PDF