bleuz
vpxd.log
2018-07-09T22:30:25.448Z error vpxd[7F4FACAC3700] [Originator@6876 sub=Default opID=HostSync-host-28-37dc5435] [VdbStatement] SQLError was thrown: "ODBC error: (23505) - ERROR: duplicate key value violates unique constraint "pk_vpx_vm_virtual_device";
--> Error while executing the query" is returned when executing SQL statement "INSERT INTO VPX_VM_VIRTUAL_DEVICE (ID, DEVICE_KEY, CONN_AL_GU_CONTROL_FLAG, CONN_CONNECTED_FLAG, CONN_START_CONNECTED_FLAG, CONN_STATUS, DEVICE_INFO_SUMMARY, DEVICE_INFO_LABEL, DEVICE_CONTROLLER_KEY, DEVICE_UNIT_NUMBER, DEVICE_TYPE, DEVICE_TEXT) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
2018-07-09T22:30:25.461Z error vpxd[7F4FACAC3700] [Originator@6876 sub=vpxCommon opID=HostSync-host-28-37dc5435] [Vpxd_HandleVmRootError] Received unrecoverable VmRootError. Generating minidump ...
2018-07-09T22:30:25.461Z error vpxd[7F4FACAC3700] [Originator@6876 sub=Default opID=HostSync-host-28-37dc5435] An unrecoverable problem has occurred, stopping the VMware VirtualCenter service. Error: Error[VdbODBCError] (-1) "ODBC error: (23505) - ERROR: duplicate key value violates unique constraint "pk_vpx_vm_virtual_device";
--> Error while executing the query" is returned when executing SQL statement "INSERT INTO VPX_VM_VIRTUAL_DEVICE (ID, DEVICE_KEY, CONN_AL_GU_CONTROL_FLAG, CONN_CONNECTED_FLAG, CONN_START_CONNECTED_FLAG, CONN_STATUS, DEVICE_INFO_SUMMARY, DEVICE_INFO_LABEL, DEVICE_CONTROLLER_KEY, DEVICE_UNIT_NUMBER, DEVICE_TYPE, DEVICE_TEXT) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
2018-07-09T22:30:25.466Z panic vpxd[7F4FACAC3700] [Originator@6876 sub=Default opID=HostSync-host-28-37dc5435]
-->
--> Panic: Unrecoverable VmRootError. Panic!
Thats the crash .
You need to see the postgres.log during the same time frame for the exact duplicate key ...
Example:-
postgresql.log
UTC 583a9c81.5814 127750 VCDB vc ERROR: duplicate key value violates unique constraint "pk_vpx_vm_virtual_device"
UTC 583a9c81.5814 127750 VCDB vc DETAIL: Key (id, device_key)=(361, 3002) already exists.
Take a snapshot . Connect to VCSA DB ..
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
Delete the duplicate ID using the below command. Replace with the ID values you get from postgres.log
DELETE FROM vpx_vm_virtual_device where id='xxx' and device_key='xxxx';