Project

General

Profile

Actions

Defect #4725

open

Error displaying Project's Settings when repository configured

Added by the abstrak almost 15 years ago. Updated about 13 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
2010-02-03
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

After the migration from 0.8.7 to 0.9.1, Redmine display a 500 Internal Error when I click "Settings" on a project that have a repository (subversion).

Before 0.9.1 (with 0.8.7):
  • The repository was configured with redmine 0.8.7 and work correctly.
  • Viewing repository work.
  • Settings can be displayed correctly.
After 0.9.1:
  • Viewing repository work!
  • Settings cannot be displayed at all on a project with a repository configured!
  • Settings can be displayed correctly on a project without repository.

Log file :

ActionView::TemplateError (Missing host to link to! Please provide :host parameter or set default_url_options[:host]) on line #10 of app/views/projects/settings/_repository.rhtml:
7:
8: <div class="box tabular">
9: <p><label><%= l(:label_scm) %></label><%= scm_select_tag(@repository) %></p>
10: <%= repository_field_tags(f, @repository) if @repository %>
11: </div>
12:
13: <div class="contextual">

    (eval):20:in `root_url'
    app/helpers/repositories_helper.rb:149:in `subversion_field_tags'
    app/helpers/repositories_helper.rb:124:in `send'
    app/helpers/repositories_helper.rb:124:in `repository_field_tags'
    app/views/projects/settings/_repository.rhtml:10:in `_run_rhtml_app47views47projects47settings47_repository46rhtml_locals_object_repository_tab'
    app/views/projects/settings/_repository.rhtml:1:in `_run_rhtml_app47views47projects47settings47_repository46rhtml_locals_object_repository_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:182:in `render_tabs'
    app/views/projects/settings.rhtml:3:in `_run_rhtml_app47views47projects47settings46rhtml'
    passenger (2.2.5) lib/phusion_passenger/rack/request_handler.rb:95:in `process_request'
    passenger (2.2.5) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
    passenger (2.2.5) lib/phusion_passenger/railz/application_spawner.rb:378:in `start_request_handler'
    passenger (2.2.5) lib/phusion_passenger/railz/application_spawner.rb:336:in `handle_spawn_application'
    passenger (2.2.5) lib/phusion_passenger/utils.rb:183:in `safe_fork'
    passenger (2.2.5) lib/phusion_passenger/railz/application_spawner.rb:334:in `handle_spawn_application'
    passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:163:in `start'
    passenger (2.2.5) lib/phusion_passenger/railz/application_spawner.rb:213:in `start'
    passenger (2.2.5) lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
    passenger (2.2.5) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
    passenger (2.2.5) lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
    passenger (2.2.5) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
    passenger (2.2.5) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    passenger (2.2.5) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
    passenger (2.2.5) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
    passenger (2.2.5) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
    passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

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

Please try to fix...

How can I help you ?


Files

repository_patch.diff (562 Bytes) repository_patch.diff Patch for the Repository model Marko Roeder, 2011-01-18 17:03

Related issues

Related to Redmine - Defect #6713: Git: Not able to Resetting Redmine project respositoryNewToshi MARUYAMA2010-10-20

Actions
Related to Redmine - Defect #8458: Subversion: Delete invalid repository fails using the libsvn pluginClosedToshi MARUYAMA2011-05-29

Actions
Related to Redmine - Feature #1406: Browse through Git branchesClosedEric Davis2008-06-09

Actions
Actions #1

Updated by Jean-Philippe Lang almost 15 years ago

I can't reproduce. Project settings with a svn repository configured display just fine.

How can I help you ?

You can provide the information requested in SubmittingBugs.

Actions #2

Updated by the abstrak almost 15 years ago

NOTE: I had already followed all steps from : RedmineUpgrade

Below are the SubmittingBugs information requested:

I thought I found the problem : rubygem-rails-2.3.4.

The FreeBSD port of redmine-0.9.1 don't depends on rubygem-rails at all (on debian it is).
And the latest current stable port of rubygem-rails on FreeBSD is 2.3.4.
Perhaps because rubygem-rails-2.3.5 is not currently released officially as I can see.

Redmine FreeBSD port (Maintained by: ) depends on :
libiconv-1.13.1, mysql-client-5.0.89, ruby+nopthreads-1.8.7.248,1, ruby18-gems-1.3.5, ruby18-iconv-1.8.7.248,1, ruby18-mysql-2.8.1, rubygem-rake-0.8.7.

My packages (ports) version:
  • postgresql-server-8.3.9
  • redmine-0.9.1
  • ruby+nopthreads-1.8.7.248
  • ruby18-gems-1.3.5
  • ruby18-iconv-1.8.7.248
  • ruby18-pg-0.8.0
  • rubygem-pg-0.8.0
  • rubygem-postgres-0.7.9.2008.01.28
  • rubygem-rack-1.0.1
  • rubygem-rails-2.3.4
  • rubygem-rake-0.8.7

After installing rubygem-rails-2.3.5 (not from the FreeBSD port):

gem install rails -v=2.3.5

I still have the same problem. I migrated my install once again to be sure... But still the same...

Output of ruby script/about:

About your application's environment
Ruby version              1.8.7 (amd64-freebsd7)
RubyGems version          1.3.5
Rack version              1.0
Rails version             2.3.5
Active Record version     2.3.5
Active Resource version   2.3.5
Action Mailer version     2.3.5
Active Support version    2.3.5
Edge Rails revision       unknown
Application root          /usr/local/www/redmine
Environment               development
Database adapter          postgresql
Database schema version   20091227112908

About your Redmine plugins
Redmine2mite   0.1

What can I try now ?

Actions #3

Updated by the abstrak almost 15 years ago

What can I try now ?

Another obvious thing (with current 0.9.1 and rails 2.3.5):
  • Create a new "Test" project.
  • Add a subversion repository.
  • Try to view the repository: OK.
  • Try to view this new project's Settings : KO!
Repository settings:
  • SCM : Subversion.
  • URL : https://homer/Blabla/trunk/Projects/Blabla/Blabla (host "homer" on local network)
  • Login : redmine (we have a special login for redmine only)
  • Pass : something autogenerated with low-case, upper-case and digits. Lenght:20 chars.

Same problem : Can browse Repository from redmine but can't view the Settings page !

NOTE1: All others projects without repository can show me the Settings page (same as before).
NOTE2: Our redmine and subversion server is apache.

Actions #4

Updated by the abstrak almost 15 years ago

NOTE: I upgraded passenger from 2.2.5 to 2.2.8 today... Always the same problem...

Actions #5

Updated by the abstrak almost 15 years ago

If I remove " && !repository.root_url.blank?" from line 149 of app/helpers/repositories_helper.rb, the project's settings page can be displayed.

That's my repository settings values in DB :

NOTE:The root_url point to the base subversion repository hosted by apache on the same host (homer) with basic authentication and DAV svn.

These values are correct or is there a db update problem during migration ?

Actions #6

Updated by Marko Roeder over 14 years ago

I have the same problem with a git repository. It can be viewed in the repository view but once you leave the settings page after setting the repository you cannot open it again.

I also have the same configuration (redmine 0.9.1 [3608], rails 2.3.5, ruby 1.8.7) and from the error message I guess it could be because I am running a local repository (without host): /var/git/my-project.git

Before updating from redmine 0.8.7 to 0.9.1 all was fine!

Here is the log file:

ActionView::TemplateError (Missing host to link to! Please provide :host parameter or set default_url_options[:host]) on line #10 of app/views/projects/settings/_repository.rhtml:
7:
8: <div class="box tabular">
9: <p><%= label_tag('repository_scm', l(:label_scm)) %><%= scm_select_tag(@repository) %></p>
10: <%= repository_field_tags(f, @repository) if @repository %>
11: </div>
12:
13: <div class="contextual">

    (eval):20:in `root_url'
    app/helpers/repositories_helper.rb:167:in `git_field_tags'
    app/helpers/repositories_helper.rb:124:in `send'
    app/helpers/repositories_helper.rb:124:in `repository_field_tags'
    app/views/projects/settings/_repository.rhtml:10:in `_run_rhtml_app47views47projects47settings47_repository46rhtml_locals_object_repository_tab'
    app/views/projects/settings/_repository.rhtml:1:in `_run_rhtml_app47views47projects47settings47_repository46rhtml_locals_object_repository_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:180:in `render_tabs'
    app/views/projects/settings.rhtml:3:in `_run_rhtml_app47views47projects47settings46rhtml'
    passenger (2.2.11) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
    passenger (2.2.11) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
    passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
    passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
    passenger (2.2.11) lib/phusion_passenger/utils.rb:184:in `safe_fork'
    passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
    passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:163:in `start'
    passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:213:in `start'
    passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
    passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
    passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
    passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
    passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
    passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
    passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
    passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Actions #7

Updated by Marko Roeder over 14 years ago

Sorry, redmine is 0.9.3 with rev 3608, not 0.9.1!

Actions #8

Updated by Terence Mill about 14 years ago

After updating Eric Davis question plugin to todays trunk i also get a similar error message in error.log after submitting issuee question.

ActionView::TemplateError (Missing host to link to! Please provide :host parameter or set default_url_options[:host]) on line #18 of app/views/issues/_history.rhtml:

Actions #9

Updated by Simon Hürlimann almost 14 years ago

Still present with version 1.0.0 and rails 2.3.5.

I'm able to fix the problem by replacing the repository.root_url.blank? calls in repositories_helper.rb with repository[:root_url].blank? calls. For me it looks like the Repository objects root_url column should be used, but somehow the root_url method is defined otherwise. Using the []-way of accessing the attribute instead of the method is thus needed.

Actions #10

Updated by Marko Roeder almost 14 years ago

There is also another fix you can apply and it is a one-liner!
Add the following code to the Repository model (app/models/repository.rb):

default_url_options[:host] = 'localhost'

I added it right before the line that checks SCM ("# Checks if the SCM is enabled when creating a repository").

Actions #11

Updated by Toshi MARUYAMA almost 14 years ago

  • Category set to SCM
Actions #12

Updated by Toshi MARUYAMA over 13 years ago

  • Affected version (unused) changed from 0.9.1 to 0.9.0
  • Affected version changed from 0.9.1 to 0.9.0
Actions #13

Updated by Florian A. about 13 years ago

I'm having the same issue on Remine version 1.2 ("stable" branch from subversion). Applying the patch from comment #10 fixes it.

Actions #14

Updated by Etienne Massip about 13 years ago

Terence suggested it might be a plugin interference, could you please try without any?

Actions

Also available in: Atom PDF