RHEV : RHEVM GUI reports error during addition of entities like host/VM with error "ERROR: duplicate key value violates unique constraint

Solution Verified - Updated -

Issue

Possible symptoms due to the error for VM/Host

  • VM's icons are missing in Virtual machines tab on GUI.
  • VM's are running on the host and shows up with vdsClient command.
  • Pgsql database shows all the VM's for RHEV.
  • Unable to add a new host due to duplicate entry already existing.

Below are the vdsm logs throwing an error when adding a host for which entries exist

2017-12-07 10:03:04,963 ERROR [org.ovirt.engine.core.bll.hostdeploy.AddVdsCommand] (ajp-/127.0.0.1:8702-2) [732c97c4] Command 'org.ovirt.engine.core.bll.hostdeploy.AddVdsCommand' failed: CallableStatementCallback; SQL [{call insertvdsstatic(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "vds_static_host_name_unique"
  Where: SQL statement "INSERT INTO vds_static(vds_id,host_name, free_text_comment, vds_unique_id, port, protocol, vds_group_id, vds_name, server_SSL_enabled, vds_type,vds_strength,pm_enabled, pm_proxy_preferences, pm_detect_kdump, vds_spm_priority, sshKeyFingerprint,    console_address, ssh_port, ssh_username, disable_auto_pm, host_provider_id, openstack_network_provider_id) VALUES( $1 , $2 ,  $3 ,  $4 ,  $5 ,  $6 ,  $7 ,  $8 ,  $9 ,  $10 , $11 , $12 ,  $13 ,  $14 ,  $15 ,  $16 ,  $17 ,  $18 ,  $19 ,  $20 ,  $21 ,  $22 )"
PL/pgSQL function "insertvdsstatic" line 4 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "vds_static_host_name_unique"
  Where: SQL statement "INSERT INTO vds_static(vds_id,host_name, free_text_comment, vds_unique_id, port, protocol, vds_group_id, vds_name, server_SSL_enabled, vds_type,vds_strength,pm_enabled, pm_proxy_preferences, pm_detect_kdump, vds_spm_priority, sshKeyFingerprint,    console_address, ssh_port, ssh_username, disable_auto_pm, host_provider_id, openstack_network_provider_id) VALUES( $1 , $2 ,  $3 ,  $4 ,  $5 ,  $6 ,  $7 ,  $8 ,  $9 ,  $10 , $11 , $12 ,  $13 ,  $14 ,  $15 ,  $16 ,  $17 ,  $18 ,  $19 ,  $20 ,  $21 ,  $22 )" PL/pgSQL function "insertvdsstatic" line 4 at SQL statement

Environment

  • Red Hat Enterprise Virtualization 3.x
  • Red Hat Virtualization 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.