internal server errors on certain svn repositories

Added by Wessel Pieterse over 7 years ago

Certain repo's seem to be getting 500 internal server errors.

Production log below.

Processing RepositoriesController#show (for 192.168.10.108 at 2010-07-28 14:52:46) [GET]
Parameters: {"action"=>"show", "id"=>"mtnc", "controller"=>"repositories"}

NoMethodError (undefined method `left' for nil:NilClass):
app/models/changeset.rb:163:in `find_referenced_issues_by_id'
app/models/changeset.rb:162:in `select'
app/models/changeset.rb:162:in `find_referenced_issues_by_id'
app/models/changeset.rb:103:in `scan_comment_for_issue_ids'
app/models/changeset.rb:100:in `each'
app/models/changeset.rb:100:in `scan_comment_for_issue_ids'
app/models/changeset.rb:77:in `after_create'
app/models/repository/subversion.rb:59:in `fetch_changesets'
app/models/repository/subversion.rb:58:in `fetch_changesets'
app/models/repository/subversion.rb:57:in `reverse_each'
app/models/repository/subversion.rb:57:in `fetch_changesets'
app/controllers/repositories_controller.rb:70:in `show'
/usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:95:in `process_request'
/usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:374:in `start_request_handler'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:332:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:330:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:209:in `start'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/phusion_passenger/passenger-spawn-server:61

Any help will be greatly appreciated.

Replies (6)

RE: internal server errors on certain svn repositories - Added by Wessel Pieterse over 7 years ago

I jave found the rpoblem seems there where ticket numbers in the changeset comments in the svn repo. As there whereno corresponding tickets in the redmine system it was crashing.

I have stripped all these out of the repo and everything works well now.

RE: internal server errors on certain svn repositories - Added by Florian Pfann about 7 years ago

Hi
we had the same Problem with our Test Project.
We are using Redmine 1.0.2

Here are the steps to get the error:
1 Create a project (TEST1) with a SVN Repository
2 Add some comments and tickets
3 Delete the project (TEST1)
4 Create a new project (TEST2) with the same SVN Repository

The problem is that the issues, related to the project TEST1, won't be deleted.

app/models/changeset.rb at line 171 tries to select all issues for a project.
Now there are Issues related to a Project that was still removed (TEST1) - but the Issues are still there
So issue.project (for these Issues) will be nil and you get the Exception.

One solution is to delete all Issuses without a project
or change the line 171 (app/models/changeset.rb)

project issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project

to

(issue.project != nil) && (project issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project))

so long
Florian Pfann

RE: internal server errors on certain svn repositories - Added by Tom DeMay almost 7 years ago

I just encountered the same error. But I didn't delete any projects. Don't know what it was looking for. But your fixed solved the problem. Thank you. Hopefully a bug has been files.

BTW, I think you meant to put double equal in test condition for project is equal to issue.project

(issue.project != nil) && (project == issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project))

RE: internal server errors on certain svn repositories - Added by Max Khon over 6 years ago

Redmine 1.1.0

The problem still exists and the patch really solves the problem. Is there a reference to the issue available? Was it ever created?

(1-6/6)