Failed to store position

Fabio2 years ago

HI,
using mysql I noticed that when a device loses the GPS signal while inside a building, the server reports this error

WARN: Failed to store position - Data truncation: Incorrect datetime value: '1970-01-01 00:00:00' for column `traccar`.`tc_positions`.`fixtime` at row 1 - MysqlDataTruncation (... < QueryBuilder:469 < DatabaseStorage:95 < DefaultDataHandler:47 < ...)

probably due to the wrong date, is
this normal? don't you start the check with LBS?
Thank you

Track-trace2 years ago

And not telling which device, which protocol, server log etc ?

Fabio2 years ago

Coban 103B device, gps103 protocol, server log the one I reported previously

Anton Tananaev2 years ago

What's your database configuration?

Fabio2 years ago

mysql with mariadb

Anton Tananaev2 years ago

I meant the URL you're using in Traccar.

Fabio2 years ago
jdbc:mysql://localhost/traccar?zeroDateTimeBehavior=round&amp;serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''
Anton Tananaev2 years ago

Seems like the mode is not working for MariaDB:

sessionVariables=sql_mode=''

Have you tried using mariadb driver instead?

Fabio2 years ago

No, I have no tired, I don't know how, can you help me?
Consider that the problem only occurs when the Tracker loses the GPS signal and the date passes 1970

Anton Tananaev2 years ago
Fabio2 years ago

I'll try tomorrow, let you know
Thanks so much