Stomp connection keeps on closing right after being opened

68 views
Skip to first unread message

simexous

unread,
Jul 9, 2010, 11:42:44 AM7/9/10
to Orbited Discussion
I m trying to setup a solution with Orbited and RabbitMQ. I've got
the rabbitmq-stomp plugin listening on 61613 and all seems to be set
up properly. However as soon as I open a socket from the browser..

The connection to Orbited is closed and no reason is given?!

the orbited output goes:
=====================================
07/09/10 02:21:18:980 INFO orbited.start using epoll reactor
/usr/local/lib/python2.5/site-packages/orbited-0.7.10-py2.5.egg/
orbited/start.py:25: DeprecationWarning: listenWith is deprecated
since Twisted 10.1. See IReactorFDSet.
reactor.listenWith(port_class, factory=factory_class(),
resource=root, childName=child_path)

07/09/10 02:21:18:336 INFO orbited.start proxy protocol active
07/09/10 02:21:18:338 INFO orbited.start Listening http@9000
07/09/10 02:21:18:342 INFO orbited.start switching to user
simexous (uid=500) and group simexous (gid=500)

07/09/10 02:21:59:800 ACCESS new connection from 192.168.133.1:65009
to talkrespond.dev:61613
07/09/10 02:22:00:207 ACCESS connection closed from
192.168.133.1:65009 to talkrespond.dev:61613
================================================




I m running version the latest version 0.7.10 of orbited

here is the client code (tried it on Firefox 3.5.10 and IE7,8)
================================================

var stompClient = null;

$(document).ready(function(){

Orbited.settings.port = 9000;
Orbited.settings.hostname = talkrespond.dev;
TCPSocket = Orbited.TCPSocket;

//STOMP acts a broker to RabbitMQ
var subscribeDestination = 'window_1';
var subscribeHeaders = {exchange:'RabbitMQ', routing_key:'update'};

stompClient = new STOMPClient();

stompClient.onconnectedframe = function() { // Run on initial
connection to STOMP (comet) server
alert('connected')
stompClient.ready = true
stompClient.subscribe(subscribeDestination, subscribeHeaders);
};

stompClient.onmessageframe = function(frame) {
alert('The server said ' + frame.body);
};

stompClient.connect(talkrespond.dev, 61613,'guest','guest');
})



================================================


orbited.cfg:
================================================
[global]
#reactor=select
# reactor=kqueue
reactor=epoll

#proxy.enabled = 1
session.ping_interval = 40
session.ping_timeout = 30
user = simexous

[listen]
http://:9000

[access]
* -> talkrespond.dev:61613


[logging]
debug=STDERR,debug.log
info=STDERR,info.log
access=STDERR,info.log
warn=STDERR,error.log
error=STDERR,error.log

#Don't enable debug by default
enabled.default=info,access,warn,error
================================================


Any help is much appreciated...

Thanks!

--
S.

leon

unread,
Jul 9, 2010, 9:00:31 PM7/9/10
to Orbited Discussion
This does not seem to be happening on Orbited's side, but the message
broker's instead. Can you share the error.log contents, if any? Also,
have you checked RabbitMQ's log file(s) for anything unusual?

simexous

unread,
Jul 10, 2010, 12:59:07 AM7/10/10
to Orbited Discussion
Thanks for the reply Leon...

Actually, yeah here is what the rabbitmq log says.. (nothing is on
orbited error.log btw)

=INFO REPORT==== 10-Jul-2010::00:56:30 ===
accepted TCP connection on 0.0.0.0:5672 from 192.168.133.128:35910

=INFO REPORT==== 10-Jul-2010::00:56:30 ===
starting TCP connection <0.606.0> from 192.168.133.128:35910

=WARNING REPORT==== 10-Jul-2010::00:56:30 ===
exception on TCP connection <0.606.0> from 192.168.133.128:35910
connection_closed_abruptly

=INFO REPORT==== 10-Jul-2010::00:56:30 ===
closing TCP connection <0.606.0> from 192.168.133.128:35910

=INFO REPORT==== 10-Jul-2010::00:56:31 ===
accepted TCP connection on 0.0.0.0:61613 from 192.168.133.128:57132

=INFO REPORT==== 10-Jul-2010::00:56:31 ===
starting STOMP connection <0.612.0> from 192.168.133.128:57132

=INFO REPORT==== 10-Jul-2010::00:56:31 ===
accepted TCP connection on 0.0.0.0:5672 from 192.168.133.128:35913

=INFO REPORT==== 10-Jul-2010::00:56:31 ===
starting TCP connection <0.613.0> from 192.168.133.128:35913

=ERROR REPORT==== 10-Jul-2010::00:56:31 ===
STOMP error frame sent:
Message: "Processing error"
Detail: "Processing error\n"
Server private detail: {undef,
[{rabbit_reader_queue_collector,start_link,[]},
{rabbit_stomp_server,do_login,4},
{rabbit_stomp_server,process_frame,3},

{rabbit_stomp_server,process_received_bytes,2},
{rabbit_stomp_server,init,1},
{proc_lib,init_p_do_apply,3}]}

=INFO REPORT==== 10-Jul-2010::00:56:31 ===
ending STOMP connection <0.612.0> from 192.168.133.128:57132

=WARNING REPORT==== 10-Jul-2010::00:56:32 ===
exception on TCP connection <0.613.0> from 192.168.133.128:35913
connection_closed_abruptly

=INFO REPORT==== 10-Jul-2010::00:56:32 ===
closing TCP connection <0.613.0> from 192.168.133.128:35913

=INFO REPORT==== 10-Jul-2010::00:56:34 ===
accepted TCP connection on 0.0.0.0:5672 from 192.168.133.128:35915

=INFO REPORT==== 10-Jul-2010::00:56:34 ===
starting TCP connection <0.622.0> from 192.168.133.128:35915

=WARNING REPORT==== 10-Jul-2010::00:56:34 ===
exception on TCP connection <0.622.0> from 192.168.133.128:35915
connection_closed_abruptly

=INFO REPORT==== 10-Jul-2010::00:56:34 ===
closing TCP connection <0.622.0> from 192.168.133.128:35915

leon

unread,
Jul 10, 2010, 11:40:36 AM7/10/10
to Orbited Discussion
After you start Orbited, are you able to visit the examples that ship
with Orbited? They should be available on http://server:your_configured_port/static/demos/.
If the page pops up, first step is fine.

I'm not into RabbitMQ, so I am not sure there's something else in its
conf file that could give you those problems.

You can also try to modify the following on your JS file:

stompClient.subscribe(subscribeDestination, subscribeHeaders);

to not send the subscription headers and only send the destination as
the parameter.

Is your RabbitMQ accepting connections for guest/guest? I use
ActiveMQ, so I am not sure what the standards for RabbitMQ are.

simexous

unread,
Jul 10, 2010, 6:09:31 PM7/10/10
to Orbited Discussion
Yeah.. I am able to access the /static/demos url just fine..although
in the STOMP test demo I am unable to connect properly....rabbitMQ
allows me to publish messages with the guest account just fine though.

This is what I get in the STOMP demo after I try to connect:
→ Transport closed (code: 106)

and in the log:

07/10/10 18:02:53:998 WARN
orbited.proxy.ProxyIncomingProtocol Unauthorized connect from
'192.168.133.1':55568 to 'localhost':61613
07/10/10 18:02:54:426 ACCESS connection closed from
192.168.133.1:55568 to localhost:61613
07/10/10 18:02:58:218 WARN
orbited.proxy.ProxyIncomingProtocol Unauthorized connect from
'192.168.133.1':55569 to 'localhost':61613
07/10/10 18:02:58:219 ACCESS connection closed from
192.168.133.1:55569 to localhost:61613

As far as modifying: stompClient.subscribe(subscribeDestination,
subscribeHeaders) JS doesn't make it that far... I don't subscribe
until a connection is established.

You mentioned that you use activeMQ, I might give that a try and see..
maybe I won't run into all these problems..


Thanks!



On Jul 10, 11:40 am, leon <aeondete...@hotmail.com> wrote:
> After you start Orbited, are you able to visit the examples that ship
> with Orbited? They should be available onhttp://server:your_configured_port/static/demos/.

leon

unread,
Jul 10, 2010, 9:41:16 PM7/10/10
to Orbited Discussion
When I first tried, I went directly with ActiveMQ. I remember
considering RabbitMQ, but then the Apache background made me choose
ActiveMQ. It took me a while to figure how to set up the
authentication as I'm a complete moron in Java, but I described the
simple authentication plugin usage on a page you can find in this very
group's home. If you need help setting ActiveMQ up, I'll be able to
help in a much more useful way.


Let there be Comet, and Push away.
Best of luck.

simexous

unread,
Jul 12, 2010, 3:03:29 PM7/12/10
to Orbited Discussion
ActiveMQ was a breath of fresh air..not sure about performance, but it
works out of the box (since it's Java) and has a sweet web based admin
console.
Anyways, I was able to get my stomp client to communicate with
ActiveMQ through Orbited just fine... however every once in a while I
would get this exception on the console: (after which the connection
closes)..? Thanks!

Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/Twisted-10.1.0-py2.5-
linux-i686.egg/twisted/protocols/basic.py", line 251, in dataReceived
why = self.lineReceived(line)
File "/usr/local/lib/python2.5/site-packages/Twisted-10.1.0-py2.5-
linux-i686.egg/twisted/web/http.py", line 1573, in lineReceived
self.allContentReceived()
File "/usr/local/lib/python2.5/site-packages/Twisted-10.1.0-py2.5-
linux-i686.egg/twisted/web/http.py", line 1641, in allContentReceived
req.requestReceived(command, path, version)
File "/usr/local/lib/python2.5/site-packages/Twisted-10.1.0-py2.5-
linux-i686.egg/twisted/web/http.py", line 807, in requestReceived
self.process()
--- <exception caught here> ---
File "/usr/local/lib/python2.5/site-packages/Twisted-10.1.0-py2.5-
linux-i686.egg/twisted/web/server.py", line 125, in process
self.render(resrc)
File "/usr/local/lib/python2.5/site-packages/Twisted-10.1.0-py2.5-
linux-i686.egg/twisted/web/server.py", line 132, in render
body = resrc.render(self)
File "/usr/local/lib/python2.5/site-packages/orbited-0.7.10-
py2.5.egg/orbited/transports/base.py", line 21, in render
self.conn.transportOpened(self)
File "/usr/local/lib/python2.5/site-packages/orbited-0.7.10-
py2.5.egg/orbited/cometsession.py", line 304, in transportOpened
self.cometTransport.close()
File "/usr/local/lib/python2.5/site-packages/orbited-0.7.10-
py2.5.egg/orbited/transports/base.py", line 72, in close
self.request.finish()
File "/usr/local/lib/python2.5/site-packages/Twisted-10.1.0-py2.5-
linux-i686.egg/twisted/web/http.py", line 900, in finish
"Request.finish called on a request after its connection was lost;
"
exceptions.RuntimeError: Request.finish called on a request after its
connection was lost; use Request.notifyFinish to keep track of this.

07/12/10 15:00:04:867 ACCESS connection closed from
192.168.133.1:56085 to talkrespond.dev:61613

BobDobbs

unread,
Jul 13, 2010, 10:40:28 AM7/13/10
to Orbited Discussion
In the past when I have seen lines like these:

Unauthorized connect from
'192.168.133.1':55569 to 'localhost':61613

It was related to how localhost is resolved. Sometimes host files are
weird or orbited doesn't like the name you gave it. I would generally
try opening orbited and editing the lines like this:

* -> 10.1.2.222:61613 (using a hardcoded IP addy)

I believe this is telling proxy that anyone (*) can be proxied over to
10.1.2.222:61613 (the address of ActiveMQ in our case). Often... if we
used * -> localhost:61613 we would see auth failures. Sometimes
localhost does not resolve the way you might expect.

Anyway... you say you switched to AMQ and the problem went away.
Perhaps you adjusted this value in orbited config... or perhaps the
same error shows up when talking to RabbitMQ for a different reason.
Anyway... whenever I have seen the auth issue... it just took some
adjusting to the [access] lines to fix it (for us :) )

leon

unread,
Jul 13, 2010, 12:24:18 PM7/13/10
to Orbited Discussion
How's the setup for talkrespond.dev? Is that added to your /etc/hosts
file? Are you piping the traffic through your webserver (Apache?)?
> > > > > > > here is the client code (tried it on Firefox 3.5.10 and IE7,8)...
>
> mais »

BobDobbs

unread,
Jul 13, 2010, 1:53:13 PM7/13/10
to Orbited Discussion
Hey.. just reread over the post and realized why you got the localhost
auth issue. You were using the demo and the demo expects to connect on
localhost (its hardcoded). Try editing the demo javascript to connect
instead to your message broker. Then you should have js that is
expected to work and could maybe eliminate some variables. Sorry for
the static.

Also... in your original post... two lines were odd to me...

1) Orbited.settings.hostname = talkrespond.dev;
2) stompClient.connect(talkrespond.dev, 61613,'guest','guest');

I would have expected in both cases for talkrespond.dev to have been
enclosed in quotes. I would have expected a js error.. but if you
didn't get one... maybe you do indeed have an object in global called
talkrespond that has a property of dev? It seems that you were indeed
hitting RabbitMQ... so perhaps this is not a problem.

simexous

unread,
Jul 13, 2010, 2:55:21 PM7/13/10
to Orbited Discussion
@leon.. yeah it's added to my /etc/hosts..I m not piping any traffic
to the webserver though...
> ...
>
> read more »

simexous

unread,
Jul 13, 2010, 2:58:40 PM7/13/10
to Orbited Discussion
@BobDobbs Thanks that might help if I decide to switch back to Rabbit.
For now..it seems like everything is working as expected..except for
the exception that gets thrown away once in a while..
As far as talkrespond.dev..that's something I added manually (wasn't
part of my code as in the code it's a variable)..I just forgot to
include it in the quotes..
Reply all
Reply to author
Forward
0 new messages