redmine-git-hosting / redmine_git_hosting

A Redmine plugin which makes configuring your own Git hosting easy ;)
http://redmine-git-hosting.io
MIT License
275 stars 116 forks source link

Error 500 when creating a repo #449

Closed NoWiS- closed 9 years ago

NoWiS- commented 9 years ago

Hi,

I recently upgraded my redmine to the version 3.0 (from 2.4) and also the plugin redmine_git_hosting 1.0.6.

When I create a new gitolite repositories I got a 500 error:

I, [2015-06-05T09:32:07.326411 #590]  INFO -- : Started POST "/projects/projetnul/repositories" for 109.220.120.66 at 2015-06-05 09:32:07 +0200
I, [2015-06-05T09:32:07.423807 #590]  INFO -- : Processing by RepositoriesController#create as HTML
I, [2015-06-05T09:32:07.423920 #590]  INFO -- :   Parameters: {"utf8"=>"✓", "authenticity_token"=>"TOKEN", "repository_scm"=>"Xitolite", "repository"=>{"is_default"=>"1", "identifier"=>"pou65489", "path_encoding"=>"", "create_readme"=>"false", "enable_git_annex"=>"false"}, "commit"=>"Create", "project_id"=>"projetnul"}
I, [2015-06-05T09:32:07.459168 #590]  INFO -- :   Current user: nowis (id=3)
I, [2015-06-05T09:32:07.642397 #590]  INFO -- : Redirected to http://redmine.mydomain.tld/projects/projetnul/settings/repositories
I, [2015-06-05T09:32:07.722159 #590]  INFO -- : Completed 500 Internal Server Error in 298ms (ActiveRecord: 145.6ms)
F, [2015-06-05T09:32:07.724120 #590] FATAL -- :
ActiveRecord::UnknownAttributeError (unknown attribute 'git_annex' for RepositoryGitExtra.):
  activerecord (4.2.1) lib/active_record/attribute_assignment.rb:59:in `rescue in _assign_attribute'
  activerecord (4.2.1) lib/active_record/attribute_assignment.rb:54:in `_assign_attribute'
  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/attribute_assignment.rb:67:in `block in assign_attributes'
  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/attribute_assignment.rb:61:in `each'
  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/attribute_assignment.rb:61:in `assign_attributes'
  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/core.rb:8:in `init_attributes'
  activerecord (4.2.1) lib/active_record/core.rb:281:in `initialize'
  activerecord (4.2.1) lib/active_record/inheritance.rb:61:in `new'
  activerecord (4.2.1) lib/active_record/inheritance.rb:61:in `new'
  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/reflection.rb:6:in `build_association'
  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/associations.rb:5:in `build_record'
  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/associations.rb:119:in `build'
  activerecord (4.2.1) lib/active_record/associations/builder/singular_association.rb:18:in `build_extra'
  plugins/redmine_git_hosting/app/use_cases/create_repository.rb:24:in `set_repository_extra'
  plugins/redmine_git_hosting/app/use_cases/create_repository.rb:15:in `call'
  plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/repositories_controller_patch.rb:89:in `call_use_cases'
  plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/repositories_controller_patch.rb:46:in `create_with_git_hosting'
  actionpack (4.2.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.2.1) lib/abstract_controller/base.rb:198:in `process_action'
  actionpack (4.2.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.2.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
  activesupport (4.2.1) lib/active_support/callbacks.rb:505:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:505:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:92:in `_run_callbacks'
  activesupport (4.2.1) lib/active_support/callbacks.rb:776:in `_run_process_action_callbacks'
  activesupport (4.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.2.1) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.2.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (4.2.1) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (4.2.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.2.1) lib/active_support/notifications.rb:164:in `instrument'
  actionpack (4.2.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.2.1) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.2.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.2.1) lib/abstract_controller/base.rb:137:in `process'
  actionview (4.2.1) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.2.1) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.2.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.2.1) lib/action_controller/metal.rb:237:in `block in action'
  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:74:in `call'
  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:43:in `serve'
  actionpack (4.2.1) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  actionpack (4.2.1) lib/action_dispatch/journey/router.rb:30:in `each'
  actionpack (4.2.1) lib/action_dispatch/journey/router.rb:30:in `serve'
  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:819:in `call'
  rack-openid (1.4.2) lib/rack/openid.rb:98:in `call'
  request_store (1.0.5) lib/request_store/middleware.rb:9:in `call'
  rack (1.6.1) lib/rack/etag.rb:24:in `call'
  rack (1.6.1) lib/rack/conditionalget.rb:38:in `call'
  rack (1.6.1) lib/rack/head.rb:13:in `call'
  actionpack-xml_parser (1.0.2) lib/action_dispatch/xml_params_parser.rb:16:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/flash.rb:260:in `call'
  rack (1.6.1) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.6.1) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  activerecord (4.2.1) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:88:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:88:in `_run_callbacks'
  activesupport (4.2.1) lib/active_support/callbacks.rb:776:in `_run_call_callbacks'
  activesupport (4.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.1) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.1) lib/rails/rack/logger.rb:22:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.1) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.1) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/static.rb:113:in `call'
  rack (1.6.1) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.1) lib/rails/engine.rb:518:in `call'
  railties (4.2.1) lib/rails/application.rb:164:in `call'
  railties (4.2.1) lib/rails/railtie.rb:194:in `public_send'
  railties (4.2.1) lib/rails/railtie.rb:194:in `method_missing'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:94:in `process_request'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:157:in `accept_and_process_next_request'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:414:in `block (3 levels) in start_threads'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:111:in `block in create_thread_and_abort_on_exception'

Then, if I try to access the page of the project, I also get a 500 error:

I, [2015-06-05T09:39:28.436866 #22738]  INFO -- : Started GET "/projects/projetnul" for 109.220.120.66 at 2015-06-05 09:39:28 +0200
I, [2015-06-05T09:39:28.437693 #22738]  INFO -- : Processing by ProjectsController#show as HTML
I, [2015-06-05T09:39:28.437736 #22738]  INFO -- :   Parameters: {"id"=>"projetnul"}
I, [2015-06-05T09:39:28.439707 #22738]  INFO -- :   Current user: nowis (id=3)
I, [2015-06-05T09:39:28.456618 #22738]  INFO -- :   Rendered plugins/redmine_git_hosting/app/views/common/_git_urls.html.haml (4.0ms)
I, [2015-06-05T09:39:28.456722 #22738]  INFO -- :   Rendered plugins/redmine_git_hosting/app/views/projects/_git_urls.html.haml (7.4ms)
I, [2015-06-05T09:39:28.456797 #22738]  INFO -- :   Rendered projects/show.html.erb within layouts/base (8.5ms)
I, [2015-06-05T09:39:28.456951 #22738]  INFO -- : Completed 500 Internal Server Error in 19ms (ActiveRecord: 1.5ms)
F, [2015-06-05T09:39:28.458301 #22738] FATAL -- :
ActionView::Template::Error (undefined method `[]' for nil:NilClass):
     7:   = javascript_include_tag 'application', plugin: 'redmine_git_hosting'
     8:
     9: - repositories = Array.wrap(repository) unless repositories
    10: - if repositories.map(&:available_urls).reject { |h| h.empty? }.any?
    11:   - repositories.sort_by { |r| r.is_default ? 0 : 1 }.each do |repository|
    12:     - next if repository.available_urls.empty?
    13:     - present repository do |p|
  lib/redmine/hook.rb:119:in `block (2 levels) in render_on'
  lib/redmine/hook.rb:117:in `map'
  lib/redmine/hook.rb:117:in `block in render_on'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:167:in `call_hook'
  app/views/projects/show.html.erb:61:in `_app_views_projects_show_html_erb__3980899741021827042_43016860'
  app/controllers/projects_controller.rb:152:in `show'

As a side note, I should add that my old git repositories that have been created with the older version of redmine_git_hosting are marked as 'Git' SCM and not 'Gitolite' (and thus are not using the new version of redmine_git_hosting).

n-rodriguez commented 9 years ago

As a side note, I should add that my old git repositories that have been created with the older version of redmine_git_hosting are marked as 'Git' SCM and not 'Gitolite' (and thus are not using the new version of redmine_git_hosting).

I think you forgot to read this : http://redmine-git-hosting.io/how-to/migrate/#step-by-step-migration-from-0710-version-to-v10x

NoWiS- commented 9 years ago

Indeed I went directly to "How to upgrade". Thanks for your answer, it works perfectly now :)