Create Content Library failed with “java.lang.RuntimeException” Error in vSphere HTML5 Client
search cancel

Create Content Library failed with “java.lang.RuntimeException” Error in vSphere HTML5 Client

book

Article ID: 312586

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

This document offers general troubleshooting guidance for issues affecting Content Library and the Lookup Service. 

Symptoms: Content Library service was running but all Content Library related operations failed with below errors:

1. Create content library failed with "java.lang.RuntimeException" error:



2. Unable to Select a compute resource during deploy OVF Template:



3. All Content Library related Roles and Privileges showing abnormal name as below:



Environment

VMware vCenter Server 7.x

VMware vCenter Server 8.x

Cause

  • Content library related service Name and service ID are missing in Lookup Service, from "/usr/bin/python /usr/lib/vmware-lookupsvc/tools/lstool.py list --url "http://localhost:7090/lookupservice/sdk" " command results, normally there are multiple Content Library related services and one service name like below :
Name: cis.content-library. ServiceName
Description: cis.content-library. ServiceDescription
Service Product: com.vmware.cis
Service Type: cis.cls
Service ID: ####-####-####-####-######
Site ID: default-first-site
Node ID: ####-####-####-####-######
Owner ID: vpxd-extension-####-####-####-####-######@vsphere. local
Version: 1.0
Endpoints:
Type: com. vmware. cis.cls.vapi.http
Protocol: vapi.json.http
  • Content library related service ID was duplicated with other service ID and registered with abnormal name, below was an abnormal sample which showing Content Library service ID was duplicated with vcenter.tokenservice:
Name: com. vmware. vcenter. tokenservice. servicenameresource
Description: com. vmware. vcenter. tokenservice. servicedescriptionresource
Service Product: com. vmware.cis
Service Type: cis.cls
Service ID: ####-####-####-####-######
Site ID: default-site
Node ID: ####-####-####-####-######
Owner ID: vpxd-extension-####-####-####-####-######@vsphere. local
Version: 1.0
Endpoints:
Type: com. vmware. vcenter. tokenservice. vapi
Protocol: vapi.json.https
  • In this case, since vcenter.tokenservice already registered with the same service ID(####-####-####-####-######), content library service was unable to register with same ID.

Resolution

1. Before taking any action, ensure you have taken file-level backups as per the KB article. A critical requirement is to also have powered-off snapshots of all vCenter nodes in Enhanced Linked Mode (ELM): Document to take File Based Backup of vCenter

2. Login vCSA VM and check content library service ID:

# cat /etc/vmware-content-library/cls_service_cisreg.spec | grep -i "cmreg.serviceid"
Example output: cmreg.serviceid=####-####-####-####-######

3. Run “python lsdoctor.py -r” to rebuild content library related services, steps to do so is mentioned here: Using the 'lsdoctor' Tool

Again, before using lsdoctor to make any changes, ensure you have taken proper powered off snapshots of your SSO domain in step 1.

4. Watch carefully during content library service or any other service rebuild  process,

For example: below prompt means ####-####-####-####-###### successfully registered:

YYYY-MM-DD HH:MM:SS INFO registerServices: Service ####-####-####-####-###### has been successfully registered


5. If content library service registration failed, check lookup service log files and find if there is any duplicate service ID which already registered,

For Example: below means service ID ####-####-####-####-###### already registered by other service:

/var/log/vmware/lookupsvc/lookupserver-default.log
YYYY-MM-DD HH:MM:SSZ pool-2-thread-5 INFO  com.vmware.vim.lookup.vlsi.ServiceRegistrationImpl] User: {Name: Administrator, Domain: VSPHERE.LOCAL} attempted to create service with duplicate ID: ####-####-####-####-######

6. Run the command mentioned below  to get the service details and check which service already registered with the same ID.

/usr/bin/python /usr/lib/vmware-lookupsvc/tools/lstool.py list --url "http://localhost:7090/lookupservice/sdk" > /var/core/lstool.txt


7. Fix the duplicate service ID issue by following KB or contact Broadcom Support referencing the KB: Resolve Duplicate Service Registration

8. Re-run “python lsdoctor.py -r”

Additional Information

Impact/Risks:
1 Could not deploy any OVF/OVA from vSphere Client.
2 Unable to create any content library from vSphere Client.