Unable to copy suspended vApp template from one catalog to another catalog
search cancel

Unable to copy suspended vApp template from one catalog to another catalog

book

Article ID: 434904

calendar_today

Updated On:

Products

VMware Cloud Director VMware vSphere ESXi

Issue/Introduction

  • While copying a suspended vApp template from one catalog to another, template shows as “unresolved” state in the destination catalog.


  • The copy operation fails with the error "Internal Server Error - query did not return a unique result: 2".


  • In the /opt/vmware/vcloud-director/logs/vcloud-container-debug.log you can see error as below:

    ERROR | Backend-activity-pool-2387 | CopyContentsActivity | [Activity Execution] Uncaught Exception during Activity execution. Recent phase: com.vmware.vcloud.vdc.impl.CopyContentsActivity$AfterCopyPhase - Handle: urn:uuid:#########-####-####-####-########, Current Phase: CopyContentsActivity$AfterCopyPhase | requestId=#########-####-####-####-########,request=POST https://domain_name/api/catalog/#########-####-####-####-########/action/copy,requestTime=1773649537071,remoteAddress=##.##.##.##:20520,userAgent=Mozilla/5.0 (Windows; Win64; x64; rv:148.0) Gecko/201...,accept=application/*+xml;version vcd=#########-####-####-####-########,task=#########-####-####-####-######## activity=(com.vmware.vcloud.backendbase.management.system.Task
    Activity,urn:uuid:#########-####-####-####-########) activity=(com.vmware.vcloud.vdc.impl.CopyContentsActivity,urn:uuid:#########-####-####-####-########)
    java.util.concurrent.ExecutionException: com.vmware.ssdc.util.LMException: Internal Server Error
            at com.vmware.vcloud.activity.executors.ActivityRunner.run(ActivityRunner.java:136)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
            at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
            at java.base/java.lang.Thread.run(Thread.java:829)
    Caused by: com.vmware.ssdc.util.LMException: Internal Server Error
            at com.vmware.ssdc.util.LMException.wrap(LMException.java:135)
            at com.vmware.ssdc.library.ExceptionFactory.createFromMultiple(ExceptionFactory.java:32)
            at com.vmware.vcloud.vdc.impl.CopyContentsActivity.afterWaitForFabricInTx(CopyContentsActivity.java:1287)
            at com.vmware.vcloud.vdc.impl.CopyContentsActivity$AfterCopyPhase.invoke(CopyContentsActivity.java:1086)
            at com.vmware.vcloud.activity.executors.ActivityRunner.runPhase(ActivityRunner.java:175)
            at com.vmware.vcloud.activity.executors.ActivityRunner.run(ActivityRunner.java:112)
            ... 5 more
    Caused by: com.vmware.vcloud.api.presentation.service.InternalServerErrorException: Internal Server Error
            at com.vmware.vcloud.common.future.FutureUtil.convertExecutionException(FutureUtil.java:264)
            at com.vmware.vcloud.common.future.FutureUtil.checkCompletedFuture(FutureUtil.java:203)
            at com.vmware.vcloud.fabric.storage.storedVm.impl.CreateFromExistingStoredVmNonBlockingActivity$WaitForVmCloudUuidInInventoryPhase.invokeInt(CreateFromExistingStoredVmNonBlockingActivity.java:988)
            at com.vmware.vcloud.fabric.storage.storedVm.impl.CreateFromExistingStoredVmNonBlockingActivity$WaitForVmCloudUuidInInventoryPhase.invoke(CreateFromExistingStoredVmNonBlockingActivity.java:955)
            ... 7 more
    Caused by: 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.GeneratedMethodAccessor157.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.$Proxy150.uniqueResult(Unknown Source)
            at com.vmware.vcloud.common.persist.CriteriaProxy.uniqueResult(CriteriaProxy.java:261)
            at com.vmware.vcloud.ovf.scaffold.OvfScaffoldHibernateVirtualMachineDao.findVirtualMachineByValRef(OvfScaffoldHibernateVirtualMachineDao.java:63)
            at com.vmware.vcloud.fabric.storage.copy.impl.CopyVmActivity.getSourceVmSnapshotForClone(CopyVmActivity.java:261)
            at com.vmware.vcloud.fabric.storage.copy.impl.CopyVmActivity$IntraVcCopyPhase.invoke(CopyVmActivity.java:357)
            ... 7 more

  • Deleting the destination "Unresolved" template causes the source template to transition to the "Unknown" state.

Environment

VMware Cloud Director 10.6.x

Cause

The issue occurs due to duplicate database entries for the VM reference, causing a non-unique result error during the copy operation of the suspended vApp template.

Resolution

Broadcom is aware of this issue and a fix is planned for an upcoming release of VMware Cloud Director. Please subscribe to this KB by following the steps in the article:Subscribe an article for future updates on the resolution.