Attempting to delete a vApp or VM in the Cloud Director UI fails with the following error:
query did not return a unique result: 2In the /opt/vmware/vcloud-director/logs/vcloud-container-debug.log, you see an entry such as:
org.hibernate.NonUniqueResultException: query did not return a unique result: 2
at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:328)
at jdk.internal.reflect.GeneratedMethodAccessor159.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.vmware.vcloud.common.db.HibernateClassLoaderHelperBeanPostProcessor$SessionInvocationHandler.invoke(HibernateClassLoaderHelperBeanPostProcessor.java:280)
at com.sun.proxy.$Proxy153.uniqueResult(Unknown Source)
at com.vmware.vcloud.common.persist.CriteriaProxy.uniqueResult(CriteriaProxy.java:261)
at com.vmware.vcloud.fabric.compute.dao.impl.HibernateAbstractHandleableDao.deleteById(HibernateAbstractHandleableDao.java:141)
at com.vmware.vcloud.fabric.compute.cvm.ComputeVmFactoryImpl.delete(ComputeVmFactoryImpl.java:91)
at jdk.internal.reflect.GeneratedMethodAccessor13748.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
VMware Cloud Director 10.6.x
This behaviour is observed due to the presence of duplicate entries in the database for the affected Virtual Machine.
The resolution requires Broadcom Technical Support's assistance to remove duplicate database entries.
Please open a Broadcom Support case referencing KB 406056 for the support team to review, analyze, and resolve the issue.