Traccar v6.14.4 failed to decode coordinates while CLOSE-WAIT large

Tommy 16 hours ago

Hi,

I found some issue at traccar v6.14.4 when the devices larger than 500 (currently more than 2000 devices).

below are the command to check the CLOSE-WAIT

# ss -tnp | grep java | awk '{print $1}' | sort | uniq -c
  63419 CLOSE-WAIT
   1491 ESTAB

When the CLOSE-WAIT become large like that, traccar just process authentication message only but not do decode process, it make the new positions not filled into tc_positions.

I check using jstack, if block at below

"multiThreadIoEventLoopGroup-3-11" #50 [16324] prio=10 os_prio=0 cpu=1632.74ms elapsed=1047.83s tid=0x00007fcbcc0188d0 nid=16324 waiting for monitor entry  [0x00007fcc403f7000]
   java.lang.Thread.State: BLOCKED (on object monitor)
at org.traccar.session.cache.CacheManager.addDevice(CacheManager.java:136)
- waiting to lock <0x000000050171a6c8> (a org.traccar.session.cache.CacheManager)
at org.traccar.session.ConnectionManager.getDeviceSession(ConnectionManager.java:174)
at org.traccar.BaseProtocolDecoder.getDeviceSession(BaseProtocolDecoder.java:135)
at org.traccar.protocol.Gt06ProtocolDecoder.decodeBasic(Gt06ProtocolDecoder.java:502)
at org.traccar.protocol.Gt06ProtocolDecoder.decode(Gt06ProtocolDecoder.java:1624)
at org.traccar.ExtendedObjectDecoder.channelRead(ExtendedObjectDecoder.java:72)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at org.traccar.WrapperContext.fireChannelRead(WrapperContext.java:102)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:361)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:348)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:470)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at org.traccar.WrapperInboundHandler.channelRead(WrapperInboundHandler.java:56)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)
at org.traccar.handler.network.StandardLoggingHandler.channelRead(StandardLoggingHandler.java:70)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at org.traccar.handler.network.NetworkMessageHandler.channelRead(NetworkMessageHandler.java:36)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:288)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1429)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:176)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.handle(AbstractNioChannel.java:445)
at io.netty.channel.nio.NioIoHandler$DefaultNioRegistration.handle(NioIoHandler.java:388)
at io.netty.channel.nio.NioIoHandler.processSelectedKey(NioIoHandler.java:596)
at io.netty.channel.nio.NioIoHandler.processSelectedKeysPlain(NioIoHandler.java:541)
at io.netty.channel.nio.NioIoHandler.processSelectedKeys(NioIoHandler.java:514)
at io.netty.channel.nio.NioIoHandler.run(NioIoHandler.java:484)
at io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:225)
at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:196)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1195)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.runWith(java.base@25.0.3/Thread.java:1487)
at java.lang.Thread.run(java.base@25.0.3/Thread.java:1474)

Below are my traccar.xml config

    <entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://xxx:3306/solusitrack_db?serverTimezone=Asia/Jakarta&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
    <entry key='database.user'>xxx</entry>
    <entry key='database.password'>xxx</entry>

    <entry key='database.maxPoolSize'>30</entry>
    <entry key='database.minIdle'>10</entry>
    <entry key='database.maxLifetime'>300000</entry>
    <entry key='database.connectionTimeout'>30000</entry>
    <entry key='database.keepaliveTime'>60000</entry>
    <entry key='database.positionBatchInterval'>2000</entry>
    <entry key='database.positionBatchSize'>1000</entry>
    <entry key='database.throttleUnknown'>true</entry>

    <entry key='server.nettyThreads'>32</entry>
    <entry key='server.nettyBossThreads'>2</entry>
    <entry key='server.buffering.threshold'>0</entry>
    <entry key='server.timeout'>1800</entry>
    <entry key='server.delayAcknowledgement'>true</entry>

    <entry key='protocols.enable'>teltonika,gt06,h02,osmand,meitrack,meiligao,jt808</entry>

    <!-- NOTIFICATION CONFIG -->
    <entry key='notificator.types'>web,telegram</entry>

    <entry key='notificator.telegram.key'>xxx</entry>
    <entry key='notificator.telegram.chatId'>-xxx</entry>

    <!-- GEOCODER CONFIG -->
    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>nominatim</entry>
    <entry key='geocoder.url'>http://84.xxxx/reverse</entry>
    <entry key='geocoder.key'>xxxx</entry>
    <entry key='geocoder.language'>id</entry>
    <entry key='geocoder.format'>%f</entry>
    <entry key='geocoder.onRequest'>false</entry>
    <entry key='geocoder.ignorePositions'>false</entry>

    <entry key='logger.level'>all</entry>
    <entry key='logger.rotate'>true</entry>

    <entry key='filter.enable'>false</entry>
    <entry key='filter.future'>86400</entry>
    <entry key='filter.zero'>false</entry>
    <entry key='filter.invalid'>false</entry>
    <entry key='filter.duplicate'>false</entry>
    <entry key='filter.outdated'>false</entry>
    <entry key='filter.relative'>false</entry>

    <entry key='event.enable'>false</entry>
    <entry key='event.ignoreDuplicateAlerts'>true</entry>

My VPS spec are
Traccar

  • 6 vCPU
  • 16Gb RAM

MySQL

  • 12 vCPU
  • 48Gb RAM

can anybody kindly advice?

Anton Tananaev 16 hours ago

Are you sure it's 6.14.4 and not 6.14.3?

Tommy 16 hours ago

yes, its 6.14.4

# grep -ri "Version:" /opt/traccar/logs/
grep: /opt/traccar/logs/tracker-server.log: binary file matches
/opt/traccar/logs/tracker-server.log.20260605:2026-06-05 17:44:55  INFO: Operating system name: Linux version: 5.15.0-97-generic architecture: amd64
/opt/traccar/logs/tracker-server.log.20260605:2026-06-05 17:44:55  INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: Eclipse Adoptium version: 25.0.3+9-LTS
/opt/traccar/logs/tracker-server.log.20260605:2026-06-05 17:44:55  INFO: Version: 6.14.4
/opt/traccar/logs/tracker-server.log.20260605:2026-06-05 17:45:14 DEBUG: Java version: 25
Anton Tananaev 15 hours ago

I recommend checking database queue.

Tommy 13 hours ago

I found out the issue is at CacheManager.java at addDevice and removeDevice portion.

When many device goes in after restart, it block the process.

After i modify the function and rebuild the tracker-server.jar the decode back to normal now.

Anton Tananaev 4 hours ago

What was the modification?

Victor Butler 4 hours ago

Can you share your custom function for CacheManager.java ?