librelist archives

« back to archive

Assertion failed: !engine (session.cpp:287)

Assertion failed: !engine (session.cpp:287)

From:
snacktime
Date:
2010-09-27 @ 20:30
I'm trying to get a basic flash client, ruby handler working using
using json.  My config file is the mongrel2.conf with only the ip
numbers changed.  Handler is a simple ruby handler using m2r (pasted
at bottom of this message).  I'm using flex to make a simple flash
client that uses a modified JsSocket class.

Flash connects and after trying to send 5-10 json messages the server
dies with Assertion failed: !engine (session.cpp:287).  The handler
doesn't appear to get anything from the server.  So what have I
screwed up?

Also, is there logging that can be turned on to show client
connections, data sent/received, etc..?

Chris


-----------------------------------------------------
require 'rubygems'

$: << File.expand_path(File.dirname(__FILE__))
require "connection.rb"

sender_id = "C2256F34-14A1-45DD-BB73-97CAE25E25B4"

conn = Mongrel2::Connection.new(sender_id, "tcp://192.168.234.10:9999",
                          "tcp://192.168.234.10:9998")

while true
  puts "WAITING FOR REQUEST"

  req = conn.recv_json

  if req.is_disconnect
    puts "DISCONNECT"
    next
  end

  puts "GOT REQUEST"

  conn.reply_json(req, {:test => 'test'})
end

Re: [mongrel2] Assertion failed: !engine (session.cpp:287)

From:
Zed A. Shaw
Date:
2010-09-28 @ 00:29
On Mon, Sep 27, 2010 at 01:30:00PM -0700, snacktime wrote:
> Flash connects and after trying to send 5-10 json messages the server
> dies with Assertion failed: !engine (session.cpp:287).  The handler
> doesn't appear to get anything from the server.  So what have I
> screwed up?

Hmmm, that's from zeromq.  Wonder what's going on.

> Also, is there logging that can be turned on to show client
> connections, data sent/received, etc..?

Yep, do a:

make clean dev

That will rebuild mongrel2 with all the instane logging turned on so you
can see everything.  Then look in the logs/error.log (or stdout if
you're just running it non-root).

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Assertion failed: !engine (session.cpp:287)

From:
snacktime
Date:
2010-09-28 @ 00:44
On Mon, Sep 27, 2010 at 5:29 PM, Zed A. Shaw <zedshaw@zedshaw.com> wrote:
> On Mon, Sep 27, 2010 at 01:30:00PM -0700, snacktime wrote:
>> Flash connects and after trying to send 5-10 json messages the server
>> dies with Assertion failed: !engine (session.cpp:287).  The handler
>> doesn't appear to get anything from the server.  So what have I
>> screwed up?
>
> Hmmm, that's from zeromq.  Wonder what's going on.
>
>> Also, is there logging that can be turned on to show client
>> connections, data sent/received, etc..?
>
> Yep, do a:
>
> make clean dev
>
> That will rebuild mongrel2 with all the instane logging turned on so you
> can see everything.  Then look in the logs/error.log (or stdout if
> you're just running it non-root).

Sweet, thanks!

Chris

Re: Assertion failed: !engine (session.cpp:287)

From:
snacktime
Date:
2010-09-27 @ 20:37
Ok that was stupid.  My flash client was trying to connect directly to
one of the 0mq end points.  Duh.

Chris

On Mon, Sep 27, 2010 at 1:30 PM, snacktime <snacktime@gmail.com> wrote:
> I'm trying to get a basic flash client, ruby handler working using
> using json.  My config file is the mongrel2.conf with only the ip
> numbers changed.  Handler is a simple ruby handler using m2r (pasted
> at bottom of this message).  I'm using flex to make a simple flash
> client that uses a modified JsSocket class.
>
> Flash connects and after trying to send 5-10 json messages the server
> dies with Assertion failed: !engine (session.cpp:287).  The handler
> doesn't appear to get anything from the server.  So what have I
> screwed up?
>
> Also, is there logging that can be turned on to show client
> connections, data sent/received, etc..?
>
> Chris
>
>
> -----------------------------------------------------
> require 'rubygems'
>
> $: << File.expand_path(File.dirname(__FILE__))
> require "connection.rb"
>
> sender_id = "C2256F34-14A1-45DD-BB73-97CAE25E25B4"
>
> conn = Mongrel2::Connection.new(sender_id, "tcp://192.168.234.10:9999",
>                          "tcp://192.168.234.10:9998")
>
> while true
>  puts "WAITING FOR REQUEST"
>
>  req = conn.recv_json
>
>  if req.is_disconnect
>    puts "DISCONNECT"
>    next
>  end
>
>  puts "GOT REQUEST"
>
>  conn.reply_json(req, {:test => 'test'})
> end
>

Re: [mongrel2] Re: Assertion failed: !engine (session.cpp:287)

From:
Zed A. Shaw
Date:
2010-09-28 @ 00:30
On Mon, Sep 27, 2010 at 01:37:32PM -0700, snacktime wrote:
> Ok that was stupid.  My flash client was trying to connect directly to
> one of the 0mq end points.  Duh.

Ha, nice, yeah that'll fail.  Interesting abort though, the zeromq guys
shouldn't do that since it'll crash a server and is basically DDoS.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Re: Assertion failed: !engine (session.cpp:287)

From:
Timothy Fitz
Date:
2010-09-28 @ 00:44
On Mon, Sep 27, 2010 at 5:30 PM, Zed A. Shaw <zedshaw@zedshaw.com> wrote:

> On Mon, Sep 27, 2010 at 01:37:32PM -0700, snacktime wrote:
> > Ok that was stupid.  My flash client was trying to connect directly to
> > one of the 0mq end points.  Duh.
>
> Ha, nice, yeah that'll fail.  Interesting abort though, the zeromq guys
> shouldn't do that since it'll crash a server and is basically DDoS.


I believe this is a known bug. Their current stance is "don't open ZeroMQ to
the internet, it's not designed for that yet". A focus on security is coming
up on their roadmap.

That means you should always configure Mongrel2 to bind 0MQ to local-only ip
address, or you should always firewall it from the general internet.

Timothy

Re: [mongrel2] Re: Assertion failed: !engine (session.cpp:287)

From:
Zed A. Shaw
Date:
2010-09-28 @ 01:07
On Mon, Sep 27, 2010 at 05:44:51PM -0700, Timothy Fitz wrote:
> On Mon, Sep 27, 2010 at 5:30 PM, Zed A. Shaw <zedshaw@zedshaw.com> wrote:
> I believe this is a known bug. Their current stance is "don't open ZeroMQ to
> the internet, it's not designed for that yet". A focus on security is coming
> up on their roadmap.

Enterprise guys say the darndest things. :-)

> That means you should always configure Mongrel2 to bind 0MQ to local-only ip
> address, or you should always firewall it from the general internet.

Yep, totally agree.  I was going to play with 0mq for a protocol on the
internet and just wasn't ready for any of that.

-- 
Zed A. Shaw
http://zedshaw.com/