Defect #6764

NoMethodError in Projects#settings

Added by Mezz Anon over 11 years ago. Updated over 11 years ago.

Status:ClosedStart date:2010-10-28
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution:Cant reproduce Affected version:


When viewing the Settings for a project I'm getting this error:

NoMethodError in Projects#settings

Showing app/views/projects/settings/_members.rhtml where line #3 raised:

undefined method `<=>' for nil:NilClass

Extracted source (around line #3):

1: <%= error_messages_for 'member' %>
2: <% roles = Role.find_all_givable
3:    members = @project.member_principals.find(:all, :include => [:roles, :principal]).sort %>
5: <div class="splitcontentleft">
6: <% if members.any? %>


abstract (1.0.0)
actionmailer (2.3.5, 2.3.2)
actionpack (2.3.5, 2.3.2)
activerecord (2.3.5, 2.3.2)
activeresource (2.3.5, 2.3.2)
activesupport (2.3.5, 2.3.2)
arel (1.0.1)
builder (2.1.2)
bundler (1.0.0)
erubis (2.6.6)
fastthread (1.0.7)
i18n (0.3.7)
mail (2.2.5)
mime-types (1.16)
mysql (2.8.1)
passenger (2.2.15)
polyglot (0.3.1)
rack (1.2.1, 1.0.1)
rack-mount (0.6.13)
rack-test (0.5.4)
rails (2.3.5, 2.3.2)
rake (0.8.7, 0.8.3)
rubygems-update (1.3.7)
thor (0.14.0)
treetop (1.4.8)
tzinfo (0.3.23)

Using r3559.

Only one project is affected, other project settings can be viewed/modified without issue.


#1 Updated by Felix Schäfer over 11 years ago

It seems your DB is corrupted. Have you removed users from the DB by hand?

#2 Updated by Mezz Anon over 11 years ago

I didn't think so, however I just checked the users table and there is an id increment missing so it looks to be the case. I went through all tables and found a single record the for the missing user_id under the member_roles table. Other than that the id was not linked to any other records as either user_id or author_id.

Is there a way to get this working?

#3 Updated by Felix Schäfer over 11 years ago

Have a look at what project the entry in member_roles points to, and if it's the same project you are getting the error in it probably is safe to delete it (make backups, and so on!) and that should get you a consistent state again.

#4 Updated by Mezz Anon over 11 years ago

Turns out an active user had no role set for the project, which can be set under Users->Projects. After removing the user from the project (assigning a role also worked) the settings page loaded fine.

#5 Updated by Felix Schäfer over 11 years ago

  • Status changed from New to Closed
  • Resolution set to Cant reproduce

Great, thanks for the feedback.

Also available in: Atom PDF