How can i debug trouble requesting combined reports

RastreameMX 2 years ago

Hi, good day.

I've experiencing a mistake when combined report is retrieved on modern web template.

Some weeks ago we've registered new device on Traccar (Teltonika FMC130). Today we've installed to a customer that device, and we've deleted past positions in DB (using query DELETE FROM tc_positions WHERE id < {position id from customer use begin} AND deviceid = {deviceid related to that device})

Now combined report returns error :

TypeError: Cannot read properties of undefined (reading 'latitude')
    at https :// site/static/js/main.1aa58fd5.js:178:3303
    at Array.map ()
    at https : // site/static/js/main.1aa58fd5.js:178:3225
    at Array.flatMap ()
    at cw (https :// site/static/js/main.1aa58fd5.js:178:3204)
    at Mo (https : // site/static/js/main.1aa58fd5.js:2:681543)
    at Ds (https : // site/static/js/main.1aa58fd5.js:2:693231)
    at Ml (https :// site/static/js/main.1aa58fd5.js:2:739539)
    at Sc (https :// site/static/js/main.1aa58fd5.js:2:727762)
    at yc (https :// site/static/js/main.1aa58fd5.js:2:727690)

All other reports (events, route, stops...) are generated correctly.

I'm aware that direct queries done in MySQL database are discouraged, as that could broke database structure and/or table connections.
I'm almost sure that this trouble is related with date of report, as i believe that after today all combined reports retrieved where report range have not date of today involved, will work normally.

I'm wondering how can i debug where comes the mistake, as if it could be a bug or not on combined report generation.

Thank you.

Anton Tananaev 2 years ago

You removed old positions and that's what's probably causing this issue. Events are referencing the positions that don't exist.

RastreameMX 2 years ago

Hi again.

Of course, i forgot the tc_events table.
There should be the inconsistence.

Thanks you so much.