Failed to store position - duplicate entry

Mark4 months ago

Traccar stopped saving new positions in the tc_positions table. I have the following message in the logs: Failed to store position - duplicate entry '2147483647' for key 'tc_position.PRIMARY'. I am deleting a record with id 2147483647. In its place, 1 new record is saved and the story repeats itself. Does anyone have an idea?

Anton Tananaev4 months ago

You reached the id limit on the positions table. You can update the column size to fix this. I believe this has been discussed on the forum before somewhere.

Mark4 months ago

Thanks, I found something. I changed the id type from INT to BIGINT. It will take some time.

Mark4 months ago

For others: I did the same in the tc_events table (positionid) and in the tc_devices table (positionid). Everything works now.

carlock4 months ago

excuse the intrusion. a doubt in this case. assuming I have this issue. and I don't mind old positions since I only kept them for 3 months or less. What would happen if I just changed the index to 1 again? Wouldn't it start using cells from there? Would It keep the data searchable? Also in the devices or similar tables?

Anton Tananaev4 months ago

If you want to start from 1, you have to update the auto-increment value. But I believe you might need to clear all the data to do that.