VCSA patch fails with error "Exception occured in postInstallHook for analytics:Patch"
search cancel

VCSA patch fails with error "Exception occured in postInstallHook for analytics:Patch"

book

Article ID: 420364

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

  • VCSA patch update to 8.0U3 fails with the below given error message:



  • /var/log/vmware/applmgmt/PatchRunner.log :


    YYYY-MM-DDTHH:MM:SS.343Z  Exception: Traceback (most recent call last):

      File "/usr/lib/vmware/site-packages/cis/cisreglib.py", line 262, in securityctx_modifier
        yield
      File "/usr/lib/vmware/site-packages/cis/cisreglib.py", line 350, in add_securityctx_to_requests
        return req_method(self, *args, **kargs)
      File "/usr/lib/vmware/site-packages/cis/cisreglib.py", line 361, in register_service
        self.service_content.serviceRegistration.Create(svc_id,
      File "/usr/lib/vmware/site-packages/pyVmomi/VmomiSupport.py", line 618, in <lambda>
        self.f(*(self.args + (obj,) + args), **kwargs)
      File "/usr/lib/vmware/site-packages/pyVmomi/VmomiSupport.py", line 391, in _InvokeMethod
        return self._stub.InvokeMethod(self, info, args)
      File "/usr/lib/vmware/site-packages/pyVmomi/SoapAdapter.py", line 1607, in InvokeMethod
        raise obj  # pylint: disable-msg=E0702
    pyVmomi.VmomiSupport.vmodl.fault.SecurityError: (vmodl.fault.SecurityError) {
       dynamicType = <unset>,
       dynamicProperty = (vmodl.DynamicProperty) [],
       msg = '',
       faultCause = <unset>,
       faultMessage = (vmodl.LocalizableMessage) []
    }

YYYY-MM-DDTHH:MM:SS.343Z  VMware Analytics Service firstboot failed
YYYY-MM-DDTHH:MM:SS.392Z analytics:Patch INFO analytics.utils
YYYY-MM-DDTHH:MM:SS.392Z analytics:Patch ERROR vmware_b2b.patching.executor.hook_executor Patch hook 'analytics:Patch' failed.
Traceback (most recent call last):
  File "/storage/updatemgr/software-update048k7dzi/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor.py", line 74, in executeHook
    executionResult = systemExtension(args)
  File "/storage/updatemgr/software-update048k7dzi/stage/scripts/patches/libs/sdk/extensions.py", line 106, in __call__
    result = self.extension(*args)
  File "/storage/updatemgr/software-update048k7dzi/stage/scripts/patches/libs/sdk/extensions.py", line 123, in _func
    return func(*args)
  File "/storage/updatemgr/software-update048k7dzi/stage/scripts/patches/payload/components-script/analytics/__init__.py", line 127, in patch
    run_firstboot(ctx)
  File "/storage/updatemgr/software-update048k7dzi/stage/scripts/patches/payload/components-script/analytics/utils.py", line 52, in run_firstboot
    raise Exception("Analytics Patching failed to execute firstboot operation")
Exception: Analytics Patching failed to execute firstboot operation
2025-10-31T10:04:49.397Z ERROR vmware_b2b.patching.phases.patcher Patch hook Patch got ComponentWrapperError.
Traceback (most recent call last):
  File "/storage/updatemgr/software-update048k7dzi/stage/scripts/patches/py/vmware_b2b/patching/phases/patcher.py", line 208, in patch
    _patchComponents(ctx, userData, statusAggregator.reportingQueue)
  File "/storage/updatemgr/software-update048k7dzi/stage/scripts/patches/py/vmware_b2b/patching/phases/patcher.py", line 90, in _patchComponents
    executeComponentHook(Hook.Patch, ctx, c, userData, reportingQueue)
  File "/storage/updatemgr/software-update048k7dzi/stage/scripts/patches/py/vmware_b2b/patching/executor/execution_facade.py", line 97, in executeComponentHook
    result = executeHook(c.patchScript, hook, args,
  File "/storage/updatemgr/software-update048k7dzi/stage/scripts/patches/py/vmware_b2b/patching/executor/execution_facade.py", line 53, in executeHook
    result = executor.executeHook(scriptFile, hook, args, reportQueue, reportIdentifier)
  File "/storage/updatemgr/software-update048k7dzi/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor_process.py", line 119, in executeHook
    raise ex
patch_errors.ComponentError
YYYY-MM-DDTHH:MM:SS.399Z WARNING root stopping status aggregation...
YYYY-MM-DDTHH:MM:SS.400Z ERROR __main__ Patch vCSA failed




Environment

VMware vCenter Server 8.0.x

 

Cause

The analytics service fails to start as the 'phservice' registration is missing for the analytics service for the vCenter .

To validate the service registration, Run the below command : 
/usr/lib/vmware-lookupsvc/tools/lstool.py list --url http://localhost:7090/lookupservice/sdk | grep -i "phservice"

Resolution

To resolve the issue, follow the steps below:

  1. Make sure a valid snapshot of the vCenter Server is available. For environments using Enhanced Linked Mode (ELM), ensure an offline snapshot of all linked vCenter servers is taken.

  2. Connect to the affected vCenter Server using SSH.

  3. Run lsdoctor on the problematic vCenter Server. Use it to re-create the 'phservice' registration for the analytics service.

    • Download the lsdoctor script from KB article : Using the 'lsdoctor' Tool 
    • Upload the file to the vCenter using WinSCP under path /var/tmp
    • Run the "-r, --rebuild" option referring to the KB to recreate the analytics service .
  4. After recreation, verify that the Service ID for 'phservice' is correctly registered and matches the expected value using the below command:
    /usr/lib/vmware-lookupsvc/tools/lstool.py list --url http://localhost:7090/lookupservice/sdk | grep -i "phservice"

  5. Once validation is complete, proceed with applying the vCenter patch or update again.