"query did not return a unique result ... at com.vmware.vcloud.fabric.compute.cvm.HibernateComputeVmDao.lookupByVmValRef(HibernateComputeVmDao.java:543)" error when attempting to manage a VM in Cloud Director
book
Article ID: 325560
calendar_today
Updated On:
Products
VMware Cloud Director
Issue/Introduction
In the UI, when managing a VM you see the following error:
org.hibernate.NonUniqueResultException: query did not return a unique result: X Where X denotes a value such as 2.
In the /opt/vmware/vcloud-director/logs/vcloud-container-debug.log you see an entry such as:
at com.vmware.vcloud.fabric.compute.cvm.HibernateComputeVmDao.lookupByVmValRef(HibernateComputeVmDao.java:543)
Environment
VMware Cloud Director 10.x
Cause
This issue can occur if Cloud Director has duplicate references to a VM in its database.
Resolution
To resolve this issue, please open a Support Request with VMware Technical Support and reference this KB article 325560. Database modifications may be required to resolve this issue and will require VMware Technical Support assistance.
Alternatively, the VM can be removed from vCenter and VCD, re-imported into VMware Cloud Director. Please refer the KB article 320484.