Error when trying to add new device

Nikola Joksimović9 months ago

When I try to add new device, I get this message:

Unique index or primary key violation: "PUBLIC.CONSTRAINT_A_INDEX_6 ON PUBLIC.TC_DEVICES(UNIQUEID NULLS FIRST) VALUES ( /* 4 */ 'xxxxxxxxxx' )"; SQL statement: INSERT INTO tc_devices(name, category, uniqueId, expirationTime, model, phone, disabled, contact, calendarId, groupId, attributes) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-224] - JdbcSQLIntegrityConstraintViolationException (... < QueryBuilder:469 < DatabaseStorage:95 < BaseObjectResource:73 < ...)

Can someone please explain to me what is happening and how to resolve the issue?
Just to avoid confusion, I have censured device ID with "xxxxxxxxxx" for privacy.

Anton Tananaev9 months ago

The error means that the device with this unique id is already registered.

Nikola Joksimović9 months ago

I did register it once, about 2 months ago, but I deleted it form Traccar Server after testing it for couple of days. It's not showing in device list. What are the steps I need to do to be able to register it again?

Anton Tananaev9 months ago

Well, it looks like you have not removed it completely. If it's already in the system, you can't register it again. You just need to link the existing device to your user account from Settings > Users > Connections > Devices.

Nikola Joksimović9 months ago

Interesting. So I just removed it from my account, not from the system...
Thank you for your assistance.
If I ever need to completely remove a device from the server, what should I do?

Anton Tananaev9 months ago

You click delete.

Nikola Joksimović9 months ago

Settings/Devices/Remove? Because I think that is what made me make this thread in the first place... Removed it from the account, not from the server.

Anton Tananaev9 months ago

You can remove from settings, but also from the main screen. There's a red button to delete device in the popup.

If that's what you already did and it didn't remove, it could mean you had a lot of data linked to the device and the operation timed out or was interrupted for some reason in the database.

Nikola Joksimović9 months ago

Noted. Thank you.