Projects tigase _server server-core Issues #306
Non UUID based session ID causes exception to be thrown (#306)
Robert Larsen opened 1 decade ago
2014-04-07 11:34:50.628 [pool-13-thread-15]  BoshConnectionManager.processSocketData()  FINEST: Processing socket data: from=null, to=null, DATA=<body rid="1490329717" sid="81202803a945786a00ce178499b76b015f617d9f" xmlns="http://jabber.org/protocol/httpbind"><iq type="set" id="enable" xmlns="jabber:client"><enable xmlns="urn:xmpp:carbons:2"/></iq></body>, SIZE=211, XMLNS=http://jabber.org/protocol/httpbind, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=null
2014-04-07 11:34:50.628 [ResultsListener-socketWriteThread-4]  SocketThread$ResultsListener.run()  WARNING: Protocol execution exception.
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Invalid UUID string: 81202803a945786a00ce178499b76b015f617d9f
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:188)
	at tigase.net.SocketThread$ResultsListener.run(SocketThread.java:586)
Caused by: java.lang.IllegalArgumentException: Invalid UUID string: 81202803a945786a00ce178499b76b015f617d9f
	at java.util.UUID.fromString(UUID.java:194)
	at tigase.server.bosh.BoshConnectionManager.processSocketData(BoshConnectionManager.java:237)
	at tigase.server.ConnectionManager.packetsReady(ConnectionManager.java:438)
	at tigase.server.ConnectionManager.packetsReady(ConnectionManager.java:83)
	at tigase.net.IOService.call(IOService.java:264)
	at tigase.net.IOService.call(IOService.java:103)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)

StropheJS supports reusing an existing session which we do at our site. However we want to migrate from Ejabberd to Tigase, and Ejabberd sessions don't use UUID's.

The connection manager should probably handle bad SIDs by simply not finding a session.

Robert Larsen commented 1 decade ago

Modifying this:

} else {
    sid = UUID.fromString(sid_str);
    bs  = sessions.get(sid);
}

...to:

} else {
    try {
        sid = UUID.fromString(sid_str);
        bs  = sessions.get(sid);
    } catch (Exception e) {
        log.log(Level.WARNING, "Yeah...then it happened", e);
    }
}

..in tigase.server.bosh.BoshConnectionManager does the trick for me. Maybe the issue also exists in other connection managers.

wojciech.kapcia@tigase.net commented 1 decade ago

Applied in changeset tigase-server|commit:294e15388e7b7e93639ee0718f16e916971503ff.

issue 1 of 1
Type
Bug
Priority
Minor
Assignee
RedmineID
1891
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#306
Please wait...
Page is in error, reload to recover