Cant add device

Lykourgos4 years ago

Hi, i am trying to add a device to my server but i get the following error

Unique index or primary key violation: "PUBLIC.CONSTRAINT_INDEX_A ON PUBLIC.TC_DEVICES(UNIQUEID) VALUES 327"; SQL statement:
INSERT INTO tc_devices (model, category, name, uniqueId, attributes, groupId, contact, disabled, lastUpdate, phone) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-200] - JdbcSQLIntegrityConstraintViolationException (... < QueryBuilder:480 < DataManager:458 < BaseObjectManager:90 < ...)

I checked the devices as an admin and the device id i am trying to add is not listed, The device was already in the server but it simply disappeared. I checked what the website sees via the api it returns device ids 326 and 328 but not 327 that is the device that went missing.
Has this happened to anyone before ? any ideas how to fix it ?

Anton Tananaev4 years ago

The error clearly indicates that device is already there.

Lykourgos4 years ago

I have linked 2 screenshots bellow, as you can see with an admin account filtering the id returns no result.
i have also linked a screenshot with the responce of the api trying to read the device with the id 327, i can read 326 and 328 normaly.

https://officeiq.gr/~00LVP
https://officeiq.gr/~WXtYz

Anton Tananaev4 years ago

Your screenshots make no sense to me, unfortunately. One shows some API response, but without request details it means nothing. Second shows search for completely different id.

Lykourgos4 years ago

I linked bellow the complete request, it does not return anything for the id 327 that acording the error is the id of the device that already exists. I also tried the search with the device id it returns nothing. the second image from the previous post is a search for the id of the device i cant add.

https://officeiq.gr/~4s1I5
https://officeiq.gr/~BhTyq

Anton Tananaev4 years ago

Your original error message indicates that you are trying to use 327 as a UNIQUEID, so the screenshots still don't make much sense.

Lykourgos4 years ago

I get the error when i try to add the device using the device id (9171553...) i can add other ids without problem.

Anton Tananaev4 years ago

The error is pretty clear:

"PUBLIC.CONSTRAINT_INDEX_A ON PUBLIC.TC_DEVICES(UNIQUEID) VALUES 327"
Lykourgos4 years ago

From my understanding it is conflicting with the device that has the id 327, right ?
But there is no device with that id as you can see in the screnshots. is there any more information i can provide to help ?

Anton Tananaev4 years ago

conflicting with the device that has the id 327, right ?

That's not what I see.

Lykourgos4 years ago

Ok, lets recap the problem.
I am trying to add a device to the server from the web app, and i get the error from the first post, that means the device is already added to the server, correct ?
I then search from an admin account all the devices that are registered in the server and the device is not listed.