You're likely missing some referenced objects in the database.
here is the full stack trace:
12:5055\r\nConnection: keep-alive\r\nAccept: */*\r\nUser-Agent: TraccarClient/60 CFNetwork/3826.500.111.2.2 Darwin/24.4.0\r\nAccept-Language: de-DE,de;q=0.9\r\nContent-Length: 0\r\nAccept-Encoding: gzip, deflate\r\n\r\n
2025-04-23 13:48:32 DEBUG: Event received
2025-04-23 13:48:32 WARN: [Tdb36e8ed] error -
java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "object" is null
at org.traccar.session.cache.CacheKey.<init>(CacheKey.java:22)
at org.traccar.session.cache.CacheGraph.addLink(CacheGraph.java:95)
at org.traccar.session.cache.CacheManager.invalidatePermission(CacheManager.java:291)
at org.traccar.session.cache.CacheManager.initializeCache(CacheManager.java:317)
at org.traccar.session.cache.CacheManager.addDevice(CacheManager.java:164)
at org.traccar.session.ConnectionManager.getDeviceSession(ConnectionManager.java:157)
at org.traccar.BaseProtocolDecoder.getDeviceSession(BaseProtocolDecoder.java:135)
at org.traccar.protocol.OsmAndProtocolDecoder.decode(OsmAndProtocolDecoder.java:70)
at org.traccar.ExtendedObjectDecoder.channelRead(ExtendedObjectDecoder.java:73)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at org.traccar.WrapperContext.fireChannelRead(WrapperContext.java:102)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:107)
at org.traccar.WrapperInboundHandler.channelRead(WrapperInboundHandler.java:56)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at org.traccar.WrapperContext.fireChannelRead(WrapperContext.java:102)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
at org.traccar.WrapperInboundHandler.channelRead(WrapperInboundHandler.java:56)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)
at org.traccar.handler.network.StandardLoggingHandler.channelRead(StandardLoggingHandler.java:62)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at org.traccar.handler.network.NetworkMessageHandler.channelRead(NetworkMessageHandler.java:36)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
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:840)
2025-04-23 13:48:32 INFO: [Tdb36e8ed] disconnected
any idea how to proceed?
You need to find the device in the database, then follow all the linked objects, including the ones linked through groups and users, and find which links are leading to missing objects.
ok I was able to fix it here. for the record, the issue was the tc_user_device
table:
SELECT * FROM tc_user_device
WHERE deviceid = 3 AND userid NOT IN (SELECT id FROM tc_users);
this should not ouput anything. In my case the it did:
userid deviceid
2 3
then I deleted the entry:
DELETE FROM tc_user_device
WHERE deviceid = 3 AND userid = 2;
okay I run into another issue: The old data seems okay, but if I connect my devices I can see an error like this: