OSMAnd Protocol Causes Crash

moonship 21 days ago

Hi,

I've been using Traccar for many years and recently deployed another instance, this time using version 6.15.3 and a MySQL DB. I have some custom Python handling some non-supported trackers that means I send information to Traccar using OsmAnd. This has worked for many hundreds of devices until suddenly about an hour ago it stopped without any reason why.

Now when I send an OsmAnd request Traccar crashes, it happens after a single request. I've enabled finest logging and there is nothing to me that really suggests why but I don't know exactly what I am looking at. Here is the log, there is no error the log just finishes and the service has stopped running.

2026-10-31 20:48:56 DEBUG: HikariPool-1 - Pool stats (total=20/20, idle=20/20, active=0, waiting=0)
2026-10-31 20:48:56 DEBUG: HikariPool-1 - Fill pool skipped, pool has sufficient level or currently being filled.
2026-10-31 20:48:57 DEBUG: HikariPool-1 - keepalive: connection com.mysql.cj.jdbc.ConnectionImpl@17e1f27f is alive
2026-10-31 20:49:00 DEBUG: HikariPool-1 - keepalive: connection com.mysql.cj.jdbc.ConnectionImpl@38ad5dd9 is alive
2026-10-31 20:49:00 DEBUG: HikariPool-1 - keepalive: connection com.mysql.cj.jdbc.ConnectionImpl@31b5e3ad is alive
2026-10-31 20:49:04 DEBUG: -Dio.netty.buffer.checkAccessible: true
2026-10-31 20:49:04 DEBUG: -Dio.netty.buffer.checkBounds: true
2026-10-31 20:49:04 DEBUG: Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@6977fca3
2026-10-31 20:49:04  INFO: [T0c157c07] connected
2026-10-31 20:49:04  INFO: [T0c157c07: osmand < 0:0:0:0:0:0:0:1] GET /?deviceid=1000001&lat=xxxxxx&lon=-xxxxxx&time=2026-10-31T20:49:03 HTTP/1.1\r\nHost: xxxxxx:5055\r\nUser-Agent: python-requests/2.34.2\r\nAccept-Encoding: gzip, deflate, zstd\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n
2026-10-31 20:49:06 DEBUG: HikariPool-1 - keepalive: connection com.mysql.cj.jdbc.ConnectionImpl@40a1e095 is alive
2026-10-31 20:49:10 DEBUG: HikariPool-1 - keepalive: connection com.mysql.cj.jdbc.ConnectionImpl@c4e2e68 is alive
2026-10-31 20:49:11 DEBUG: HikariPool-1 - keepalive: connection com.mysql.cj.jdbc.ConnectionImpl@5c78b615 is alive
2026-10-31 20:49:16 DEBUG: HikariPool-1 - keepalive: connection com.mysql.cj.jdbc.ConnectionImpl@5b0cdb9f is alive

Would anyone please have any ideas? Could there be something stuck in the database that is being unhandled?

I've tried a manual request with Postman and given a device a new device ID, it says it is registering the device ID and then crashes, I can open the DB in BeeKeeper studio so the DB appears to at least be openable.

Thanks

Anton Tananaev 21 days ago

Where do you see the crash?

moonship 21 days ago

Sorry when I say crash, I mean the service just stops (as seen in windows event viewer saying Traccar has stopped suddenly) and the web page no longer responds. I connected up another generic Teltonika tracker and the behaviour continues so it appears it stops running on any external data being input - logging into the web page works OK.

I've moved it to another database and this appears to now work (although I've lost all my devices/users/groups etc) suggesting it was a problem in the DB somewhere.

moonship 7 days ago

This has happened again, is there anything I can do to try and find where the issue may be being caused? It's seems to have stopped at a random point this morning with nothing to suggest why.

This is not isolated to the OSMAnd protocol, it appears any incoming data now causes the service to stop running. If I stop data coming in then Traccar will run just fine and continue to run.

I've enabled all debug logging, I can see the incoming OSMAnd messages, it selects from the tc_devices table, then the tc_groups and then tc_user_group and then just stops. There are no errors in the file to suggest any sort of exception being raised that would cause it to stop running.

Anton Tananaev 7 days ago

A fresh database working doesn’t necessarily mean the old database is corrupted. Please provide the full Windows Event Viewer error details and check for an hs_err_pid*.log JVM crash report in the Traccar installation directory. We need the process termination details to determine why it stops.

moonship 7 days ago

I'm afraid that Windows Event Viewer just raises Event ID 7034 (The traccar service terminated unexpectedly), it contains no further details. I've searched the entire C:\ drive for anything *.log and I do not have a JVM crash log anywhere. Is there any way to turn on the JVM error logging? Everything I have read says that it should be in the main directory but nothing is created.

I have been doing some more digging, I use LDAP in order to authenticate users. Those users by default are not assigned to any group so every two hours I run a Python script to make Traccar API calls to match the logged in user to the groups they should have access to. This morning (at around the time the traccar service stopped) the script appeared to run but had these errors (these are from the Python script).

[2026-11-14 10:18:58,409] - ERROR - Update_Traccar_Link Error: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)) JSON: {"userId": 4, "groupId": 13}
[2026-11-14 10:18:58,413] - ERROR - Update_Traccar_Link Error: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)) JSON: {"userId": 4, "groupId": 12}
[2026-11-14 10:19:02,484] - ERROR - Update_Traccar_Link Error: HTTPConnectionPool(host='x', port=8082): Max retries exceeded with url: /api/permissions (Caused by NewConnectionError("HTTPConnection(host='x', port=8082): Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it")) JSON: {"userId": 4, "groupId": 6}

When I have browsed the tc_user_group table in the database I can see that userid 4 should be allocated to 12 groups however has the same set of groupids repeated six times over and over (whereas the other users only have it once which is what I would expect).

Would it be in order to try and delete these extra rows or is that likely to cause an issue?

Anton Tananaev 7 days ago

Please stop the Windows service and run Traccar from Command Prompt in its installation directory:

jre\bin\java.exe -XX:+ExitOnOutOfMemoryError -jar tracker-server.jar conf\traccar.xml

Then send a device message and share the console output. An out-of-memory error could explain the service stopping without an error in the Traccar log. Please also share the exact Windows Event Viewer details and the server’s available RAM.

moonship 6 days ago

Thank you, I will do that and report back. Although very strangely it must have restarted itself last night and now appears back working OK. I've noticed that the server (Windows Server 2022 VM) is only running on 4GB RAM which appears to be lower than I thought when I originally built the server. I will increase it to 8GB if if is an out of memory issue.