Skip to content

Fix usage of split on enumerator

After updating to 7.3 I couldn't push anything anymore:

Started POST "//api/v3/internal/allowed" for 127.0.0.1 at 2014-09-23 16:03:36 +0200

NoMethodError (undefined method `split' for #<Enumerator: "_any":lines>):
  /home/git/gitlab/lib/gitlab/git_access.rb:52:in `block in push_allowed?'
  /home/git/gitlab/lib/gitlab/git_access.rb:51:in `lines'
  /home/git/gitlab/lib/gitlab/git_access.rb:51:in `each'
  /home/git/gitlab/lib/gitlab/git_access.rb:51:in `push_allowed?'
  /home/git/gitlab/lib/gitlab/git_access.rb:27:in `allowed?'
  /home/git/gitlab/lib/api/internal.rb:35:in `block (2 levels) in <class:Internal>'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/endpoint.rb:31:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/endpoint.rb:31:in `block in generate_api_method'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/endpoint.rb:401:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/endpoint.rb:401:in `run'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/endpoint.rb:154:in `block in call!'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/middleware/base.rb:24:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/middleware/base.rb:24:in `call!'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/middleware/base.rb:18:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/middleware/base.rb:24:in `call!'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/middleware/base.rb:18:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/middleware/error.rb:26:in `block in call!'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/middleware/error.rb:25:in `catch'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/middleware/error.rb:25:in `call!'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/middleware/base.rb:18:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/endpoint.rb:155:in `call!'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/endpoint.rb:145:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in `block in call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:68:in `optimized_each'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/api.rb:525:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/api.rb:42:in `call!'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/grape-0.6.1/lib/grape/api.rb:38:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/journey/router.rb:71:in `block in call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/journey/router.rb:59:in `each'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/journey/router.rb:59:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:676:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/request_store-1.0.5/lib/request_store/middleware.rb:9:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-cors-0.2.9/lib/rack/cors.rb:54:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-attack-2.3.0/lib/rack/attack.rb:63:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/middleware/flash.rb:254:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activerecord-4.1.1/lib/active_record/query_cache.rb:36:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:82:in `run_callbacks'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-4.1.1/lib/rails/rack/logger.rb:38:in `call_app'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-4.1.1/lib/rails/rack/logger.rb:20:in `block in call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.1/lib/active_support/tagged_logging.rb:68:in `block in tagged'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.1/lib/active_support/tagged_logging.rb:26:in `tagged'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.1/lib/active_support/tagged_logging.rb:68:in `tagged'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-4.1.1/lib/rails/rack/logger.rb:20:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/actionpack-4.1.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-4.1.1/lib/rails/engine.rb:514:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-4.1.1/lib/rails/application.rb:144:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `public_send'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `method_missing'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `block in call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:552:in `process_client'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-worker-killer-0.4.2/lib/unicorn/worker_killer.rb:51:in `process_client'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:632:in `worker_loop'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:142:in `start'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.3/bin/unicorn_rails:209:in `<top (required)>'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/bin/unicorn_rails:23:in `load'
  /home/git/gitlab/vendor/bundle/ruby/1.9.1/bin/unicorn_rails:23:in `<main>'

Merge request reports

Loading