Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in unicorn/worker_killer.rb:52:in `process_client' #54

Open
ckbhodge opened this issue Jun 24, 2015 · 3 comments
Open

Error in unicorn/worker_killer.rb:52:in `process_client' #54

ckbhodge opened this issue Jun 24, 2015 · 3 comments

Comments

@ckbhodge
Copy link

I'm running ruby 2.1.2 and rails 3.2.22. I'm getting this error in my logs right after I tried to add unicorn-worker-killer:

_dispatch/middleware/debug_exceptions.rb:16:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/rollbar-1.5.1/lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/railties-3.2.22/lib/rails/rack/logger.rb:32:in `call_app'", "/app/vendor/bundle/ruby/2.1.0/gems/railties-3.2.22/lib/rails/rack/logger.rb:16:in `block in call'", "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.22/lib/active_support/tagged_logging.rb:22:in `tagged'", "/app/vendor/bundle/ruby/2.1.0/gems/railties-3.2.22/lib/rails/rack/logger.rb:16:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_dispatch/middleware/request_id.rb:22:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/rack-1.4.7/lib/rack/methodoverride.rb:21:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/rack-1.4.7/lib/rack/runtime.rb:17:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.22/lib/active_support/cache/strategy/local_cache.rb:72:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/rack-1.4.7/lib/rack/lock.rb:15:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_dispatch/middleware/static.rb:83:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'", "/app/vendor/bundle/ruby/2.1.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'", "/app/vendor/bundle/ruby/2.1.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'", "/app/vendor/bundle/ruby/2.1.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'", "/app/vendor/bundle/ruby/2.1.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/rack-timeout-0.0.4/lib/rack/timeout.rb:16:in `block in call'", "/app/vendor/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'", "/app/vendor/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `call'", "/app/vendor/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `timeout'", "/app/vendor/bundle/ruby/2.1.0/gems/rack-timeout-0.0.4/lib/rack/timeout.rb:16:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/railties-3.2.22/lib/rails/engine.rb:484:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/railties-3.2.22/lib/rails/application.rb:231:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/railties-3.2.22/lib/rails/railtie/configurable.rb:30:in `method_missing'", "/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'", "/app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:576:in `process_client'", "/app/vendor/bundle/ruby/2.1.0/gems/unicorn-worker-killer-0.4.3/lib/unicorn/worker_killer.rb:52:in `process_client'", "/app/vendor/bundle/ruby/2.1.0/gems/unicorn-worker-killer-0.4.3/lib/unicorn/worker_killer.rb:92:in `process_client'", "/app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:670:in `worker_loop'", "/app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in `spawn_missing_workers'", "/app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:140:in `start'", "/app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'", "/app/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in `load'", "/app/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in `<main>'"

Here's my config.ru file:

#NOTE: Set these variables in heroku:
# heroku config:set MAX_REQUEST_MIN=3072 MAX_REQUEST_MAX=4096 OOM_MIN=192 OOM_MAX=256
if ENV['RAILS_ENV'] == 'production' && defined?(Unicorn)
  require 'unicorn'
  require 'unicorn/worker_killer'
  max_request_min =  ENV['MAX_REQUEST_MIN'].to_i || 3072
  max_request_max =  ENV['MAX_REQUEST_MAX'].to_i || 4096

  # Max requests per worker
  use Unicorn::WorkerKiller::MaxRequests, max_request_min, max_request_max

  oom_min = ((ENV['OOM_MIN'].to_i || 192) * (1024**2))
  oom_max = ((ENV['OOM_MAX'].to_i || 256) * (1024**2))

  # Max memory size (RSS) per worker
  use Unicorn::WorkerKiller::Oom, oom_min, oom_max
end

# This file is used by Rack-based servers to start the application.
require 'sidekiq/web'

require ::File.expand_path('../config/environment',  __FILE__)
run BangWithFriends::Application
@fro
Copy link

fro commented May 6, 2016

Same problem here. @ckbhodge How did you manage to pass ENV VARS to your config.ru worker_killer config?

Here's errors log:

ERROR -- : listen loop error: undefined method `-' for #<String:0x007fe1dc4ea0f0> (NoMethodError)
ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-worker-killer-0.4.4/lib/unicorn/worker_killer.rb:56:in `process_client'
ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-worker-killer-0.4.4/lib/unicorn/worker_killer.rb:92:in `process_client'
ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:658:in `worker_loop'
ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:132:in `start'
ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
ERROR -- : /app/vendor/bundle/ruby/2.2.0/bin/unicorn:23:in `load'
ERROR -- : /app/vendor/bundle/ruby/2.2.0/bin/unicorn:23:in `<main>'

@ckbhodge
Copy link
Author

ckbhodge commented May 6, 2016

I ended up not using unicorn-worker-killer. :/

@fro
Copy link

fro commented May 6, 2016

Oh. I don't get it... ENV VARS are available in config.ru, so.. is it because of the String type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants