ruby server demo from website crashes. #25

Closed
ssoroka opened this Issue Aug 27, 2010 · 12 comments

Comments

Projects
None yet
6 participants
@ssoroka

ssoroka commented Aug 27, 2010

Copying the demo from the website, I have:

require 'faye'
faye_server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 45)
run faye_server

then I copy the client demo and run it, but the server dies with:

Rack::Lint::LintError: Status must be >=100 seen as integer
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/lint.rb:19:in assert' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/lint.rb:425:incheck_status'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/lint.rb:50:in _call' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/lint.rb:36:incall'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/showexceptions.rb:24:in call' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/commonlogger.rb:18:incall'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/content_length.rb:13:in call' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/chunked.rb:15:incall'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/connection.rb:76:in pre_process' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/connection.rb:74:incatch'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/connection.rb:74:in pre_process' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/connection.rb:57:inprocess'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/faye-0.5.2/lib/thin_extensions.rb:44:in receive_data' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:inrun_machine'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in run' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/backends/base.rb:57:instart'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/server.rb:156:in start' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/handler/thin.rb:14:inrun'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/server.rb:213:in start' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/server.rb:100:instart'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/bin/rackup:4
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/bin/rackup:19:in `load'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/bin/rackup:19
127.0.0.1 - - [27/Aug/2010 13:22:17] "POST /faye HTTP/1.1" 500 62371 0.0206

@jcoglan

This comment has been minimized.

Show comment Hide comment
@jcoglan

jcoglan Aug 27, 2010

Collaborator

That's because Rack's development middleware doesn't work with Thin async responses. You can run your app in production mode to prune out the Lint middleware:

rackup -s thin -E production config.ru

Maybe I need to make this more prominent on the website; you're not the first person to report this problem.

Collaborator

jcoglan commented Aug 27, 2010

That's because Rack's development middleware doesn't work with Thin async responses. You can run your app in production mode to prune out the Lint middleware:

rackup -s thin -E production config.ru

Maybe I need to make this more prominent on the website; you're not the first person to report this problem.

@ssoroka

This comment has been minimized.

Show comment Hide comment
@ssoroka

ssoroka Aug 27, 2010

Good to know. I actually was using -E production .. I wasn't seeing any output, so I switched to development thinking it'd log the errors. If those errors aren't related, I'll have to figure out why it wasn't working...

ssoroka commented Aug 27, 2010

Good to know. I actually was using -E production .. I wasn't seeing any output, so I switched to development thinking it'd log the errors. If those errors aren't related, I'll have to figure out why it wasn't working...

@ssoroka

This comment has been minimized.

Show comment Hide comment
@ssoroka

ssoroka Aug 27, 2010

seems to be working now. I must have made a simple mistake.

ssoroka commented Aug 27, 2010

seems to be working now. I must have made a simple mistake.

@KieranP

This comment has been minimized.

Show comment Hide comment
@KieranP

KieranP Jun 27, 2011

OH! Please!! I spent hours trying to track this down. :-( Please kill the server with a meaningful error if it doesn't work in development.

e.g.

raise NotSupported.new("Please run in production mode") if RACK_ENV != 'production'

KieranP commented Jun 27, 2011

OH! Please!! I spent hours trying to track this down. :-( Please kill the server with a meaningful error if it doesn't work in development.

e.g.

raise NotSupported.new("Please run in production mode") if RACK_ENV != 'production'
@jcoglan

This comment has been minimized.

Show comment Hide comment
@jcoglan

jcoglan Jul 3, 2011

Collaborator

The issue is really the the middleware that Rack uses in development mode happens not to understand Thin async responses. To make this really robust you would need to detect the presence of such middlewares higher up the stack, since the user may add them manually even if Rack does not. Just checking for production environment is too removed from the real problem to be of use.

This is the sort of thing that is best worked around with clear documentation -- does the website need clarifying?

Collaborator

jcoglan commented Jul 3, 2011

The issue is really the the middleware that Rack uses in development mode happens not to understand Thin async responses. To make this really robust you would need to detect the presence of such middlewares higher up the stack, since the user may add them manually even if Rack does not. Just checking for production environment is too removed from the real problem to be of use.

This is the sort of thing that is best worked around with clear documentation -- does the website need clarifying?

@axyjo

This comment has been minimized.

Show comment Hide comment
@axyjo

axyjo Jul 7, 2011

I just ran into this again, please do document this on the website stating that even in development, production mode should (rather, must) be used.

axyjo commented Jul 7, 2011

I just ran into this again, please do document this on the website stating that even in development, production mode should (rather, must) be used.

@jcoglan

This comment has been minimized.

Show comment Hide comment
@jcoglan

jcoglan Jul 7, 2011

Collaborator

It's here in the docs: http://faye.jcoglan.com/ruby.html. Where else should I put it so this stops happening?

Collaborator

jcoglan commented Jul 7, 2011

It's here in the docs: http://faye.jcoglan.com/ruby.html. Where else should I put it so this stops happening?

@axyjo

This comment has been minimized.

Show comment Hide comment
@axyjo

axyjo Jul 7, 2011

I see that the command:

rackup config.ru -s thin -E production

is present in the documentation. However, I assumed that the environment option was merely to be used in deployment, so I omitted that on my development machine. I think that the fact that it must be run in production mode even on development machines should be documented. Thanks!

axyjo commented Jul 7, 2011

I see that the command:

rackup config.ru -s thin -E production

is present in the documentation. However, I assumed that the environment option was merely to be used in deployment, so I omitted that on my development machine. I think that the fact that it must be run in production mode even on development machines should be documented. Thanks!

@andrewhavens

This comment has been minimized.

Show comment Hide comment
@andrewhavens

andrewhavens May 25, 2012

What am I supposed to do if I am mounting the Faye::RackAdapter as part of my Sinatra application? I can't run my application in production mode when it's supposed to be running in development.

What am I supposed to do if I am mounting the Faye::RackAdapter as part of my Sinatra application? I can't run my application in production mode when it's supposed to be running in development.

@jcoglan

This comment has been minimized.

Show comment Hide comment
@jcoglan

jcoglan May 26, 2012

Collaborator

@andrewhavens Run that app using thin start -R config.ru. This will not add the Rack development middlewares that cause async requests to fail.

Collaborator

jcoglan commented May 26, 2012

@andrewhavens Run that app using thin start -R config.ru. This will not add the Rack development middlewares that cause async requests to fail.

@wintermeyer wintermeyer referenced this issue in amooma/GS5 Mar 11, 2013

Closed

private_pub/faye error #237

@mattconnolly

This comment has been minimized.

Show comment Hide comment
@mattconnolly

mattconnolly Nov 16, 2013

I looked in that above linked documentation page. Then I came across the error, then this thread. There is no mention of "production", "development" nor "environment" in that docs page in its current version.

I looked in that above linked documentation page. Then I came across the error, then this thread. There is no mention of "production", "development" nor "environment" in that docs page in its current version.

@jcoglan

This comment has been minimized.

Show comment Hide comment
@jcoglan

jcoglan Nov 17, 2013

Collaborator

@mattconnolly The docs link to this page that explains how to run Faye with various different web servers. This thread dates from a time when we only supported Thin.

Collaborator

jcoglan commented Nov 17, 2013

@mattconnolly The docs link to this page that explains how to run Faye with various different web servers. This thread dates from a time when we only supported Thin.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment