I have strange error that happens after couple of hours. Some instances start to respond on any request with status code 500. Log file unicorn.stderr.log gets populated with this error: app error: undefined method `each'' for nil:NilClass (NoMethodError) /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.2/lib/rack/utils.rb:267:in `initialize'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.2/lib/rack/utils.rb:261:in `new'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.2/lib/rack/utils.rb:261:in `new'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.2/lib/rack/chunked.rb:16:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:106:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.14/lib/rails/rack/static.rb:31:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.2/lib/rack/urlmap.rb:47:in `block in call'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.2/lib/rack/urlmap.rb:41:in `each'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.2/lib/rack/urlmap.rb:41:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:528:in `process_client'' /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:600:in `worker_loop'' /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:485:in `spawn_missing_workers'' /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:496:in `maintain_worker_count'' /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:270:in `join'' /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.1.1/bin/unicorn_rails:209:in `<top (required)>'' /usr/local/bin/unicorn_rails:19:in `load'' /usr/local/bin/unicorn_rails:19:in `<main>'' Application is running on rails 2.3.14/ruby 1.9.2p290 and maybe it has something to do with plugin being used, that is template_streaming (https://github.com/oggy/template_streaming)
Kamil Kukura <kamil.kukura at gmail.com> wrote:> I have strange error that happens after couple of hours. Some > instances start to respond on any request with status code 500. Log > file unicorn.stderr.log gets populated with this error:>From the backtrace, it looks like an application error of some sort.Unicorn itself never changes the application once it''s loaded. Does an external service your application relies on get overloaded? This is a hunch: perhaps your Rails application is opening connections to a backend and not closing them explicitly (maybe in an error-handling path).> Application is running on rails 2.3.14/ruby 1.9.2p290 and maybe it > has something to do with plugin being used, that is > template_streaming (https://github.com/oggy/template_streaming)What happens when you disable the template_streaming? Streaming isn''t likely to help with nginx in front right now (disabling proxy_buffering in nginx is dangerous to unicorn). -- Eric Wong