Device State frozen in time, after receiving corrupted date/time stamp

marc8 years ago

The tracker icon was moving on the map this morning but then it froze and stayed in the same location all day. During the rest of the day the tracker continued to send valid locations but the server didn't display any further vehicle movement.

It seems the server only notices locations that have a later time stamp than the latest received, and ignores any earlier time stamped data.

I would guess there's no 'feasibility validation' of timestamp implemented in the server.

Here's the messages that caused it: (with the corruption highlighted)

imei:359710040103591,tracker,1704100949,,F,084957.000,A,5154.4237,N,00027.4776,W,0.04,72.08;
imei:359710040103591,tracker,1704100950,,F,085057.000,A,5154.4218,N,00027.4789,W,0.33,183.07;
imei:359710040103591,tracker,7028290952,,F,085201.000,A,5154.4159,N,00027.4775,W,1.37,102.67;
imei:359710040103591,tracker,1704100952,,F,085257.000,A,5154.6020,N,00027.9301,W,27.65,314.67;

And the transcript in full:

2017-04-10 09:53:07 DEBUG: [1EA80277: 11675 < 82.132.236.142] HEX: 696d65693a3335393731303034303130333539312c747261636b65722c313730343130303934392c2c462c3038343935372e3030302c412c353135342e343233372c4e2c30303032372e343737362c572c302e30342c37322e30383b
2017-04-10 09:53:07  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2017-04-10 09:53:07  INFO: [1EA80277] id: 359710040103591, time: 2017-04-10 09:49:57, lat: 51.90706, lon: -0.45796, speed: 0.0, course: 72.1
2017-04-10 09:53:51 DEBUG: [1EA80277: 11675 < 82.132.236.142] HEX: 3335393731303034303130333539313b
2017-04-10 09:53:51 DEBUG: [1EA80277: 11675 > 82.132.236.142] HEX: 4f4e
2017-04-10 09:54:07 DEBUG: [1EA80277: 11675 < 82.132.236.142] HEX: 696d65693a3335393731303034303130333539312c747261636b65722c313730343130303935302c2c462c3038353035372e3030302c412c353135342e343231382c4e2c30303032372e343738392c572c302e33332c3138332e30373b
2017-04-10 09:54:07  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2017-04-10 09:54:07  INFO: [1EA80277] id: 359710040103591, time: 2017-04-10 09:50:57, lat: 51.90703, lon: -0.45798, speed: 0.3, course: 183.1
2017-04-10 09:55:07 DEBUG: [1EA80277: 11675 < 82.132.236.142] HEX: 696d65693a3335393731303034303130333539312c747261636b65722c373032383239303935322c2c462c3038353230312e3030302c412c353135342e343135392c4e2c30303032372e343737352c572c312e33372c3130322e36373b
2017-04-10 09:55:07  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2017-04-10 09:55:07  INFO: [1EA80277] id: 359710040103591, time: 2072-04-29 09:52:01, lat: 51.90693, lon: -0.45796, speed: 1.4, course: 102.7
2017-04-10 09:55:19 DEBUG: [1EA80277: 11675 < 82.132.236.142] HEX: 3335393731303034303130333539313b
2017-04-10 09:55:19 DEBUG: [1EA80277: 11675 > 82.132.236.142] HEX: 4f4e
2017-04-10 09:56:06 DEBUG: [1EA80277: 11675 < 82.132.236.142] HEX: 696d65693a3335393731303034303130333539312c747261636b65722c313730343130303935322c2c462c3038353235372e3030302c412c353135342e363032302c4e2c30303032372e393330312c572c32372e36352c3331342e36373b
2017-04-10 09:56:06  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2017-04-10 09:56:06  INFO: [1EA80277] id: 359710040103591, time: 2017-04-10 09:52:57, lat: 51.91003, lon: -0.46550, speed: 27.7, course: 314.7
2017-04-10 09:56:49 DEBUG: [1EA80277: 11675 < 82.132.236.142] HEX: 3335393731303034303130333539313b
2017-04-10 09:56:49 DEBUG: [1EA80277: 11675 > 82.132.236.142] HEX: 4f4e
2017-04-10 09:58:06 DEBUG: [1EA80277: 11675 < 82.132.236.142] HEX: 696d65693a3335393731303034303130333539312c747261636b65722c313730343130303935342c2c462c3038353435372e3030302c412c353135352e323937302c4e2c30303032382e343830372c572c31322e31362c3236342e32393b
2017-04-10 09:58:06  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2017-04-10 09:58:06  INFO: [1EA80277] id: 359710040103591, time: 2017-04-10 09:54:57, lat: 51.92162, lon: -0.47468, speed: 12.2, course: 264.3

It's my guess normal operation will resume after the year 2072!

Anton Tananaev8 years ago

Your guess is correct. Because the time of invalid record is in future, Traccar considers it to be the "lastest" update.

To fix the problem you would have to re-create the device, or manually remove invalid data from the database.

If your device regularly reports such data, you can enable filtering in the server config to ignore messages with future time.

marc8 years ago

If my assumptions are correct, then I guess the server needs to ignore a received message as 'invalid' if the embedded Timestamp differs by the Timestamp of the data packet by more than X amount of time. And send a WARN to tracker-server.log. The 'X' could be defined in the default.xml I hope this helps.

marc8 years ago

Our posts just crossed.

If I filter out messages with future time, won't that stop any future location updates being received?

marc8 years ago
manually remove invalid data from the database.

Where would I find this data?

Anton Tananaev8 years ago

Filtering works exactly like you described in your comment.

To manually remove it from the database, you need to remove it from positions table first and then remove reference to it from the devices table. Don't forget to restart the service after doing the changes.

marc8 years ago

I´ll look at Filtering later.

My attempt to surgically remove invalid data has failed. I've been trying to edit the raw database.mv.db with a .TXT editor (after stopping the service). I´d searched for strings "7028290952", "2072-04-29" both in ascii and hex. Couldn´t find anything matching. I´m a bit wary of hand-editing a .db file in case I break it.

I don't understand "positions table", "devices table"

Anton Tananaev8 years ago

Why would you use a text editor to edit database? You would almost definitely break something. You need to use a proper JDBC database editor for it.

marc8 years ago

Because you suggested it!

manually remove invalid data from the database

I picked up my nearest textfile editor but neither string “7028290952”, “2072-04-29” was found.

What's a JDBC database editor?

Anton Tananaev8 years ago

I didn't suggest to use text editor for it. I guess this option is not for you. You need some technical expertise to do it.

marc8 years ago

OK, until I have the required technical expertise I can't manually remove invalid data from the database. So to resolve the problem I'm left with the other option you mentioned earlier:

Anton:

enable filtering in the server config to ignore messages with future time.

OK

Anton:

Filtering works exactly like you described in your comment.

in response to..
Marc:
I guess the server needs to ignore a received message as ‘invalid’ if the embedded Timestamp differs by the Timestamp of the data packet by more than X amount of time. And send a WARN to tracker-server.log. The ‘X’ could be defined in the default.xml

Question: Is this filtering implemented in Traccar?

If so, how is it enabled? I can't yet find anything relating to this in the default.xml config. I presume when active a WARN message gets written to Log.

Anton Tananaev8 years ago
marc8 years ago

I found in above page the 7 keys: filter.xxxxx They seem to be what I'm looking for.

However none of these keys appear in my C:\Program Files\Traccar\conf\default.xml

Maybe they were omitted from the default.xml?

Should these keys be added to the traccar.xml (or any other user custom config)?

Anton Tananaev8 years ago

You have to add the keys that you need to traccar.xml file.

marc8 years ago

So this filtering is not a standard feature of Traccar?

If it's required to be added as a custom feature a How-To guide is required. If I post this here on this thread myself then be aware it may be some time before I work it out, because I will need to test it works first with an emulation tracker to simulate corrupt data.