disk_vm_element ERROR: duplicate key value violates unique constraint "pk_disk_vm_element"

Hello, when i tried to attach a snapshot disk into my backupvm. oVirt doesn't want to attach it. In the engine.log I can see this. 2018-08-04 19:20:04,472-10 ERROR [org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand] (default task-33) [646ad7a1-4501-4648-a937-bbee0abaec46] Command 'org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand' failed: CallableStatementCallback; SQL [{call insertdiskvmelement(?, ?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "pk_disk_vm_element" Detail: Key (vm_id, disk_id)=(78ef239f-3cb3-4eef-921f-f989724009ef, c7cef731-e31d-4597-80f1-1f2393cd66ea) already exists. Where: SQL statement "INSERT INTO disk_vm_element ( disk_id, vm_id, is_boot, pass_discard, disk_interface, is_using_scsi_reservation) VALUES ( v_disk_id, v_vm_id, v_is_boot, v_pass_discard, v_disk_interface, v_is_using_scsi_reservation)" PL/pgSQL function insertdiskvmelement(uuid,uuid,boolean,boolean,character varying,boolean) line 3 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pk_disk_vm_element" Detail: Key (vm_id, disk_id)=(78ef239f-3cb3-4eef-921f-f989724009ef, c7cef731-e31d-4597-80f1-1f2393cd66ea) already exists. When i SQL the database, the entries is present (and many other). But in the webinterface, I can't see them on the backupVM. It's just like ovirt didn't delete old entries engine=# select * from disk_vm_element where vm_id = '78ef239f-3cb3-4eef-921f-f989724009ef' and disk_id = 'c7cef731-e31d-4597-80f1-1f2393cd66ea' ; disk_id | vm_id | is_boot | disk_interface | is_using_scsi_reservation | pass_discard --------------------------------------+--------------------------------------+---------+----------------+---------------------------+-------------- c7cef731-e31d-4597-80f1-1f2393cd66ea | 78ef239f-3cb3-4eef-921f-f989724009ef | f | VirtIO | f | f (1 row) Do you guys have any idea on how to correct this ? Is there any function to update / refresh this table ? I dont want to delete entries by sql as i don't know the consequences, is it safe to delete entries ? Thank you for your help

Hi Punaatua, A simple google search shows you hit this bug - https://bugzilla.redhat.com/show_bug.cgi?id=1562093. Ignore the operation (in the bug) that leads to it, but this is the same issue On Sun, Aug 5, 2018 at 9:26 AM, Punaatua PK <punaatua.pk@gmail.com> wrote:
Hello,
when i tried to attach a snapshot disk into my backupvm. oVirt doesn't want to attach it. In the engine.log I can see this.
2018-08-04 19:20:04,472-10 ERROR [org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand] (default task-33) [646ad7a1-4501-4648-a937-bbee0abaec46] Command 'org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand' failed: CallableStatementCallback; SQL [{call insertdiskvmelement(?, ?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "pk_disk_vm_element" Detail: Key (vm_id, disk_id)=(78ef239f-3cb3-4eef-921f-f989724009ef, c7cef731-e31d-4597-80f1-1f2393cd66ea) already exists. Where: SQL statement "INSERT INTO disk_vm_element ( disk_id, vm_id, is_boot, pass_discard, disk_interface, is_using_scsi_reservation) VALUES ( v_disk_id, v_vm_id, v_is_boot, v_pass_discard, v_disk_interface, v_is_using_scsi_reservation)" PL/pgSQL function insertdiskvmelement(uuid,uuid,boolean,boolean,character varying,boolean) line 3 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pk_disk_vm_element" Detail: Key (vm_id, disk_id)=(78ef239f-3cb3-4eef-921f-f989724009ef, c7cef731-e31d-4597-80f1-1f2393cd66ea) already exists.
When i SQL the database, the entries is present (and many other). But in the webinterface, I can't see them on the backupVM. It's just like ovirt didn't delete old entries
engine=# select * from disk_vm_element where vm_id = '78ef239f-3cb3-4eef-921f-f989724009ef' and disk_id = 'c7cef731-e31d-4597-80f1-1f2393cd66ea' ; disk_id | vm_id | is_boot | disk_interface | is_using_scsi_reservation | pass_discard --------------------------------------+--------------------- -----------------+---------+----------------+--------------- ------------+-------------- c7cef731-e31d-4597-80f1-1f2393cd66ea | 78ef239f-3cb3-4eef-921f-f989724009ef | f | VirtIO | f | f (1 row)
Do you guys have any idea on how to correct this ?
Is there any function to update / refresh this table ? I dont want to delete entries by sql as i don't know the consequences, is it safe to delete entries ?
Thank you for your help _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community- guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/ message/PXGZ62TGLMO7PTBKVPSTZCEBRAW2L5QK/
-- Raz Tamir Manager, RHV QE

Hi Raz, yes i saw this bug. But I was focusing on the opération that leads to it which is not the same as me. I'm not very familiar with bugzilla. No solution for the moment for this bug ?

Adding Tal for further assistance On Sun, Aug 5, 2018 at 9:45 AM, Punaatua PK <punaatua.pk@gmail.com> wrote:
Hi Raz,
yes i saw this bug. But I was focusing on the opération that leads to it which is not the same as me. I'm not very familiar with bugzilla.
No solution for the moment for this bug ? _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community- guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/ message/P5LZI7QDTXKHJJC3CSQRQSJNM7YFWUPF/
-- Raz Tamir Manager, RHV QE

Hello Raz, after looking onto rhev documentation, I did find the "THE ENGINE VACUUM TOOL". It seems to "maintains PostgreSQL databases by updating tables and removing dead rows, allowing disk space to be reused" Maybe it will delete old entries ?
participants (2)
-
Punaatua PK
-
Raz Tamir