Project

General

Profile

Actions

Defect #10053

closed

undefined method `<=>' for nil:NilClass when accessing the settings of a project

Added by Jordi Clariana over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Category:
Project settings
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Hi,

I have this error when I access a specific project:

ActionView::TemplateError (undefined method `<=>' for nil:NilClass) on line #3 of app/views/projects/settings/_members.rhtml:
1: <%= error_messages_for 'member' %>
2: <% roles = Role.find_all_givable
3:    members = @project.member_principals.find(:all, :include => [:roles, :principal]).sort %>
4: 
5: <div class="splitcontentleft">
6: <% if members.any? %>

    app/models/member.rb:53:in `<=>'
    app/views/projects/settings/_members.rhtml:3:in `sort'
    app/views/projects/settings/_members.rhtml:3:in `_run_rhtml_app47views47projects47settings47_members46rhtml_locals_members_object_tab'
    app/views/common/_tabs.rhtml:24:in `_run_rhtml_app47views47common47_tabs46rhtml_locals_object_tabs'
    app/views/common/_tabs.rhtml:23:in `each'
    app/views/common/_tabs.rhtml:23:in `_run_rhtml_app47views47common47_tabs46rhtml_locals_object_tabs'
    app/helpers/application_helper.rb:204:in `render_tabs'
    app/views/projects/settings.rhtml:3:in `_run_rhtml_app47views47projects47settings46rhtml'

Rendering /data/www/redmine/public/500.html (500 Internal Server Error)

I have found this old issue: http://www.redmine.org/issues/4563, but executing:

ruby /var/www/redmine/script/runner -e production "Member.find(:all, :include => [:roles, :principal]).select {|m| m.roles.empty? || m.principal.nil?}"

do not return anything.

Am I doing something wrong or is this actually a bug?
If this is a DB problem, can you point me how to fix it?

Thanks.


Related issues

Related to Redmine - Defect #32704: ActionView::Template::Error (undefined method `position' for nil:NilClass):Closed

Actions
Actions #1

Updated by Jordi Clariana over 12 years ago

Forgot to mention my Redmine version: 1.3.0, I can't see how to update "Affected version" field...

Actions #2

Updated by Derick Potgieter over 12 years ago

Having the same issue only on certain projects. I have over 100 projects on redmine clustered over 3 mongrel servers with an apache load balancer in front. Most projects worked but some return this error after upgrading to 1.3.0

Actions #3

Updated by Robson Peixoto over 12 years ago

I solved it removing all user of the project direct from DB.

Actions #4

Updated by Etienne Massip over 12 years ago

Please give details according to SubmittingBugs.

And try to reproduce with no plugin installed.

Actions #5

Updated by Jordi Clariana over 12 years ago

Hi,

Etienne, here you have more info:
  • Database Version: Mysql 5.1.49
  • Ruby Version: 1.8.7
  • Rails Version: 2.3.5
  • Redmine Version: 1.1.2 (I said it was 1.3.0, but I was looking at Help tab, and it was a redirection to redmine.org, I didn't notice it :S)

I assume that the error stack trace is what I already posted.

About plugins I can't test it now (there's a lot of people working on this Redmine installation right now), but I'm preparing a test installation and I will try to reproduce the same error.

Actions #6

Updated by Etienne Massip over 12 years ago

  • Affected version (unused) set to 1.1.2
  • Affected version set to 1.1.2
Actions #7

Updated by Jordi Clariana over 12 years ago

Finally I tested it without plugins, and I get the same error.
Increasing log to debug did not help either. I just see the last SQL query, but I don't think is important, because it's run by 'project.member_principals.find' function, and what is really failing here is the data handling (I guess).

Any ideas?

Thanks.

Actions #8

Updated by Jean-Philippe Lang over 12 years ago

  • Category set to Project settings
  • Status changed from New to Confirmed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

You may have an inconsistent member (eg. member without roles) in your database and the sort method raises an error.
This should be fixed by r8863.

Actions #9

Updated by Jordi Clariana over 12 years ago

After applying the patch the error vanished and no further misfunction detected.
This is resolved to me.

Thanks.

Actions #10

Updated by Jean-Philippe Lang over 12 years ago

  • Status changed from Confirmed to Resolved
  • Target version set to 1.3.2

Thanks for the feedback.

Actions #11

Updated by Jean-Philippe Lang over 12 years ago

  • Subject changed from ActionView::TemplateError when accessing the settings of a project to undefined method `<=>' for nil:NilClass when accessing the settings of a project
Actions #12

Updated by Jean-Philippe Lang about 12 years ago

  • Status changed from Resolved to Closed

Merged.

Actions #13

Updated by Go MAEDA almost 4 years ago

  • Related to Defect #32704: ActionView::Template::Error (undefined method `position' for nil:NilClass): added
Actions

Also available in: Atom PDF