kubitron / redmine_git_hosting

A ChiliProject/Redmine plugin which makes configuring your own git hosting easy.
78 stars 15 forks source link

Project repository view #79

Closed vegardx closed 12 years ago

vegardx commented 12 years ago

Redmine: 1.4.4 Rails: 2.3.14 Gem: 1.8.23 Apache2 + passenger

I'm having an issue with rendering the project repository view, and with my limited knowledge of Ruby the production.log is somewhat hard to understand. I've checked closed bugs, and found one with the same issue. He was told to try the testing branch. In a later comment it was said to have been merged with master.

Copy of the error messge:

Processing RepositoriesController#show (for 10.0.1.78 at 2012-10-15 10:23:53) [GET]
  Parameters: {"controller"=>"repositories", "action"=>"show", "id"=>"test-prosjekt"}
git: error during get default branch: undefined method `each_line' for #<CachedShellRedirector:0x00000005b62dd0>

NoMethodError (undefined method `each_line' for #<CachedShellRedirector:0x00000005c13d60>):
  lib/redmine/scm/adapters/git_adapter.rb:142:in `block in entries'
  lib/redmine/scm/adapters/git_adapter.rb:141:in `entries'
  app/models/repository/git.rb:97:in `entries'
  /usr/lib/ruby/vendor_ruby/active_record/associations/association_proxy.rb:215:in `method_missing'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:1333:in `perform_action'
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:617:in `call_filters'
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:610:in `perform_action_with_filters'
  /usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
  /usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
  /usr/lib/ruby/vendor_ruby/action_controller/rescue.rb:160:in `perform_action_with_rescue'
  /usr/lib/ruby/vendor_ruby/action_controller/flash.rb:151:in `perform_action_with_flash'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:in `process'
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:606:in `process_with_filters'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:391:in `process'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:386:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/routing/route_set.rb:438:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:87:in `dispatch'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:121:in `_call'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in `call'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in `block in call'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:9:in `cache'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:28:in `call'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/string_coercion.rb:25:in `call'
  /usr/lib/ruby/vendor_ruby/rack/head.rb:9:in `call'
  /usr/lib/ruby/vendor_ruby/rack/methodoverride.rb:21:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/params_parser.rb:15:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/session/cookie_store.rb:99:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/failsafe.rb:26:in `call'
  /usr/lib/ruby/vendor_ruby/rack/lock.rb:15:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:106:in `call'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:275:in `block in handle_spawn_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:479:in `safe_fork'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:180:in `start'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:219:in `block (2 levels) in spawn_rails_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:214:in `block in spawn_rails_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
  <internal:prelude>:10:in `synchronize'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  /usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:99:in `<main>'

Rendering /usr/share/redmine/public/500.html (500 Internal Server Error)```
vegardx commented 12 years ago

Little update, I disabled the cache for git, and now it works.

kubitron commented 12 years ago

Ok. Can you tell me more about your environment?

On bash, do:

prompt% cd REDMINE_ROOT
prompt% export RAILS_ENV=production
prompt% ./scripts/about
vegardx commented 12 years ago

Hi!

About your application's environment Ruby version 1.9.3 (x86_64-linux) RubyGems version 1.8.23 Rack version 1.4 Rails version 2.3.14 Active Record version 2.3.14 Active Resource version 2.3.14 Action Mailer version 2.3.14 Active Support version 2.3.14 Edge Rails revision unknown Application root /usr/share/redmine Environment production Database adapter mysql Database schema version 20120904060609

About your Redmine plugins Redmine Git Hosting Plugin 0.5.0x

kubitron commented 12 years ago

Thanks. I think that this is related to Ruby 1.9.3. I'll fix it today (have to run to a meeting now). Will you be available to check a patch later?

vegardx commented 12 years ago

Most likely! Just ping me here or on IRC (vegardx@EFnet).

kubitron commented 12 years ago

Sorry -- forgot to ping you.

Can you try pulling from master and see if it fixes your problem?

vegardx commented 12 years ago

No worries!

I took some time because I for some obscure reason managed to pull an old version for someone who had forked it, and started working my way through errors to get a patch ready. When I finally got it working, i noticed that it was 0.4.x and from someone else. Blargh!

Other than that, your fix worked wonders! :-)

kubitron commented 12 years ago

Ok. So, you are working on 0.5.0x+? (i.e. latest patches from head of master).

Let me know whether there are any other problems.

vegardx commented 12 years ago

Yes, so far everything seem to be working with caching enabled, thanks! As far as I can tell this bug has been squished.

kubitron commented 12 years ago

Ok. I'm closing it out.

kubitron commented 12 years ago

@vegardx, you may want to pull from master. Turns out that there was a problem with the post-receive hook with Ruby 1.9.x which is probably preventing updates from being propagated to Redmine properly (you will notice that the repository link is never updated if you have caching set to "until next update").

vegardx commented 12 years ago

I'll give it a go as soon as I have some time available!