koppen / redmine_github_hook

Allow your Redmine installation to be notified when changes have been pushed to a Github repository.
http://mentalized.net/journal/2009/08/03/redmine_plugin_github_hook/
MIT License
478 stars 114 forks source link

NoMethodError (undefined method `downcase' for 1:Fixnum) #61

Closed texnoid closed 9 years ago

texnoid commented 10 years ago

tail -f /var/log/apache2/error.log App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:51:in call' App 14591 stderr: railties (3.2.19) lib/rails/engine.rb:484:incall' App 14591 stderr: railties (3.2.19) lib/rails/application.rb:231:in call' App 14591 stderr: railties (3.2.19) lib/rails/railtie/configurable.rb:30:inmethod_missing' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in process_request' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler/thread_handler.rb:141:inaccept_and_process_next_request' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler/thread_handler.rb:109:in main_loop' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler.rb:455:inblock (3 levels) in start_threads' App 14591 stderr: App 14591 stderr:

App 14591 stderr: App 14591 stderr: NoMethodError (undefined method downcase' for 1:Fixnum): App 14591 stderr: plugins/redmine_github_hook/app/services/github_hook/updater.rb:77:infind_project' App 14591 stderr: plugins/redmine_github_hook/app/services/github_hook/updater.rb:84:in find_repositories' App 14591 stderr: plugins/redmine_github_hook/app/services/github_hook/updater.rb:13:incall' App 14591 stderr: plugins/redmine_github_hook/app/controllers/github_hook_controller.rb:11:in index' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/implicit_render.rb:4:insend_action' App 14591 stderr: actionpack (3.2.19) lib/abstract_controller/base.rb:167:in process_action' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/rendering.rb:10:inprocess_action' App 14591 stderr: actionpack (3.2.19) lib/abstract_controller/callbacks.rb:18:in block in process_action' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:447:in_run18679478662002799process_action1330827819000691208callbacks' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:405:in __run_callback' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:385:in_run_process_action_callbacks' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:81:in run_callbacks' App 14591 stderr: actionpack (3.2.19) lib/abstract_controller/callbacks.rb:17:inprocess_action' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/rescue.rb:29:in process_action' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:30:inblock in process_action' App 14591 stderr: activesupport (3.2.19) lib/active_support/notifications.rb:123:in block in instrument' App 14591 stderr: activesupport (3.2.19) lib/active_support/notifications/instrumenter.rb:20:ininstrument' App 14591 stderr: activesupport (3.2.19) lib/active_support/notifications.rb:123:in instrument' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/instrumentation.rb:29:inprocess_action' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/params_wrapper.rb:207:in process_action' App 14591 stderr: activerecord (3.2.19) lib/active_record/railties/controller_runtime.rb:18:inprocess_action' App 14591 stderr: actionpack (3.2.19) lib/abstract_controller/base.rb:121:in process' App 14591 stderr: actionpack (3.2.19) lib/abstract_controller/rendering.rb:45:inprocess' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal.rb:203:in dispatch' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal/rack_delegation.rb:14:indispatch' App 14591 stderr: actionpack (3.2.19) lib/action_controller/metal.rb:246:in block in action' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:73:incall' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:73:in dispatch' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:36:incall' App 14591 stderr: journey (1.0.4) lib/journey/router.rb:68:in block in call' App 14591 stderr: journey (1.0.4) lib/journey/router.rb:56:ineach' App 14591 stderr: journey (1.0.4) lib/journey/router.rb:56:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/routing/route_set.rb:608:incall' App 14591 stderr: rack-openid (1.4.2) lib/rack/openid.rb:98:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/best_standards_support.rb:17:incall' App 14591 stderr: rack (1.4.5) lib/rack/etag.rb:23:in call' App 14591 stderr: rack (1.4.5) lib/rack/conditionalget.rb:35:incall' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/head.rb:14:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/params_parser.rb:21:incall' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/flash.rb:242:in call' App 14591 stderr: rack (1.4.5) lib/rack/session/abstract/id.rb:210:incontext' App 14591 stderr: rack (1.4.5) lib/rack/session/abstract/id.rb:205:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/cookies.rb:341:incall' App 14591 stderr: activerecord (3.2.19) lib/active_record/query_cache.rb:64:in call' App 14591 stderr: activerecord (3.2.19) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/callbacks.rb:28:in block in call' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:405:in_run590154791167750232call2014811694302225741callbacks' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:405:in __run_callback' App 14591 stderr: activesupport (3.2.19) lib/active_support/callbacks.rb:385:in_run_call_callbacks' App 14591 stderr: activesupport (3.2.19) lib/active_support/call App 14591 stderr: backs.rb:81:in run_callbacks' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/callbacks.rb:27:incall' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/remote_ip.rb:31:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/debug_exceptions.rb:16:incall' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/show_exceptions.rb:56:in call' App 14591 stderr: railties (3.2.19) lib/rails/rack/logger.rb:32:incall_app' App 14591 stderr: railties (3.2.19) lib/rails/rack/logger.rb:16:in block in call' App 14591 stderr: activesupport (3.2.19) lib/active_support/tagged_logging.rb:22:intagged' App 14591 stderr: railties (3.2.19) lib/rails/rack/logger.rb:16:in call' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/request_id.rb:22:incall' App 14591 stderr: rack (1.4.5) lib/rack/methodoverride.rb:21:in call' App 14591 stderr: rack (1.4.5) lib/rack/runtime.rb:17:incall' App 14591 stderr: activesupport (3.2.19) lib/active_support/cache/strategy/local_cache.rb:72:in call' App 14591 stderr: rack (1.4.5) lib/rack/lock.rb:15:incall' App 14591 stderr: actionpack (3.2.19) lib/action_dispatch/middleware/static.rb:63:in call' App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:136:inforward' App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:143:in pass' App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:155:ininvalidate' App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:71:in call!' App 14591 stderr: rack-cache (1.2) lib/rack/cache/context.rb:51:incall' App 14591 stderr: railties (3.2.19) lib/rails/engine.rb:484:in call' App 14591 stderr: railties (3.2.19) lib/rails/application.rb:231:incall' App 14591 stderr: railties (3.2.19) lib/rails/railtie/configurable.rb:30:in method_missing' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/rack/thread_handler_extension.rb:74:inprocess_request' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler/thread_handler.rb:141:in accept_and_process_next_request' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler/thread_handler.rb:109:inmain_loop' App 14591 stderr: passenger (4.0.53) lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads' App 14591 stderr: App 14591 stderr:

Environment: Redmine version 2.5.2.stable.13435 Ruby version 2.0.0-p576 (2014-09-19) [x86_64-linux] Rails version 3.2.19 Environment production Database adapter Mysql2 SCM: Subversion 1.6.17 Git 1.7.10.4 Filesystem
Redmine plugins: redmine_github_hook 2.1.0

koppen commented 10 years ago

Thanks for reporting.

What did you do to receive this error?

What is the request that led to this, in particular, what are the contents of the params hash?

texnoid commented 10 years ago

I used "Test Hook" to Gitlab https://docs.google.com/file/d/0B1kn6CUg7swfM3dXZ3p3cnJETGs/edit?usp=drivesdk and get a message in the apache logs /var/log/apache2/error.log

texnoid commented 10 years ago

apache access log: [10/Oct/2014:05:15:48 -0400] "POST /github_hook HTTP/1.1" 500 1034 "-" "-"

texnoid commented 10 years ago

You've managed to reproduce the problem?

koppen commented 10 years ago

As far as I can tell, the only way this could happen is if the payload sent by GitLab has the repository name given as the integer 1. Without knowing exactly what is in that payload I can't really debug anything.

That said, you could probably work around it by specifying a project identifier using the project_id querystring parameter like you have on the other hook. It is only when that isn't present, the identifier is grabbed from the payload.