powered by Jive Software

S2S problem, Connection closed before session established

Hi there,

We have a big wi-fi network in Athens Greece and we want to use JM as an IM service. Our network consists of nodes which get their static IP’s from the 10.xxx.xxx.xxx range, and which root together through multiple routers in the network. Although we have a DNS system, we would like to use IP’s for more stability when using network services.

Our goal is to use the S2S feature of JM so user-clients could connect to different JM servers (they could choose the closest server to their machine) and connect with each other. We know that we can not use the same database for multiple JM servers, though it would be the most appropriate solution to our problem. (could this be something that we will be able to use in the future?)

One single JM setup works fine and fast. When we tried to put up a second setup in a different server the result was disappointing: when users of server B would add a user from server A to their client, the connection between the server was one-way, as well as unstable. In the JM web interface window, we could see that in the server session window there was a one-way connection (incoming to server A, outgoing from server B).

The PCs, where the servers function, are Windows XP systems, running Java1.5.0.x, and are not firewalled. When we run JM (versions: 2.3.0, 2.2.2, and other latest nightly versions/18-11-2005) we get the message:

“Connection closed before session established

Socket[addr=/10.42.44.1,port=4980,localport=5269]

Connection closed before session established

Socket[addr=/10.42.44.1,port=4981,localport=5269]”

Please note that it has been tested that our server ports are open and that we have also tried the server-to-server function by interfering with the settings (TLS/SSL disabled, increasing “connection timeout” (xmpp.server.read.timeout). We have never used any domain names for the servers, despite the fact that we have DNS’.

Is there something that we should look for in the settings and what exactly should we do? Are there any nightly/beta/official versions that could solve this problem?

Thank you for your time.

Hey vassilis,

Make sure that both servers are using the same shared secret or shared key. You may also want to enable the debug log (from the admin console) that will let you collect more information when a s2s connection is being negotiated. Open the logs-debug.log file and post the information you are getting.

Regards,

– Gato

Thank you for replying so quicly.

All the external components were disabled, should I have enabled them?

Anyway, that is what I did, I enabled them (default port: 10015, default shared secret: awmn) and in the allowed-to-connect option, I chose anyone (in the external components).

Still, the same error occurs.

This is the debug

2005.11.19 16:25:15 Logging off 10.86.90.131 on org.jivesoftware.messenger.net.SocketConnection@11710be socket: Socket[addr=/10.86.90.131,port=2980,localport=5269] session: org.jivesoftware.messenger.server.IncomingServerSession@e4e358 status: 1 address: 10.86.90.131 id: ec541948

2005.11.19 16:25:27 Connect Socket[addr=/10.86.90.131,port=2983,localport=5269]

2005.11.19 16:25:27 RS - Received dialback key from host: 10.86.90.131 to: 10.84.230.50

2005.11.19 16:25:29 RS - Trying to connect to Authoritative Server: 10.86.90.131:5269

2005.11.19 16:25:29 RS - Connection to AS: 10.86.90.131:5269 successful

2005.11.19 16:25:29 RS - Asking AS to verify dialback key for idd69439cf

2005.11.19 16:25:29 RS - Key was VERIFIED by the Authoritative Server for: 10.86.90.131

2005.11.19 16:25:29 RS - Closing connection to Authoritative Server: 10.86.90.131

2005.11.19 16:25:29 RS - Sending key verification result to OS: 10.86.90.131

2005.11.19 16:25:29 Logging off 10.86.90.131 on org.jivesoftware.messenger.net.SocketConnection@63f09e socket: Socket[addr=/10.86.90.131,port=2983,localport=5269] session: org.jivesoftware.messenger.server.IncomingServerSession@179b7b0 status: 1 address: 10.86.90.131 id: d69439cf

nothing?

addintion in the error page

2005.11.21 11:10:29 [org.jivesoftware.messenger.net.SocketReader.run(SocketReader.java:153)

] Connection closed before session established

Socket[addr=/10.42.44.1,port=2220,localport=5269]

and last debug

2005.11.21 11:10:29 Connect Socket[addr=/10.42.44.1,port=2220,localport=5269]

2005.11.21 11:10:29 AS - Verifying key for host: 10.42.44.1 id: 9aee68cd

2005.11.21 11:10:29 AS - Key was: VALID for host: 10.42.44.1 id: 9aee68cd

2005.11.21 11:10:29 AS - Connection closed for host: 10.42.44.1 id: 9aee68cd

2005.11.21 11:10:33 Error connecting to the remote server: 10.86.90.131(DNS lookup: 10.86.90.131:5269)

java.net.SocketTimeoutException: connect timed out

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(Unknown Source)

at java.net.PlainSocketImpl.connectToAddress(Unknown Source)

at java.net.PlainSocketImpl.connect(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at org.jivesoftware.messenger.server.ServerDialback.createOutgoingSession(ServerDi alback.java:131)

at org.jivesoftware.messenger.server.OutgoingServerSession.createOutgoingSession(O utgoingServerSession.java:331)

at org.jivesoftware.messenger.server.OutgoingServerSession.authenticateDomain(Outg oingServerSession.java:138)

at org.jivesoftware.messenger.server.OutgoingSessionPromise.createSessionAndSendPa cket(OutgoingSessionPromise.java:129)

at org.jivesoftware.messenger.server.OutgoingSessionPromise.access$300(OutgoingSes sionPromise.java:40)

at org.jivesoftware.messenger.server.OutgoingSessionPromise$1$1.run(OutgoingSessio nPromise.java:94)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

… etc

Sorry forget the last post

I was try to connect 3 servers

Please replay on first and second

Thanks

Nothing?

!!!

Hi

I have the same problem, only:

In version 2.2.2 works s2s, but to estalish connection server need about 30 seconds.

In version 2.3.0 works only incoming connections.

still waiting the correct anwser…

Sounds like this is a common problem. I’'m experiencing the exact same thing. None of the clients are able to connect to the server. Everytime an attempt is made I get a similar message like vassilis has documented. Any suggestions on how to proceed?

Hey vassilis,

Could you enable the debug log in both servers, stop and start the servers and then try establishing s2s communication again? I will need you to post the debug info of each server so I can see what’'s going on.

BTW, when a server connects to a remote server it will use 2 connections. One for sending packets and another one for receiving packets. If you only try to send a packet to the other server then you will only have 1 outgoing connection. If the remote server sends a packet to your server then the other connection is created.

Regards,

– Gato

I’'m currently only running a single server. I disabled the server 2 server function, but this is what I get in my debug log:

2005.11.30 07:37:40 Connect Socket[addr=/192.168.1.118,port=4037,localport=5222]

2005.11.30 07:37:40 Error sending packet to remote server:

java.lang.Exception: Failed to create connection to remote server

at org.jivesoftware.messenger.server.OutgoingSessionPromise.createSessionAndSendPa cket(OutgoingSessionPromise.java:136)

at org.jivesoftware.messenger.server.OutgoingSessionPromise.access$300(OutgoingSes sionPromise.java:40)

at org.jivesoftware.messenger.server.OutgoingSessionPromise$1$1.run(OutgoingSessio nPromise.java:94)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

It repeats for every user that tried to login.

Hey wpossie,

With the little information that you provided my guess is that your server name is not 192.168.1.13. Remember that if your server name is A (you can check the server name that you are using in the main page of the Admin Console) then all users connected to your server will be of the form anyname@A. So if you are trying to use any other value after the @ then the server will assume that your packet was intended to a remote server thus the s2s communication.

Regards,

– Gato

Gato;

That seems to be my problem. I had to change the server name on the admin console to 192.168.1.13, because I get a script error when trying to connect using larry.weir@titan from the client (soapbox). Now I’‘m having problems seeing everyone on my group… I can see everyone in the session area in the admin console, but I can’‘t see everyone on the client. Some have locks beside their name and others don’'t. We have two type os clients psi and soapbox in our establishment. Everyone in the company is a member of the AESI group and when they login everyone should be logging into that group. Unfortunately we only have some that are showing up. Any suggestions?

wpossie,

I’‘m having the same issues as you are. My hostname is listed properly but I still get the same “Error sending packet to remote server”. I only have 1 server and am not going S2S. it’'s frustrating… Any help would be greatly appreciated!

Thanks.

PM.

Is there anyone how has done it? (connect sucessfully S2S)

I think nobody…

Every day i download the last nightly but nothing.

I read everithing in the forum but there is nothing that could solve my problem.

I Give Up.

at org.jivesoftware.messenger.net.ClientSocketReader.processIQ(ClientSocketReader. java:51)

at org.jivesoftware.messenger.net.SocketReader.readStream(SocketReader.java:251)

at org.jivesoftware.messenger.net.SocketReader.run(SocketReader.java:115)

at java.lang.Thread.run(Unknown Source)

2005.12.05 10:20:37 Route not found for JID: vassilis@10.84.230.50/neos

java.lang.NullPointerException

at org.jivesoftware.messenger.spi.RoutingTableImpl.getRoute(RoutingTableImpl.java: 106)

at org.jivesoftware.messenger.spi.RoutingTableImpl.getRoute(RoutingTableImpl.java: 83)

at org.jivesoftware.messenger.IQRouter.handle(IQRouter.java:180)

at org.jivesoftware.messenger.IQRouter.route(IQRouter.java:78)

at org.jivesoftware.messenger.PacketRouter.route(PacketRouter.java:65)

at org.jivesoftware.messenger.muc.spi.MultiUserChatServerImpl.process(MultiUserCha tServerImpl.java:237)

at org.jivesoftware.messenger.muc.spi.MultiUserChatServerImpl.processPacket(MultiU serChatServerImpl.java:194)

at org.jivesoftware.messenger.muc.spi.MultiUserChatServerImpl.process(MultiUserCha tServerImpl.java:184)

at org.jivesoftware.messenger.IQRouter.handle(IQRouter.java:183)

at org.jivesoftware.messenger.IQRouter.route(IQRouter.java:78)

at org.jivesoftware.messenger.PacketRouter.route(PacketRouter.java:65)

at org.jivesoftware.messenger.net.SocketReader.processIQ(SocketReader.java:321)

at org.jivesoftware.messenger.net.ClientSocketReader.processIQ(ClientSocketReader. java:51)

at org.jivesoftware.messenger.net.SocketReader.readStream(SocketReader.java:251)

at org.jivesoftware.messenger.net.SocketReader.run(SocketReader.java:115)

at java.lang.Thread.run(Unknown Source)

2005.12.05 10:20:37 Route not found for JID: vassilis@10.84.230.50/neos

java.lang.NullPointerException

at org.jivesoftware.messenger.spi.RoutingTableImpl.getRoute(RoutingTableImpl.java: 106)

at org.jivesoftware.messenger.spi.RoutingTableImpl.getRoute(RoutingTableImpl.java: 83)

at org.jivesoftware.messenger.IQRouter.handle(IQRouter.java:180)

at org.jivesoftware.messenger.IQRouter.route(IQRouter.java:78)

at org.jivesoftware.messenger.PacketRouter.route(PacketRouter.java:65)

at org.jivesoftware.messenger.PacketRouter.route(PacketRouter.java:57)

at org.jivesoftware.messenger.component.InternalComponentManager.sendPacket(Intern alComponentManager.java:132)

at org.jivesoftware.messenger.plugin.SearchPlugin.processPacket(SearchPlugin.java: 211)

at org.jivesoftware.messenger.component.InternalComponentManager$RoutableComponent .process(InternalComponentManager.java:349)

at org.jivesoftware.messenger.IQRouter.handle(IQRouter.java:183)

at org.jivesoftware.messenger.IQRouter.route(IQRouter.java:78)

at org.jivesoftware.messenger.PacketRouter.route(PacketRouter.java:65)

at org.jivesoftware.messenger.net.SocketReader.processIQ(SocketReader.java:321)

at org.jivesoftware.messenger.net.ClientSocketReader.processIQ(ClientSocketReader. java:51)

at org.jivesoftware.messenger.net.SocketReader.readStream(SocketReader.java:251)

at org.jivesoftware.messenger.net.SocketReader.run(SocketReader.java:115)

at java.lang.Thread.run(Unknown Source)

2005.12.05 10:20:37 Connect Socket[addr=/10.80.185.70,port=2042,localport=5269]

2005.12.05 10:20:37 RS - Received dialback key from host: 10.80.185.70 to: 10.84.230.50

2005.12.05 10:20:39 RS - Trying to connect to Authoritative Server: 10.80.185.70:5269

2005.12.05 10:20:39 RS - Connection to AS: 10.80.185.70:5269 successful

2005.12.05 10:20:39 RS - Asking AS to verify dialback key for id95640305

2005.12.05 10:20:39 RS - Key was VERIFIED by the Authoritative Server for: 10.80.185.70

2005.12.05 10:20:39 RS - Closing connection to Authoritative Server: 10.80.185.70

2005.12.05 10:20:39 RS - Sending key verification result to OS: 10.80.185.70

2005.12.05 10:20:39 Logging off 10.80.185.70 on org.jivesoftware.messenger.net.SocketConnection@179b7b0 socket: Socket[addr=/10.80.185.70,port=2042,localport=5269] session: org.jivesoftware.messenger.server.IncomingServerSession@ab1b4 status: 1 address: 10.80.185.70 id: 95640305

Hey PM,

Can you tell us the name of your server and post some packets that the server is sending and the info you have in the log files? Once we have that information we will be able to help you out. Remember to enable the debug log from the admin console so we can trace the s2s communication.

Regards,

– Gato

Hey vassilis,

Which server version are you using? Is your server name 10.80.185.70? Are you trying to send a message to a remote server whose domain is 10.84.230.50? Which components do you have in your server? What are the domains of those components?

Thanks,

– Gato

Gato,

Unfortunately, I acquired some new hardware that had dual processors and a gig card ( i was using single proc and 100MB) and rebuilt the Jive server with an embedded database so I wouldn’'t be able to get that info anytime soon.

Fortunately, I am no longer having these issues on the new build. I think I did post the debug log in another thread. I’'ll see if I can find it and post an excerpt here.

Thanks for your help!

PM.