Wrong identifier in Logs

depth750310 days ago

I have an issue that I likely caused and I was wondering if someone could give me some pointers.

Other than in the logs, I believe Traccar is recording correctly (position history supports this for each device), however in the Logs page I'm seeing positions come in under the wrong device identifier. See screenshot below.

It's only one device, and so far it appears limited to just the logs page.

2025-11-24-1eDESLmVp5.png

Background info is that I previously ran Traccar with the default database until a 5-6 months ago when I migrated to Timescale DB. That took a little work, but I got it going. A couple weeks ago I added a second device, all good. A few days ago I tried adding two devices and I was getting ERROR: duplicate key value violates unique constraint "tc_devices_pkey" when I try to add a new device.

I got that fixed with a little help (SELECT setval(pg_get_serial_sequence('tc_devices','id'), COALESCE((SELECT MAX(id) FROM tc_devices), 1));) and both new devices added without error. All appeared well.

Today I was checking logs and noticed that one device (mine, the original) is showing up in the logs with the Identifier of the 4th device. That 4th device also shows in the logs with its correct Identifier.

I checked Timescale DB and the position is correctly added to the right deviceid on the tc_positions table.

Any ideas where to look to track down my mistake (assuming it's my mistake). Thank you!

Anton Tananaev10 days ago

You should check real server logs to see if those devices are potentially reporting via the same network connection.

depth75039 days ago

I'll do that. (this morning, at a glance on the logs page my device is now correctly reporting).

Would I be looking for the IP to tell if it's the same connection? They're all sending positions via a Cloudflare Tunnel, and even without that they do connect from the same ISP connection when they're at homebase.

Anton Tananaev9 days ago

Connection id is in the square brackets in the log.

depth7503an hour ago

Hi Anton,

You were right on that. It does appear some of the reports are showing as the same connection in the tracker-server.log log file. Do you have any suggestions?

Fixing the logs is more an OCD thing, however I am having an issue where occasionally the actual position of <DEVICE 3> will be up to 30 minutes behind, and toggling "continuous" or "send location" result in HTTP posts in the client log and receipt of new correct locations on the Server > Reports > Logs page, however the actual position on the server doesn't change. Sometimes it'll seem to process the next old position, and eventually it catches up... I've had the Reports>Logs window up while I'm debugging this and I only saw 5-10 reports come in for 3 active devices, however the position of <DEVICE 3> has moved about 80 positions and is still 60 minutes behind. Does the server have some queue where these might be in limbo?

Here's an excerpt:

  • You'll see the first report on a new connection [T4c457479] with <DEVICE ID 1> on line 2. With <DEVICE 3> under a different connection [T83b418c4] on Line 3.
  • On line 10 and 11 we see <DEVICE 3> reporting under the new connection [T4c457479: osmand < 10.100.11.1] (is it ok for it to be broken across two lines?).
  • On 16,24,26,28 we have <DEVICE 3> reporting under its original connection.
  • I wouldn't think so, but would the speed limit provider errors lead to the delays in position processing?
1: --  2025-12-04 16:44:56  INFO: [T4c457479] connected
2: --  2025-12-04 16:44:56  INFO: [T4c457479: osmand < 10.100.11.1] POST / HTTP/1.1\r\nHost: traccarclient.URL.COM\r\nUser-Agent: okhttp/3.12.13\r\nContent-Length: 423\r\nAccept-Encoding: gzip, br\r\nCdn-Loop: cloudflare; loops=1\r\nCf-Connecting-Ip: <CONNECTING IP 1>\r\nCf-Ipcountry: US\r\nCf-Ray: <CF RAY 4>\r\nCf-Visitor: {"scheme":"https"}\r\nCf-Warp-Tag-Id: <WARP TAG ID>\r\nConnection: keep-alive\r\nContent-Type: application/json; charset=utf-8\r\nX-Forwarded-For: <CONNECTING IP 1>\r\nX-Forwarded-Proto: https\r\n\r\n{"location":{"timestamp":"2025-12-04T16:44:34.232Z","coords":{"latitude":<COORDINATES>,"longitude":<COORDINATES>,"accuracy":12.19,"speed":-1,"heading":-1,"altitude":19.3},"is_moving":false,"odometer":1326027.9,"battery":{"level":0.55,"is_charging":false},"activity":{"type":"still"},"extras":{},"_":"&id=<DEVICE ID 1>&lat=<COORDINATES>&timestamp=2025-12-04T16:44:34.232Z&","heartbeat":true},"device_id":"<DEVICE ID 1>"}
3: --  2025-12-04 16:44:57  INFO: [T4c457479: osmand > 10.100.11.1] HTTP/1.1 200 OK\r\ncontent-length: 0\r\n\r\n
4: --  2025-12-04 16:45:07  WARN: Speed limit provider failed - Not found - SpeedLimitException (OverpassSpeedLimitProvider:68 < *:55 < ...)
5: --  2025-12-04 16:45:07  INFO: [T83b418c4] id: <DEVICE ID 3>, time: 2025-12-04 15:55:10, lat: <COORDINATES>, speed: 35.7, course: 149.0, accuracy: 16.2
6: --  2025-12-04 16:45:29  WARN: Speed limit provider failed - Not found - SpeedLimitException (OverpassSpeedLimitProvider:68 < *:55 < ...)
7: --  2025-12-04 16:45:29  INFO: [T83b418c4] id: <DEVICE ID 3>, time: 2025-12-04 15:55:11, lat: <COORDINATES>, speed: 32.1, course: 156.0, accuracy: 15.1
8: --  2025-12-04 16:45:58  WARN: Speed limit provider failed - MessageBodyReader not found for media type=text/html;charset=utf-8, type=interface jakarta.json.JsonObject, genericType=interface jakarta.json.JsonObject. - MessageBodyProviderNotFoundException (...)
9: --  2025-12-04 16:45:59  INFO: [T4c457479] id: <DEVICE ID 1>, time: 2025-12-04 16:44:34, lat: <COORDINATES>, lon: <COORDINATES>2, course: 0.0
10: --  2025-12-04 16:46:17  INFO: [T4c457479: osmand < 10.100.11.1] POST / HTTP/1.1\r\nHost: traccarclient.URL.COM\r\nUser-Agent: okhttp/3.12.13\r\nContent-Length: 413\r\nAccept-Encoding: gzip, br\r\nCdn-Loop: cloudflare; loops=1\r\nCf-Connecting-Ip: <CONNECTING IP2>\r\nCf-Ipcountry: US\r\nCf-Ray: <CF RAY 3>\r\nCf-Visitor: {"scheme":"https"}\r\nCf-Warp-Tag-Id: <WARP TAG ID>\r\nConnection: keep-alive\r\nContent-Type: application/json; charset=utf-8\r\nX-Forwarded-For: <CONNECTING IP2>\r\nX-Forwarded-Proto: https\r\n\r\n
11: --  2025-12-04 16:46:17  INFO: [T4c457479: osmand < 10.100.11.1] {"location":{"timestamp":"2025-12-04T16:45:46.202Z","coords":{"latitude":<COORDINATES>,"longitude":<COORDINATES>>,"accuracy":392.37,"speed":-1,"heading":-1,"altitude":26.12},"is_moving":false,"odometer":12292625,"battery":{"level":0.72,"is_charging":false},"activity":{"type":"still"},"extras":{},"_":"&id=<DEVICE ID 3>&lat=<COORDINATES>&timestamp=2025-12-04T16:45:46.202Z&","manual":true},"device_id":"<DEVICE ID 3>"}
12: --  2025-12-04 16:46:17  INFO: [T4c457479: osmand > 10.100.11.1] HTTP/1.1 200 OK\r\ncontent-length: 0\r\n\r\n
13: --  2025-12-04 16:46:41  INFO: [T4c457479: osmand < 10.100.11.1] POST / HTTP/1.1\r\nHost: traccarclient.URL.COM\r\nUser-Agent: okhttp/3.12.13\r\nContent-Length: 413\r\nAccept-Encoding: gzip, br\r\nCdn-Loop: cloudflare; loops=1\r\nCf-Connecting-Ip: <CONNECTING IP2>\r\nCf-Ipcountry: US\r\nCf-Ray: <CF RAY 2>\r\nCf-Visitor: {"scheme":"https"}\r\nCf-Warp-Tag-Id: <WARP TAG ID>\r\nConnection: keep-alive\r\nContent-Type: application/json; charset=utf-8\r\nX-Forwarded-For: <CONNECTING IP2>\r\nX-Forwarded-Proto: https\r\n\r\n{"location":{"timestamp":"2025-12-04T16:45:46.202Z","coords":{"latitude":<COORDINATES>,"longitude":<COORDINATES>,"accuracy":392.37,"speed":-1,"heading":-1,"altitude":26.12},"is_moving":false,"odometer":12292625,"battery":{"level":0.71,"is_charging":false},"activity":{"type":"still"},"extras":{},"_":"&id=<DEVICE ID 3>&lat=<COORDINATES>&timestamp=2025-12-04T16:45:46.202Z&","manual":true},"device_id":"<DEVICE ID 3>"}
14: --  2025-12-04 16:46:41  INFO: [T4c457479: osmand > 10.100.11.1] HTTP/1.1 200 OK\r\ncontent-length: 0\r\n\r\n
15: --  2025-12-04 16:46:50  WARN: Speed limit provider failed - Not found - SpeedLimitException (OverpassSpeedLimitProvider:68 < *:55 < ...)
16: --  2025-12-04 16:46:50  INFO: [T83b418c4] id: <DEVICE ID 3>, time: 2025-12-04 15:55:16, lat: <COORDINATES>, lon: <COORDINATES>, speed: 33.5, course: 145.0, accuracy: 15.0
17: --  2025-12-04 16:47:13  INFO: [T4c457479: osmand < 10.100.11.1] POST / HTTP/1.1\r\nHost: traccarclient.URL.COM\r\nUser-Agent: okhttp/3.12.13\r\nContent-Length: 420\r\nAccept-Encoding: gzip, br\r\nCdn-Loop: cloudflare; loops=1\r\nCf-Connecting-Ip: <FORWARDED FOR IP>\r\nCf-Ipcountry: US\r\nCf-Ray: 9a8cc8ccea7ee8ef-LAX\r\nCf-Visitor: {"scheme":"https"}\r\nCf-Warp-Tag-Id: <WARP TAG ID>\r\nConnection: keep-alive\r\nContent-Type: application/json; charset=utf-8\r\nX-Forwarded-For: <FORWARDED FOR IP>\r\nX-Forwarded-Proto: https\r\n\r\n{"location":{"timestamp":"2025-12-04T16:47:02.356Z","coords":{"latitude":<COORDINATES>,"longitude":<COORDINATES>,"accuracy":13.31,"speed":-1,"heading":-1,"altitude":17.7},"is_moving":false,"odometer":985294,"battery":{"level":0.93,"is_charging":false},"activity":{"type":"still"},"extras":{},"_":"&id=<DEVICE ID 2>&lat=<COORDINATES>&lon=<COORDINATES>&timestamp=2025-12-04T16:47:02.356Z&","heartbeat":true},"device_id":"<DEVICE ID 2>"}
18: --  2025-12-04 16:47:13  INFO: [T4c457479: osmand > 10.100.11.1] HTTP/1.1 200 OK\r\ncontent-length: 0\r\n\r\n
19: --  2025-12-04 16:47:23  INFO: [T4c457479: osmand < 10.100.11.1] POST / HTTP/1.1\r\nHost: traccarclient.URL.COM\r\nUser-Agent: okhttp/3.12.13\r\nContent-Length: 416\r\nAccept-Encoding: gzip, br\r\nCdn-Loop: cloudflare; loops=1\r\nCf-Connecting-Ip: <CONNECTING IP2>\r\nCf-Ipcountry: US\r\nCf-Ray: <CF RAY>\r\nCf-Visitor: {"scheme":"https"}\r\nCf-Warp-Tag-Id: <WARP TAG ID>\r\nConnection: keep-alive\r\nContent-Type: application/json; charset=utf-8\r\nX-Forwarded-For: <CONNECTING IP2>\r\nX-Forwarded-Proto: https\r\n\r\n{"location":{"timestamp":"2025-12-04T16:46:46.229Z","coords":{"latitude":<COORDINATES>,"longitude":<COORDINATES>,"accuracy":392.37,"speed":-1,"heading":-1,"altitude":26.12},"is_moving":false,"odometer":12292625,"battery":{"level":0.71,"is_charging":false},"activity":{"type":"still"},"extras":{},"_":"&id=<DEVICE ID 3>&lat=<COORDINATES>>&timestamp=2025-12-04T16:46:46.229Z&","heartbeat":true},"device_id":"<DEVICE ID 3>"}
20: --  2025-12-04 16:47:23  INFO: [T4c457479: osmand > 10.100.11.1] HTTP/1.1 200 OK\r\ncontent-length: 0\r\n\r\n
21: --  2025-12-04 16:47:30  WARN: Speed limit provider failed - Not found - SpeedLimitException (OverpassSpeedLimitProvider:68 < *:55 < ...)
22: --  2025-12-04 16:47:30  INFO: [T4c457479] id: <DEVICE ID 2>, time: 2025-12-04 16:47:02, lat: <COORDINATES>, lon: <COORDINATES>, course: 0.0
23: --  2025-12-04 16:47:50  WARN: Speed limit provider failed - MessageBodyReader not found for media type=text/html;charset=utf-8, type=interface jakarta.json.JsonObject, genericType=interface jakarta.json.JsonObject. - MessageBodyProviderNotFoundException (...)
24: --  2025-12-04 16:47:50  INFO: [T83b418c4] id: <DEVICE ID 3>, time: 2025-12-04 15:55:22, lat: <COORDINATES>, lon: <COORDINATES>, speed: 32.4, course: 101.0, accuracy: 15.0
25: --  2025-12-04 16:48:30  WARN: Speed limit provider failed - MessageBodyReader not found for media type=text/html;charset=utf-8, type=interface jakarta.json.JsonObject, genericType=interface jakarta.json.JsonObject. - MessageBodyProviderNotFoundException (...)
26: --  2025-12-04 16:48:30  INFO: [T83b418c4] id: <DEVICE ID 3>, time: 2025-12-04 15:55:27, lat: <COORDINATES>, lon: <COORDINATES>, speed: 33.3, course: 62.0, accuracy: 13.8
27: --  2025-12-04 16:48:37  WARN: Speed limit provider failed - Not found - SpeedLimitException (OverpassSpeedLimitProvider:68 < *:55 < ...)
28: --  2025-12-04 16:48:37  INFO: [T83b418c4] id: <DEVICE ID 3>, time: 2025-12-04 15:55:33, lat: <COORDINATES>, lon: <COORDINATES>, speed: 33.9, course: 64.0, accuracy: 10.6
29: --  2025-12-04 16:48:53  INFO: [T4c457479] disconnected

Server Version - 6.10.0
Android Client - 9.6.4

Thanks for any help Anton.

P.S. Forgot to mention that I've only observed it being <DEVICE 3> that is reporting under the wrong identifier in the logs, but that may just be a bias because that's my device and I'm aware of it's timing. Also, the timing thing is not consistent. Sometimes everything is up to date within seconds as designed.

Anton Tananaev14 minutes ago

As long as the device id included in every message, it shouldn't be a problem that the connection is reused.

So which one of these logs is decoded with the wrong device id?