Vote #71241
完了undefined method `<=>' for nil:NilClass when accessing the settings of a project
0%
説明
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: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.
journals
Forgot to mention my Redmine version: 1.3.0, I can't see how to update "Affected version" field...
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
I solved it removing all user of the project direct from DB.
--------------------------------------------------------------------------------
Please give details according to [[SubmittingBugs]].
And try to reproduce with no plugin installed.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
After applying the patch the error vanished and no further misfunction detected.
This is resolved to me.
Thanks.
--------------------------------------------------------------------------------
Thanks for the feedback.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Merged.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
related_issues
relates,New,32704,ActionView::Template::Error (undefined method `position' for nil:NilClass):