Some users broken: Corrupt Database, or Bug?

Added by Moritz Voss over 8 years ago

I recently submitted an issue about database corruption - #6878

Now I can't seem to properly assign users to groups anymore. I get the following error:

Processing UsersController#edit (for 192.168.0.187 at 2010-12-01 13:59:57) [POST]
  Parameters: {"commit"=>"Save", "action"=>"edit", "authenticity_token"=>"5aVuXTwEiudgRefoIyeBHPXVG9PNB60Yfyx1FIkmDmc=", "id"=>"28", "controller"=>"users", "user"=>{"group_ids"=>["12", ""]}}

ActiveRecord::RecordInvalid (Validation failed: Project can't be blank):
  app/models/group.rb:38:in `user_added'
  app/models/group.rb:33:in `user_added'
  app/models/user.rb:36
  app/controllers/users_controller.rb:101:in `edit'

Is this likely to be a db corruption problem, or is it a new bug in redmine? Any idea how to fix this? I am going to look at the MySQL contents now... maybe there are some broken projects left (thought I deleted them all, maybe they are just invisible).

Replies (2)

RE: Some users broken: Corrupt Database, or Bug? - Added by Moritz Voss over 8 years ago

Yep, the project is corrupt. Damn. The project behaves VERY badly when being reparented (circular parenting, etc.)

Any idea (roughly?) how to fix it? Is there some rake script that can troll the DB for some sanity checks?

RE: Some users broken: Corrupt Database, or Bug? - Added by Moritz Voss over 8 years ago

I found a workaround: Duplicate the broken project, delete the old one.

THEN, re-create every single group that this project had roles for (urgh).

(1-2/2)