Teltonika and OsmAnd protocol issues after upgrade from 5.6 to the newest version

Andrii Hondaa year ago

Good day, I have a Teltonika protocol issue with the GPS tracker Teltonika FMB001. After upgrading from 5.6 to 5.7 and never versions Traccar has stopped to receive data from this model. I suppose that after upgrading Netty to proceed with switching Javax to Jakarta Netty broke protocols receiving logic. Also, the same problem we have with OsmAnd Protocol this protocol have frequent problem with connection timeout.

Track-tracea year ago

First thing you do to check the issue is look at traccar log..

Andrii Hondaa year ago
2023-09-06 14:01:32 ERROR: LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
2023-09-06 15:41:10 ERROR: LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
2023-09-06 15:41:10 ERROR: LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
2023-09-06 17:47:51 ERROR: LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
2023-09-06 17:47:51 ERROR: LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.

After upgrade from 5.6 to 5.7 and the newest, I have found this error in logs.

Andrii Hondaa year ago

For OsmAnd protocol uses MacroDroid script in android app that sends the phone location by OsmAnd protocol every hour by HTTP. After upgrade to 5.7 and the 5.9 version, traccar sends java.io.Exception: unexpected end of stream

Track-tracea year ago

I have no clue about how to solve those errors like: ERROR: LEAK: ByteBuf.release() was not called before it's garbage-collected.

It would be really interesting if someone can show what the approach is to solve such issues (tools used and howto find the isue and correct it).

Anton Tananaeva year ago

What makes you think it's related to Jakarta upgrade?

And we'll also probably need to see more data from logs, not just the error, but a few lines around it.

Andrii Hondaa year ago

I think it's not related to the Jakarta upgrade but it's related to the Netty upgrade to io.netty:netty-all:4.1.91.Final ( Traccar v.5.7) version, because network pipeline related to working with protocols.
In version 5.6 Traccar uses Netty io.netty:netty-all:4.1.87.Final that may have worked previously, but in 5.7 have broken. Or this problem started from some protocol changes to Teltonika protocol like the commit from 6 Apr: https://github.com/traccar/traccar/commit/4ece72558c80038728fa67ec51238bac48fc4d64
But with OsmAnd protocol problem is not related to commits, because the last commit for OsmAnd is https://github.com/traccar/traccar/commit/7237e4b515884721058993f2ccb8f06f8333b867 was made previously than version 5.6.

Andrii Hondaa year ago
2023-09-06 17:47:51  INFO: [Td6f72f25: wialon < 167.000.000.00] 2344233036303932333b3134343733393b343935302e373436303b4e3b30323335392e323339313b453b35303b3234313b3239362e3030303030303b32313b302e3630303030303b4e413b4e413b4e413b4e413b7072696f723a313a302c6576656e745f696f5f69643a313a302c746f74616c5f696f3a313a32352c696f5f3233393a313a312c696f5f3234303a313a312c696f5f38303a313a312c67736d3a313a352c696f5f32313a313a352c696f5f3230303a313a302c696f5f36393a313a312c696f5f313a313a312c696f5f3137393a313a302c696f5f3131333a313a39332c70646f703a323a302e3930303030302c696f5f3138313a313a392c696f5f3138323a313a362c7077725f6578743a323a31332e3537303030302c696f5f36363a313a31333537302c696f5f32343a313a35302c63656c6c5f69643a313a333337352c696f5f3230353a313a333337352c6c61633a313a35333930322c696f5f3230363a313a35333930322c7077725f696e743a323a342e3034333030302c696f5f36373a313a343034332c696f5f36383a313a302c696f5f393a313a31323431322c696f5f31373a313a36353437332c696f5f31383a313a36353532372c696f5f31393a313a32322c696f5f32353a323a3330302e3030303030302c6d63633a313a3235352c6d6e633a313a362c696f5f3234313a313a32353530362c696f5f3139393a313a373836362c696f5f31363a313a3130323034363831370d0a2344233036303932333b3134343733313b343935302e373733393b4e3b30323335392e333134393b453b34323b3234303b3330362e3030303030303b32313b302e3630303030303b4e413b4e413b4e413b4e413b7072696f723a313a302c6576656e745f696f5f69643a313a302c746f74616c5f696f3a313a32352c696f5f3233393a313a312c696f5f3234303a313a312c696f5f38303a313a312c67736d3a313a352c696f5f32313a313a352c696f5f3230303a313a302c696f5f36393a313a312c696f5f313a313a312c696f5f3137393a313a302c696f5f3131333a313a39332c70646f703a323a312e3130303030302c696f5f3138313a313a31312c696f5f3138323a313a362c7077725f6578743a323a31332e3530343030302c696f5f36363a313a31333530342c696f5f32343a313a34322c63656c6c5f69643a313a333337352c696f5f3230353a313a333337352c6c61633a313a35333930322c696f5f3230363a313a35333930322c7077725f696e743a323a342e3033383030302c696f5f36373a313a343033382c696f5f36383a313a302c696f5f393a313a31323331382c696f5f31373a313a36353437352c696f5f31383a313a36353531372c696f5f31393a313a38322c696f5f32353a323a3330302e3030303030302c6d63633a313a3235352c6d6e633a313a362c696f5f3234313a313a32353530362c696f5f3139393a313a373736312c696f5f31363a313a3130323034363731320d0a2344233036303932333b3134343732393b343935302e373737383b4e3b30323335392e333330343b453b33303b3234303b3330372e3030303030303b32313b302e3630303030303b4e413b4e413b4e413b4e413b7072696f723a313a302c6576656e745f696f5f69643a313a302c746f74616c5f696f3a313a32352c696f5f3233393a313a312c696f5f3234303a313a312c696f5f38303a313a312c67736d3a313a352c696f5f32313a313a352c696f5f3230303a313a302c696f5f36393a313a312c696f5f313a313a312c696f5f3137393a313a302c696f5f3131333a313a39322c70646f703a323a312e3230303030302c696f5f3138313a313a31322c696f5f3138323a313a362c7077725f6578743a323a31332e3438353030302c696f5f36363a313a31333438352c696f5f32343a313a33302c63656c6c5f69643a313a333337352c696f5f3230353a313a333337352c6c61633a313a35333930322c696f5f3230
2023-09-06 17:47:51 ERROR: LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
Recent access records: 
Created at:
        io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:403)
        io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188)
        io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:179)
        io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:116)
        io.netty.buffer.ByteBufUtil.encodeString0(ByteBufUtil.java:1242)
        io.netty.buffer.ByteBufUtil.encodeString(ByteBufUtil.java:1217)
        io.netty.handler.codec.string.StringEncoder.encode(StringEncoder.java:77)
        io.netty.handler.codec.string.StringEncoder.encode(StringEncoder.java:52)
        io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:90)
        org.traccar.WrapperOutboundHandler.write(WrapperOutboundHandler.java:72)
        io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881)
        io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863)
        io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968)
        io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856)
        io.netty.channel.ChannelOutboundHandlerAdapter.write(ChannelOutboundHandlerAdapter.java:113)
        org.traccar.BaseProtocolEncoder.write(BaseProtocolEncoder.java:97)
        io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881)
        io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:940)
        io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:966)
        io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:934)
        io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:984)
        io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1025)
        io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:306)
        org.traccar.protocol.WialonProtocolDecoder.sendResponse(WialonProtocolDecoder.java:80)
        org.traccar.protocol.WialonProtocolDecoder.decode(WialonProtocolDecoder.java:197)
        org.traccar.ExtendedObjectDecoder.channelRead(ExtendedObjectDecoder.java:75)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        org.traccar.WrapperContext.fireChannelRead(WrapperContext.java:102)
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        org.traccar.WrapperInboundHandler.channelRead(WrapperInboundHandler.java:57)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        org.traccar.WrapperContext.fireChannelRead(WrapperContext.java:102)
        io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
        io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:333)
        io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:454)
        io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
        org.traccar.WrapperInboundHandler.channelRead(WrapperInboundHandler.java:57)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)
        org.traccar.handler.StandardLoggingHandler.channelRead(StandardLoggingHandler.java:44)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        org.traccar.handler.NetworkMessageHandler.channelRead(NetworkMessageHandler.java:37)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
        io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
        io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
        io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
        io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
        io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
        io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
        io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        java.base/java.lang.Thread.run(Thread.java:833)

I have found stacktrace around error (IP was hidden)

Anton Tananaeva year ago

It doesn't look like it's related to Teltonika or OsmAnd. Waiting for explanation.

Andrii Hondaa year ago

Yes, I have found this error for Wialon IPS/Retranslator protocol. Also, I tried to find any errors or records to problem devices by uniqueId records, but after upgrade time to next version from 5.6 -> 5.7 Traccar did not register any messages from the Teltonika FMB001 device. Only after the downgrading of the version to 5.6, any messages from this device Traccar start to register in the database and logs.

Anton Tananaeva year ago

I would recommend doing proper troubleshooting first.

I can also tell you that it's very unlikely that Teltonika or OsmAnd are completely broken. We would know about it by now. There would be tens if not hundreds of threads on the forum of people complaining about it.