Error: Unable to load /cometd status:500 status=500

233 views
Skip to first unread message

Siarhei Barysiuk

unread,
Aug 30, 2008, 8:02:37 AM8/30/08
to cometd-users
Hello,

I'm starting with cometd. So, I managed to install twisted stuff and
run cometd example.
I can load any example but none of them works. I always have Error:
Unable to load /cometd status:500 status=500 in Firebug console.

Client is trying to send following message to /cometd

message [
{"version":"1.0",
"minimumVersion":"0.9",
"channel":"/meta/handshake",
"id":"0",
"supportedConnectionTypes":["long-polling","long-polling-json-
encoded","callback-polling"],
"timestamp":"Sat, 30 Aug 2008 11:17:13 GMT"
}];

And server response in logs looks like
2008-08-30 14:42:10+0300 [HTTPChannel,43,127.0.0.1] Response is:
{'advice': {'reconect': 'handshake'},
'channel': '/meta/handshake',
'error': [1001,
"Client connection type(s) : ['long-polling', 'long-
polling-json-encoded', 'callback-polling'] not availiable in server
conncetion types"],
'successful': 'false',
'supportedConnectionTypes': ['iframe',
'flash',
'callback-polling',
'long-polling'],
'version': '1.0'}


As far as I understand the reason is in supportedConnectionTypes. I
took a look at bayeux_server.py and found BayeuxServer.Handshake, line
82 where server checks differences in connection types. It seems that
server and client have different lists and server returns error.

It's strange because I'm just running out-of-the-box examples. Any
ideas how to fix this?

Thanks,
Siarhei Barysiuk

Bjarki Björgúlfsson

unread,
Sep 1, 2008, 7:36:50 AM9/1/08
to cometd...@googlegroups.com
Are you sure you aren't running another server on port 8080? If I recall it correctly I got a 500 error at first and the reason was because I have Oracle Expressed server installed and it was running on port 8080

2008/8/30 Siarhei Barysiuk <S.Bar...@gmail.com>

Siarhei Barysiuk

unread,
Sep 1, 2008, 9:17:55 AM9/1/08
to cometd...@googlegroups.com
Hello Bjarki,

Thanks for your response. I'm sure that there is no any server running on 8080.
That's problem with cometd-python implementation only. And I realized
where it is.

If you take a look at bayeux_server.py line 82 you will see following check:
...
//checking for supported connection types
elseif clientConnectionTypesSet.difference(self.connectionTypesSet):
//send error to client

self.connectionTypesSet is ["iframe",
"flash","callback-polling","long-polling"].
clientConnectionTypesSet is
["callback-polling","long-polling","long-json-polling"].

So, client has "long-json-polling" connection type which server does
not support.
It strange that server generates error because client has also 2
supported connection
types which can be used.There is a clause from specification:

- Successful handshake response
- supportedConnectionTypes
The connection types supported by the server for the purposes of the
connection being negotiated. This list MAY be a subset of the
connection types actually supported if the server wishes to negotiate
a specific connection type. This list MUST contain at list one element
in common with the supportedConnectionType provided in the handshake
request. If there are no connectionTypes in common, the handshake
response MUST be unsuccessful.

As fas as I understand it should work.

And I realized that cometd-twisted implementation is not really ready
for production and even to start with comet.
It's actually out-of-date stuff. If to compare, I installed jetty with
working examples within 10 minutes.

Best regards,
Siarhei Barysiuk
Reply all
Reply to author
Forward
0 new messages