Server 6.4. positions not recorded (device freeze issue)

Victor Butler2 months ago

Any specific handlers to recommend? For me right now is like shooting in the dark.

Anton Tananaev2 months ago

Just put a log in every class that extends BasePositionHandler.

Victor Butler2 months ago

Now we are talking. Thanks. Will try and let you know what I find out.

Victor Butler2 months ago

So, we've got some progress.
While waiting to get the new logger data, I made a deeper analysis of the log files - I tried to find the first data record which causes the device freeze issue. To my surprise there was also an error record, which I initially missed because it was with INFO instead of WARN tag.

So for all freezing devices (that I analyzed), we get this error, after which no more data for this device is recorded in the positions table:

INFO: [U1f1dacbd] error - Index 1 out of bounds for length 1 - ArrayIndexOutOfBoundsException (NotificatorFirebase:118 < Notificator:39 < NotificationManager:140 < ... < *:133 < ... < *:132 < *:177 < ProcessingHandler:191 < ...)

Does this indicate an issue with firebase, the incoming HEX or with the protocol decoder?

Anton Tananaev2 months ago

This error seems to indicate that you're not using the official code. Here's the line in the official version:

https://github.com/traccar/traccar/blob/v6.4/src/main/java/org/traccar/notificators/NotificatorFirebase.java#L118

It cannot generate this exception. There's also try-catch, which should handle it.

Victor Butler2 months ago

I have modified and non modified 6.4 servers and there are freezing devices on both. I have deeply analyzed only the logs on the modified version assuming it's the same root cause. Need to check the logs from the non modified one.

On a side note, I have also modified the short templates on both servers. The error might lie there, I need add additional loggers and verify.

Another thing I noticed is that before the error appears, the server logs an event entry like this:

2024-09-11 01:54:48  INFO: Event id: 12345678912345, time: 2024-09-11 01:54:48, type: alarm, notifications: 2

What does notifications: 2 mean? Similar alarm events that have notifications: 1 do not generate errors.

Anton Tananaev2 months ago

The number means a number of notifications for this event.

Victor Butler2 months ago

Number of notifications like sending the notification to two different notification tokens?

Anton Tananaev2 months ago

No, two notification instances.

Victor Butler2 months ago

I am not sure I follow, why would an event generate more than one notification instance?

Anton Tananaev2 months ago

You can configure any number of notifications for an event type.

Victor Butler2 months ago

Right, so for example if two users configure notification for ignitionOn on the same device, then there will be two notification instances for that event. Got it. Thanks for clarifying!

Anton Tananaev2 months ago
Victor Butler2 months ago

Ok will amend the code and test it. I had a brief look only but what this change does is basically a try/catch aiming to log any exceptions as warn messages, right?

Anton Tananaev2 months ago

Any updates on this?