{"action":"created","issue":{"url":"https://api.github.com/repos/jbox-web/redmine_git_hosting/issues/449","labels_url":"https://api.github.com/repos/jbox-web/redmine_git_hosting/issues/449/labels{/name}","comments_url":"https://api.github.com/repos/jbox-web/redmine_git_hosting/issues/449/comments","events_url":"https://api.github.com/repos/jbox-web/redmine_git_hosting/issues/449/events","html_url":"https://github.com/jbox-web/redmine_git_hosting/issues/449","id":85463797,"number":449,"title":"Error 500 when creating a repo","user":{"login":"NoWiS-","id":948592,"avatar_url":"https://avatars.githubusercontent.com/u/948592?v=3","gravatar_id":"","url":"https://api.github.com/users/NoWiS-","html_url":"https://github.com/NoWiS-","followers_url":"https://api.github.com/users/NoWiS-/followers","following_url":"https://api.github.com/users/NoWiS-/following{/other_user}","gists_url":"https://api.github.com/users/NoWiS-/gists{/gist_id}","starred_url":"https://api.github.com/users/NoWiS-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoWiS-/subscriptions","organizations_url":"https://api.github.com/users/NoWiS-/orgs","repos_url":"https://api.github.com/users/NoWiS-/repos","events_url":"https://api.github.com/users/NoWiS-/events{/privacy}","received_events_url":"https://api.github.com/users/NoWiS-/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jbox-web/redmine_git_hosting/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"n-rodriguez","id":3433835,"avatar_url":"https://avatars.githubusercontent.com/u/3433835?v=3","gravatar_id":"","url":"https://api.github.com/users/n-rodriguez","html_url":"https://github.com/n-rodriguez","followers_url":"https://api.github.com/users/n-rodriguez/followers","following_url":"https://api.github.com/users/n-rodriguez/following{/other_user}","gists_url":"https://api.github.com/users/n-rodriguez/gists{/gist_id}","starred_url":"https://api.github.com/users/n-rodriguez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n-rodriguez/subscriptions","organizations_url":"https://api.github.com/users/n-rodriguez/orgs","repos_url":"https://api.github.com/users/n-rodriguez/repos","events_url":"https://api.github.com/users/n-rodriguez/events{/privacy}","received_events_url":"https://api.github.com/users/n-rodriguez/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-06-05T07:44:24Z","updated_at":"2015-06-07T18:13:28Z","closed_at":null,"body":"Hi,\r\n\r\nI recently upgraded my redmine to the version 3.0 (from 2.4) and also the plugin redmine_git_hosting 1.0.6.\r\n\r\nWhen I create a new gitolite repositories I got a 500 error:\r\n```\r\nI, [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\r\nI, [2015-06-05T09:32:07.423807 #590]  INFO -- : Processing by RepositoriesController#create as HTML\r\nI, [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\"}\r\nI, [2015-06-05T09:32:07.459168 #590]  INFO -- :   Current user: nowis (id=3)\r\nI, [2015-06-05T09:32:07.642397 #590]  INFO -- : Redirected to http://redmine.mydomain.tld/projects/projetnul/settings/repositories\r\nI, [2015-06-05T09:32:07.722159 #590]  INFO -- : Completed 500 Internal Server Error in 298ms (ActiveRecord: 145.6ms)\r\nF, [2015-06-05T09:32:07.724120 #590] FATAL -- :\r\nActiveRecord::UnknownAttributeError (unknown attribute 'git_annex' for RepositoryGitExtra.):\r\n  activerecord (4.2.1) lib/active_record/attribute_assignment.rb:59:in `rescue in _assign_attribute'\r\n  activerecord (4.2.1) lib/active_record/attribute_assignment.rb:54:in `_assign_attribute'\r\n  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/attribute_assignment.rb:67:in `block in assign_attributes'\r\n  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/attribute_assignment.rb:61:in `each'\r\n  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/attribute_assignment.rb:61:in `assign_attributes'\r\n  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/core.rb:8:in `init_attributes'\r\n  activerecord (4.2.1) lib/active_record/core.rb:281:in `initialize'\r\n  activerecord (4.2.1) lib/active_record/inheritance.rb:61:in `new'\r\n  activerecord (4.2.1) lib/active_record/inheritance.rb:61:in `new'\r\n  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/reflection.rb:6:in `build_association'\r\n  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/associations.rb:5:in `build_record'\r\n  protected_attributes (1.0.9) lib/active_record/mass_assignment_security/associations.rb:119:in `build'\r\n  activerecord (4.2.1) lib/active_record/associations/builder/singular_association.rb:18:in `build_extra'\r\n  plugins/redmine_git_hosting/app/use_cases/create_repository.rb:24:in `set_repository_extra'\r\n  plugins/redmine_git_hosting/app/use_cases/create_repository.rb:15:in `call'\r\n  plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/repositories_controller_patch.rb:89:in `call_use_cases'\r\n  plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/repositories_controller_patch.rb:46:in `create_with_git_hosting'\r\n  actionpack (4.2.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'\r\n  actionpack (4.2.1) lib/abstract_controller/base.rb:198:in `process_action'\r\n  actionpack (4.2.1) lib/action_controller/metal/rendering.rb:10:in `process_action'\r\n  actionpack (4.2.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:505:in `call'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:505:in `call'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:92:in `_run_callbacks'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:776:in `_run_process_action_callbacks'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'\r\n  actionpack (4.2.1) lib/abstract_controller/callbacks.rb:19:in `process_action'\r\n  actionpack (4.2.1) lib/action_controller/metal/rescue.rb:29:in `process_action'\r\n  actionpack (4.2.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'\r\n  activesupport (4.2.1) lib/active_support/notifications.rb:164:in `block in instrument'\r\n  activesupport (4.2.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'\r\n  activesupport (4.2.1) lib/active_support/notifications.rb:164:in `instrument'\r\n  actionpack (4.2.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'\r\n  actionpack (4.2.1) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'\r\n  activerecord (4.2.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'\r\n  actionpack (4.2.1) lib/abstract_controller/base.rb:137:in `process'\r\n  actionview (4.2.1) lib/action_view/rendering.rb:30:in `process'\r\n  actionpack (4.2.1) lib/action_controller/metal.rb:196:in `dispatch'\r\n  actionpack (4.2.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'\r\n  actionpack (4.2.1) lib/action_controller/metal.rb:237:in `block in action'\r\n  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:74:in `call'\r\n  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'\r\n  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:43:in `serve'\r\n  actionpack (4.2.1) lib/action_dispatch/journey/router.rb:43:in `block in serve'\r\n  actionpack (4.2.1) lib/action_dispatch/journey/router.rb:30:in `each'\r\n  actionpack (4.2.1) lib/action_dispatch/journey/router.rb:30:in `serve'\r\n  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:819:in `call'\r\n  rack-openid (1.4.2) lib/rack/openid.rb:98:in `call'\r\n  request_store (1.0.5) lib/request_store/middleware.rb:9:in `call'\r\n  rack (1.6.1) lib/rack/etag.rb:24:in `call'\r\n  rack (1.6.1) lib/rack/conditionalget.rb:38:in `call'\r\n  rack (1.6.1) lib/rack/head.rb:13:in `call'\r\n  actionpack-xml_parser (1.0.2) lib/action_dispatch/xml_params_parser.rb:16:in `call'\r\n  actionpack (4.2.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'\r\n  actionpack (4.2.1) lib/action_dispatch/middleware/flash.rb:260:in `call'\r\n  rack (1.6.1) lib/rack/session/abstract/id.rb:225:in `context'\r\n  rack (1.6.1) lib/rack/session/abstract/id.rb:220:in `call'\r\n  actionpack (4.2.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'\r\n  activerecord (4.2.1) lib/active_record/query_cache.rb:36:in `call'\r\n  activerecord (4.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call'\r\n  actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:88:in `call'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:88:in `_run_callbacks'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:776:in `_run_call_callbacks'\r\n  activesupport (4.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'\r\n  actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'\r\n  actionpack (4.2.1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'\r\n  actionpack (4.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'\r\n  actionpack (4.2.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'\r\n  railties (4.2.1) lib/rails/rack/logger.rb:38:in `call_app'\r\n  railties (4.2.1) lib/rails/rack/logger.rb:22:in `call'\r\n  actionpack (4.2.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'\r\n  rack (1.6.1) lib/rack/methodoverride.rb:22:in `call'\r\n  rack (1.6.1) lib/rack/runtime.rb:18:in `call'\r\n  activesupport (4.2.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'\r\n  actionpack (4.2.1) lib/action_dispatch/middleware/static.rb:113:in `call'\r\n  rack (1.6.1) lib/rack/sendfile.rb:113:in `call'\r\n  railties (4.2.1) lib/rails/engine.rb:518:in `call'\r\n  railties (4.2.1) lib/rails/application.rb:164:in `call'\r\n  railties (4.2.1) lib/rails/railtie.rb:194:in `public_send'\r\n  railties (4.2.1) lib/rails/railtie.rb:194:in `method_missing'\r\n  /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:94:in `process_request'\r\n  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:157:in `accept_and_process_next_request'\r\n  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'\r\n  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:414:in `block (3 levels) in start_threads'\r\n  /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:111:in `block in create_thread_and_abort_on_exception'\r\n```\r\n\r\nThen, if I try to access the page of the project, I also get a 500 error:\r\n```\r\nI, [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\r\nI, [2015-06-05T09:39:28.437693 #22738]  INFO -- : Processing by ProjectsController#show as HTML\r\nI, [2015-06-05T09:39:28.437736 #22738]  INFO -- :   Parameters: {\"id\"=>\"projetnul\"}\r\nI, [2015-06-05T09:39:28.439707 #22738]  INFO -- :   Current user: nowis (id=3)\r\nI, [2015-06-05T09:39:28.456618 #22738]  INFO -- :   Rendered plugins/redmine_git_hosting/app/views/common/_git_urls.html.haml (4.0ms)\r\nI, [2015-06-05T09:39:28.456722 #22738]  INFO -- :   Rendered plugins/redmine_git_hosting/app/views/projects/_git_urls.html.haml (7.4ms)\r\nI, [2015-06-05T09:39:28.456797 #22738]  INFO -- :   Rendered projects/show.html.erb within layouts/base (8.5ms)\r\nI, [2015-06-05T09:39:28.456951 #22738]  INFO -- : Completed 500 Internal Server Error in 19ms (ActiveRecord: 1.5ms)\r\nF, [2015-06-05T09:39:28.458301 #22738] FATAL -- :\r\nActionView::Template::Error (undefined method `[]' for nil:NilClass):\r\n     7:   = javascript_include_tag 'application', plugin: 'redmine_git_hosting'\r\n     8:\r\n     9: - repositories = Array.wrap(repository) unless repositories\r\n    10: - if repositories.map(&:available_urls).reject { |h| h.empty? }.any?\r\n    11:   - repositories.sort_by { |r| r.is_default ? 0 : 1 }.each do |repository|\r\n    12:     - next if repository.available_urls.empty?\r\n    13:     - present repository do |p|\r\n  lib/redmine/hook.rb:119:in `block (2 levels) in render_on'\r\n  lib/redmine/hook.rb:117:in `map'\r\n  lib/redmine/hook.rb:117:in `block in render_on'\r\n  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'\r\n  lib/redmine/hook.rb:61:in `each'\r\n  lib/redmine/hook.rb:61:in `block in call_hook'\r\n  lib/redmine/hook.rb:58:in `tap'\r\n  lib/redmine/hook.rb:58:in `call_hook'\r\n  lib/redmine/hook.rb:167:in `call_hook'\r\n  app/views/projects/show.html.erb:61:in `_app_views_projects_show_html_erb__3980899741021827042_43016860'\r\n  app/controllers/projects_controller.rb:152:in `show'\r\n```\r\n\r\nAs 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)."},"comment":{"url":"https://api.github.com/repos/jbox-web/redmine_git_hosting/issues/comments/109784908","html_url":"https://github.com/jbox-web/redmine_git_hosting/issues/449#issuecomment-109784908","issue_url":"https://api.github.com/repos/jbox-web/redmine_git_hosting/issues/449","id":109784908,"user":{"login":"NoWiS-","id":948592,"avatar_url":"https://avatars.githubusercontent.com/u/948592?v=3","gravatar_id":"","url":"https://api.github.com/users/NoWiS-","html_url":"https://github.com/NoWiS-","followers_url":"https://api.github.com/users/NoWiS-/followers","following_url":"https://api.github.com/users/NoWiS-/following{/other_user}","gists_url":"https://api.github.com/users/NoWiS-/gists{/gist_id}","starred_url":"https://api.github.com/users/NoWiS-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoWiS-/subscriptions","organizations_url":"https://api.github.com/users/NoWiS-/orgs","repos_url":"https://api.github.com/users/NoWiS-/repos","events_url":"https://api.github.com/users/NoWiS-/events{/privacy}","received_events_url":"https://api.github.com/users/NoWiS-/received_events","type":"User","site_admin":false},"created_at":"2015-06-07T18:13:28Z","updated_at":"2015-06-07T18:13:28Z","body":"Indeed I went directly to \"How to upgrade\". Thanks for your answer, it works perfectly now :)"}}