"Query did not return a unique result: 2" when selecting "Make Compliant" on a VM in VMware Cloud Director
search cancel

"Query did not return a unique result: 2" when selecting "Make Compliant" on a VM in VMware Cloud Director

book

Article ID: 420745

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

When attempting to make a VM compliant in VMware Cloud Director an error is returned with:
org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)

Environment

VMware Cloud Director 10.6.x

Cause

There was a failure when VMs were migrating between Org VDCs or they were moved outside of Cloud Director.

Resolution

There are several possible resolutions:
- Clone the VMs, remove the cloud UUID from the vmx file, and re-import the VMs.
- Follow Error "query did not return a unique result: 2" when deleting a vApp or VM
- Follow Error: "Internal Server Error - query did not return a unique result: 2; nested exception is org.hibernate.NonUniqueResultException" occurs when attempting to set a new default sizing policy