Issue with Traccar 5 Server: Incorrect Data Fields Returned in Summary Request

Aldayra year ago

I have been running a Traccar server with version 3 for several years. Recently, I decided to upgrade to Traccar version 5 and updated the Traccar server using the same Postgres database that was used with version 3. However, I noticed that when Traccar makes a summary request, the fields for engineHours, spentFuel, and averageSpeed are not generated correctly. Instead, it consistently returns 0 for all these fields.

Furthermore, it's worth noting that when I make summary requests for moments prior to the migration, these values are generated accurately. This discrepancy between pre-migration and post-migration data is causing confusion and hindering the functionality of Traccar version 5.

I am seeking assistance on how to resolve this issue. Any guidance or suggestions would be greatly appreciated.

This is an example of the response of Traccar:

{
    "deviceId": 55,
    "deviceName": "Renault Zoe",
    "distance": 3951.320000000298,
    "averageSpeed": 0,
    "maxSpeed": 28.077764000000002,
    "spentFuel": 0,
    "startOdometer": 5838088.12,
    "endOdometer": 5842039.44,
    "startTime": "2023-06-01T13:53:53.011+00:00",
    "endTime": "2023-06-01T15:50:39.000+00:00",
    "engineHours": 0
}

And this is an example of a response of Traccar to a range of hours before migration date:

{
    "deviceId": 50,
    "deviceName": "Peugeot Rifter",
    "distance": 2768.14999999851,
    "averageSpeed": 12.63108144600259,
    "maxSpeed": 52.915786000000004,
    "spentFuel": 0,
    "startOdometer": 35276647.64,
    "endOdometer": 35279415.79,
    "startTime": "2023-04-26T07:31:19.011+00:00",
    "endTime": "2023-04-26T08:29:58.000+00:00",
    "engineHours": 426000
}
Anton Tananaeva year ago

What troubleshooting have you done? Have you checked the raw data to confirm that the required information is there?

Aldayra year ago

I apologize for the confusion. I initially thought that the error was related to the migration since it coincided closely with the upgrade to version 5 (May 6th). However, it appears that this issue started occurring prior to the migration.

To investigate further, I will review the positions in the database to examine the information contained in the entries before and after April 27th, which is when the problem began. I will gather more information and, if I'm unable to resolve it, I will provide you with an update.