When attempting to delete the Content Library, the task fails with a general system error:
A general system error occurred:
Cannot delete content from library 19b1fa06-####-####-####-23379ec0e9c7, reason: (vim.fault.InaccessibleDatastore) {
faultCause = null,
faultMessage = null,
datastore = ManagedObjectReference: type = Datastore, value = datastore-####, serverGuid = 3c723c9d-####-####-####-b24fb5a070c0,
name = <DS_Name>,
detail = notAccessibleWithPrivilege
}.java.util.NoSuchElementExceptionErrors in /var/log/vmware/content-library/cls.log show: DeleteLibraryActivity | Library items deletion... failed at library item [UUID]
VMware vCenter Server
This article provides steps to manually remove a Content Library and its stale items from the vCenter Server database (VCDB) when the backing datastore is inaccessible or the library metadata is corrupted.
Important: The steps below are irreversible. Before making these changes, ensure you have completed the following:
SSH to the vCenter Server Appliance as root.
service-control --stop vmware-vpxd && service-control --stop vmware-content-libraryStep 2: Remove the Content Library from the Database
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
SELECT id, name FROM cl_library WHERE name = '[Library_Name]';SELECT * FROM cl_library_storage WHERE library_id = '[Library_ID]';
Step 3: Clean Up Stale Library Items
SELECT id, name, libraryid FROM cl_libraryitem WHERE libraryid = '[Library_ID]';
DELETE FROM cl_libraryitem WHERE id = '[Item_ID]';
\qStep 4: Restart Services
service-control --start vmware-vpxd && service-control --start vmware-content-library