"Error: 'Unable to Process Template' When Deploying from Subscribed Content Library"
book
Article ID: 375916
calendar_today
Updated On:
Products
VMware vCenter Server 8.0VMware vCenter Server 7.0
Issue/Introduction
This article intends to provide resolution for deploying template from subscribed content library with the following symptoms,
Unable to deploy OVF template using content libraries, when choosing the compute resource an error appears "unable to process template"
Task fails with "Failed to deploy OVF package. Cause: A general system error occurred: Provider method implementation threw unexpected exception: query did not return a unique result: 2; nested exception is javax.persistence.NonUniqueResultException: query did not return a unique result: 2" Other templates are deploying fine, this is a new issue with this newly created template"
When trying to sync OVF template within content library, from a subscriber an exception is encountered.
In /var/log/vmware/content-library/cls.log
YYYY:MM:DD | ERROR | xx-xx-xx-xx-xx-xx-xx | cls-simple-activity-19 | SimpleActivityWorker | Exception will not be handled by activity (handle=xxxxxxxxxxxxxxxxxxxxx, entityId=xxxxxxxxxxxxxxxxxxxxxxx): query did not return a unique result: 2; nested exception is javax.persistence.NonUniqueResultException: query did not return a unique result: 2
Cause
Duplicate entries for the content library items in vCenter's Database.
Resolution
Before applying the steps below, please take a backup or an offline-snapshot (in powered-off state) of the vCenter Server Appliance . If the vCenter is part of a Linked Mode replication setup, please backup/offline snapshots of all the replicating nodes as well.
We strongly recommend contacting Broadcom technical support, as deleting incorrect entries may corrupt the database and make vCenter inaccessible.
Connect to the vCenter via SSH and login as root.
Stop the content library and vpxd services using the below command,
Note down the entity ID from cls.log and run the below query to verify duplicate entries,
SELECT * FROM cl_libraryitem_certificate_verification certInfo WHERE certInfo.itemId = 'xxxxxxxxxxxxxxxxxxxxxxxx';
Once you confirms that there are duplicate entries, Kindly run the below command to delete them, (NOTE: Kindly do not delete the library items directly from tables. Item info is not stored alone in the cl_libraryitem_certificate_verification there are other tables as well like cl_libraryitemversion, cl_libraryitem etc. Deleting items this way will leave the entries in inconsistent state.
DELETE FROM cl_libraryitem_certificate_verification cert_ver_old USING (SELECT MIN(ctid) as ctid, itemId FROM cl_libraryitem_certificate_verification GROUP BY itemId HAVING COUNT(*) > 1) cert_ver_new WHERE cert_ver_new.itemId = cert_ver_old.itemId AND cert_ver_new.ctid <> cert_ver_old.ctid;
Quit the VCDB using \q
Start the vpxd and content library service using,
service-control --start --all
Re-sync the OVF template within the content library.
Once the sync is finished, re-attempt the OVF deployment.