Subscribed Content library synchronization with a 3rd party publisher fails with java.lang.NullPointerException
search cancel

Subscribed Content library synchronization with a 3rd party publisher fails with java.lang.NullPointerException

book

Article ID: 433851

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vCenter Server 8.0

Issue/Introduction

Subscribed content library synchronization tasks fail during the Estimate Cost phase.

The /var/log/vmware/content-library/cls.log on the affected vCenter Server confirms the failure with the following trace:

YYYY-MM-DDTHH:MM:SS.386-07:00 | ERROR    | ml6zjceu-2296605-auto-1d82m-h5:70173993-bb | cls-simple-activity-14    | ContentLibraryActivityCallback | vapi opId: ml6zjceu-xxxxxxx-auto-xxxxx-h5:xxxxxxxx- vapi call finished with an errorjava.lang.NullPointerException: null
        at com.vmware.cl.utils.LibraryUtilityService.estimateCost(LibraryUtilityService.java:131) ~[cls-main-1.0.0.jar:?]
        at com.vmware.cl.activities.SyncLibraryActivity.phaseSyncItems(SyncLibraryActivity.java:316) ~[cls-main-1.0.0.jar:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_452]

Environment

VMware vCenter Server

Cause

This issue occurs when an item within a third-party publisher's JSON manifest file contains an empty file definitions array ("files": [ ]).

During the Estimate Cost phase, the content library service attempts to calculate the storage cost for the item. Because the file definitions array is empty, a null value is returned instead of a file object. This results in a java.lang.NullPointerException, causing the immediate termination of the synchronization task to prevent data corruption.

Example:

{
      "created": "YYYY-MM-DDTHH:MM",
      "description": "####",
      "version": "####",
      "files": [ ],
      "id": "urn:uuid:########-####-####-####-###########",
      "name": "Template-name",
      "properties": { ####},
      "selfHref": "Windows/Windows-####-Standard/item.json",
      "type": "####"
    },

Resolution

To resolve the metadata inconsistency in the publisher's JSON manifest file and restore subscribed content library functionality, the following sequential steps must be executed:

  1. Access the external web or file server where the subscribed content library is published and hosted.

  2. Locate the root directory of the published library and identify the JSON manifest file.

  3. CRITICAL: Create a backup copy of the JSON manifest file prior to making any modifications.

  4. Open the active JSON manifest file in a standard text editor.

  5. Search the document for the empty file definitions array: "files": [].

  6. Delete the entire JSON object block associated with that specific item.

    • Note: Ensure that the removal of the item does not break the overall JSON syntax structure. Verify that no trailing commas or mismatched brackets are left behind.

  7. Review the remainder of the JSON manifest to ensure all remaining published items contain at least one valid descriptor file (e.g., a .ovf or .iso file).

  8. Save and close the JSON manifest file.

  9. Open the vSphere Client and trigger a manual synchronization to apply the changes and resume normal library functionality.

Additional Information

https://knowledge.broadcom.com/external/article/397243/subscribed-content-library-synchronizati.html