Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection Reset By Peer #152

Open
shadowray0 opened this issue Oct 13, 2022 · 1 comment
Open

Connection Reset By Peer #152

shadowray0 opened this issue Oct 13, 2022 · 1 comment

Comments

@shadowray0
Copy link

shadowray0 commented Oct 13, 2022

Hi All,

I have created a ISO8583 client which is connecting to a JPOS Server.
Server accepts all requests with a 21 length header so I have extended the messagefactory to send the correct header length in parseMessage function.

Now whenever I try to connect to server, client.isConnected() method returns true but then instantly I start getting below error continuously in logs. Any help would be greatly appreciated

2022-10-13 07:59:12,068 [nioEventLoopGroup-13-1] traceId:[] WARN  i.n.channel.DefaultChannelPipeline#1152 -> An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: Connection reset by peer
	at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
	at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
	at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
	at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
	at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
	at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)

Sometimes in between I also get this error

io.netty.handler.codec.DecoderException: java.text.ParseException: ISO8583 MessageFactory has no parsing guide for message type fffffff0 [ISO8583-1993001000000� 
                                                                                                                                                                 YY	1"#
]```
@kpavlov
Copy link
Owner

kpavlov commented Jan 24, 2023

It looks like the server does not understand a message and terminates a connection at some point. You may try to test message encoder in isolation: encode your message to byte array and try to decode it using JPOS decoder. I hope it would help.
Regarding ParseException - I guess that message decoding did not went well and message type was wrongly recognised.

Could you please contribute by adding your test? I could not help you without having a test to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants