Openfire resetting connections

This question has been asked a couple times in the forums with no resolve, but hopefully my situation will be different.

I am running the linux openfire installed from RPM (Fedora 6) with VMware 1.03. The guest OS was built on my machine and then transferred to our server at a remote location. Ever since I got openfire running on the remote server it kicks all the connections off about 2-3 times a day for what seems like no reason… all the logs look good. So I turned on debugging and this is what is spat out:

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)
2007.08.16 10:52:50 Closing connection that has been idle: org.jivesoftware.openfire.nio.NIOConnection@3a0533 MINA Session: (SOCKET, R: /129.0.1.171:1795, L: /172.16.0.7:5222, S: 0.0.0.0/0.0.0.0:5222)
2007.08.16 11:37:25
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(Unknown Source)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.read(Unknown Source)
at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.j ava:232)
at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcesso r.java:206)
at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$500(SocketIoProce ssor.java:44)
at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProce ssor.java:506)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
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)
2007.08.16 12:42:29 Closing connection that has been idle: org.jivesoftware.openfire.nio.NIOConnection@131a519 MINA Session: (SOCKET, R: /129.0.1.166:1323, L: /172.16.0.7:5222, S: 0.0.0.0/0.0.0.0:5222)
2007.08.16 12:50:22 Rejecting packet. JID malformed
java.lang.IllegalArgumentException: Illegal JID:
at org.xmpp.packet.JID.init(JID.java:384)
at org.xmpp.packet.JID.(JID.java:259)
at org.xmpp.packet.Packet.(Packet.java:73)
at org.xmpp.packet.IQ.(IQ.java:82)
at org.jivesoftware.openfire.net.StanzaHandler.getIQ(StanzaHandler.java:272)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:236)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:153)
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:132)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:703)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)
at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:62)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:200)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :266)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:326)
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)
Caused by: org.jivesoftware.stringprep.IDNAException: String too long.
at org.jivesoftware.stringprep.IDNA.toASCII(IDNA.java:153)
at org.jivesoftware.stringprep.IDNA.toASCII(IDNA.java:53)
at org.xmpp.packet.JID.init(JID.java:355)
… 21 more
2007.08.16 13:11:00 Ignoring extra content {}

When I was first testing openfire/spark I built a windows virtual machine and had it running on there for about 2 months with no problems. When I installed the linux version, it had a Java issue so I downloaded Java 1.5 or 1.6 jre RPM and installed that, problem seemed to be solved… I am trying to rule out any installation/Java issues before I start to check for a VMware issue… Please advise!!! ô¿ô Thanks in advance!

Yesterday I put the client.idle = -1 in the system properties and it stopped some clietns from getting disconnected but this morning i checked the logs and this appearedin the WARN

007.08.16 15:35:19 Closing session due to exception: (SOCKET, R: /129.0.1.189:1112, L: /172.16.0.7:5223, S: 0.0.0.0/0.0.0.0:5223)

org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.Exception: Stopped parsing never ending stanza (Hexdump: 43 6D 58 4F 56 2B 4F 39 57 57 39 33 70 53 62 53 56 47 75 73 4E 4D 65 73 42 6F 46 76 5A 45 66 31 72 4D 48 78 74 6B 44 59 38 79 48 30 55 2F 56 2F 57 47 30 44 68 42 47 69 63 41 34 69 74 37 44 34 38 36 59 41 59 36 44 4E 32 70 69 59 32…(GOES ON FOR A LONG TIME… )

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:184)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :266)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:326)
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)
Caused by: java.lang.Exception: Stopped parsing never ending stanza
at org.jivesoftware.openfire.nio.XMLLightweightParser.read(XMLLightweightParser.ja va:153)
at org.jivesoftware.openfire.nio.XMPPDecoder.doDecode(XMPPDecoder.java:31)
at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtoco lDecoder.java:137)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:172)
… 8 more
2007.08.16 17:12:44 Closing session due to incorrect hostname in stream header. Host: 172.16.0.7. Connection: org.jivesoftware.openfire.net.SocketConnection@4b9e67 socket: Socket[http://addr=/172.16.0.7,port=36856,localport=5269] session: null
2007.08.16 17:12:44 Closing session due to incorrect hostname in stream header. Host: 172.16.0.7. Connection: org.jivesoftware.openfire.net.SocketConnection@101f42d socket: Socket[http://addr=/172.16.0.7,port=36857,localport=5269] session: null
2007.08.17 07:56:33 Closing session due to incorrect hostname in stream header. Host: 172.16.0.7. Connection: org.jivesoftware.openfire.net.SocketConnection@d454f5 socket: Socket[http://addr=/172.16.0.7,port=48575,localport=5269] session: null
2007.08.17 07:56:33 Closing session due to incorrect hostname in stream header. Host: 172.16.0.7. Connection: org.jivesoftware.openfire.net.SocketConnection@5fdc60 socket: Socket[http://addr=/172.16.0.7,port=48576,localport=5269] session: null
2007.08.17 09:04:09 Closing session due to incorrect hostname in stream header. Host: 172.16.0.7. Connection: org.jivesoftware.openfire.net.SocketConnection@1203b65 socket: Socket[http://addr=/172.16.0.7,port=58653,localport=5269] session: null
2007.08.17 09:04:09 Closing session due to incorrect hostname in stream header. Host: 172.16.0.7. Connection: org.jivesoftware.openfire.net.SocketConnection@1c48eae socket: Socket[http://addr=/172.16.0.7,port=58654,localport=5269] session: null

and in the Debug I go that same EXCEPTION error

2007.08.17 09:17:16 EXCEPTION
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at org.mortbay.io.ByteArrayBuffer.readFrom(ByteArrayBuffer.java:168)
at org.mortbay.io.bio.StreamEndPoint.fill(StreamEndPoint.java:99)
at org.mortbay.jetty.bio.SocketConnector$Connection.fill(SocketConnector.java:190)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:277)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:203)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
2007.08.17 09:17:16 EOF

Aybody??? Please help!!! it’s driving me insane!!! ô¿ô

Cheerz!

Hey exordium,

The Stopped parsing never ending stanza occurs when a client tries to send a single XML stanza that is bigger than 1MB. In order to prevent DoS attacks the server will just close the suspicious client.

Regards,

– Gato

I am suffering this same problem. A couple times a day all clients (Spark) are kicked off and reiniciate. My server is Openfire running over Red Hat Enterprise 4 in a VMWare virtual machine. The Openfire’s error.log are empty, but the Spark’s error.log says something like that:

17/08/2007 13:24:44 org.jivesoftware.spark.util.log.Log error

SEVERE: Connection closed on error.

java.io.EOFException: no more data available - expected end tag </stream:stream> to close start tag <stream:stream> from line 1, parser stopped on END_TAG seen …mydomain.com/spark" to="l0s3r@mydomain.com" type=“unavailable”/>… @1:59708

at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3014)

at org.xmlpull.mxp1.MXParser.more(MXParser.java:3025)

at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)

at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:368)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

All clients are kicked off at same time. Are this the Stopped parsing never ending stanza in action?

Thanks.

Hello Gato,

Thanks for the reply, that’s good info to know… So could all the disconnects be the server freaking out over the XML parsing? If so, what information are the clients requesting/sending? This server is still in it’s testing phase; I have about 20 users created but only 5-7 are connected at any given time and even then they aren’t chatting much so there is very little traffic. The Java memory is set for 96 - 256MB and only 75 - 90MB is in use with 6 users… is that normal? I also noticed an increase in the memory usage when I installed neos (vs. Spark) on 2 clients. I am testing Neos with openfire because I thought maybe spark was just having an issue, plus Spark is a little bit of a memory hog (I really like spark but the 70MB physical and virtual memory usage will eventually bog down a Terminal Server. )

Oh, I should also mention no one has their Vcard info entered… and I increased a few of the cache sizes by .5 megs to increase their efficiency…

Thank you for all your assistance,

Cheerz!

Matt

Hey Matt,

Thanks for the reply, that’s good info to know… So could all the disconnects be the server freaking out over the XML parsing?

Hard to tell from here. You should check the log files and see if for each disconnection you see the same error.

The Java memory is set for 96 - 256MB and only 75 - 90MB is in use with 6 users… is that normal? I also noticed an increase in the memory usage when I installed neos (vs. Spark) on 2 clients. I am testing Neos with openfire because I thought maybe spark was just having an issue, plus Spark is a little bit of a memory hog (I really like spark but the 70MB physical and virtual memory usage will eventually bog down a Terminal Server. )

Oh, I should also mention no one has their Vcard info entered… and I increased a few of the cache sizes by .5 megs to increase their efficiency…

What’s the number of concurrent users that you are expecting? I would risk to say that you are doing a very low level memory-following work that may not be that useful. Maybe if you tell us number of expected concurrent users we can give you some idea of required memory.

Regards,

– Gato

I will start to monitor the logs and check for some consistent errors.

As for the memory, if I can sort out the bugs and “go live” with openfire, I will eventually have up to 300+ users. At the moment, I am testing it with roughly 20 users. I have 512 Megs allocated for the Virtual machine currently (96-256 for Java) and can increase it to 2GB if need be.

Cheerz!

Matt

Hey Matt,

Assigning 256MB for 300 concurrent users should be more that fine. Of course setting a max of 512MB is fine too.

Regards,

    • Gato

Thanks for your help Gato!

I’m seeing the same errors. My clients get reset and are not connected to openfire any more. I’m also using Linux Redhat RHEL4/U5 with latest openfire rpm.

There are only 4-5 concurrent user logged in yet. Every user has one 1-3 gateway connections via either icq/yahoo/irc. The errors are as follows:

2007.08.22 17:20:30 Connection closed on Error

java.io.EOFException: no more data available - expected end tag … @1:754

at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3014)

at org.xmlpull.mxp1.MXParser.more(MXParser.java:3025)

at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)

at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:419)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:45)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:77)

I didn’t raise memory allocation by java because there are free resources left:

17.78 MB of 63.31 MB (28.1%) used

Any ideas??

Thanks for your help.