jcoglan/faye — Issue #116: undefined method `close_connection_after_writing' for nil:NilClass
Author: MichaelXavier
Created: 2011-12-15 17:19:05+00:00
State: open

I've got a single faye instance running under thin 1.3.1, using a socket file behind nginx and the in-memory adapter.

In production, ever minute or so, the thin crashes and gets restarted with the following backtrace:

/home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/faye-0.7.0/lib/faye/util/web_socket/api.rb:37:in `close': undefined method `close_connection_after_writing' for nil:NilClass (NoMethodError)
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/faye-0.7.0/lib/faye/util/web_socket/api.rb:51:in `call'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/faye-0.7.0/lib/faye/util/web_socket/api.rb:51:in `close'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/faye-0.7.0/lib/faye/util/web_socket.rb:80:in `fail'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/thin-1.3.1/lib/thin/connection.rb:155:in `unbind'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:1417:in `event_callback'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/thin-1.3.1/lib/thin/controllers/controller.rb:86:in `start'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/thin-1.3.1/lib/thin/runner.rb:185:in `send'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/thin-1.3.1/lib/thin/runner.rb:185:in `run_command'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/thin-1.3.1/lib/thin/runner.rb:151:in `run!'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/gems/thin-1.3.1/bin/thin:6
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/bin/thin:19:in `load'
from /home/deploy/OrderBlip/shared/bundle/ruby/1.8/bin/thin:19

I've googled this error and have only seen it addressed for the goliath project, never faye, so I'm not ruling out misconfiguration. Please let me know of any additional info I can provide. This halts the deployment of my faye-based app. Oddly, I've never seen this in development.