vCenter 7.x or 8.x patching fails at 80% with the error: "Exception occurred in PostHookInstall. Patch hook 'last_component:Patch' failed."
search cancel

vCenter 7.x or 8.x patching fails at 80% with the error: "Exception occurred in PostHookInstall. Patch hook 'last_component:Patch' failed."

book

Article ID: 325181

calendar_today

Updated On:

Products

VMware vCenter Server 7.0 VMware vCenter Server 8.0 VMware vCenter Server

Issue/Introduction

  • When patching vCenter server 7.x or 8.x, the patch process fails at 80% with error message "Exception occurred in PostHookInstall. Patch hook 'last_component:Patch' failed."

  • From /var/log/vmware/applmgmt/PatchRunner.log we see below mentioned error

YYYY-MM-DD hh:mm:ss  last_component:Patch ERROR vmware_b2b.patching.executor.hook_executor Patch hook 'last_component:Patch' failed.
Traceback (most recent call last):
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/payload/components-script/last_component/__init__.py", line 242, in _perfromStartAllVmwareServices
    _startAllVMwareServices()
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/payload/components-script/last_component/__init__.py", line 235, in _startAllVMwareServices
    raise UserError(FAILED_TO_START_SERVICES_TEXT)
patch_errors.UserError: Failed to start all services after successful patching.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor.py", line 74, in executeHook
    executionResult = systemExtension(args)
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/libs/sdk/extensions.py", line 106, in __call__
    result = self.extension(*args)
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/libs/sdk/extensions.py", line 123, in _func
    return func(*args)
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/payload/components-script/last_component/__init__.py", line 270, in patch
    _perfromStartAllVmwareServices()
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/payload/components-script/last_component/__init__.py", line 247, in _perfromStartAllVmwareServices
    _startAllVMwareServices()
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/payload/components-script/last_component/__init__.py", line 235, in _startAllVMwareServices
    raise UserError(FAILED_TO_START_SERVICES_TEXT)
patch_errors.UserError: Failed to start all services after successful patching.
YYYY-MM-DD hh:mm:ss  ERROR vmware_b2b.patching.phases.patcher Patch hook Patch got ComponentWrapperError.
Traceback (most recent call last):
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/py/vmware_b2b/patching/phases/patcher.py", line 203, in patch
    _patchComponents(ctx, userData, statusAggregator.reportingQueue)
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/py/vmware_b2b/patching/phases/patcher.py", line 85, in _patchComponents
    executeComponentHook(Hook.Patch, ctx, c, userData, reportingQueue)
  File "/storage/updatemgr/software-updateh2uapw6o/stage/scripts/patches/py/vmware_b2b/patching/executor/execution_facade.py", line 98, in executeComponentHook
    reportQueue, identifier, expectedResultType)
  File "/storage/updatemgr/software-updateh2uapw6o/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-updateh2uapw6o/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor_process.py", line 119, in executeHook
    raise ex
patch_errors.ComponentError
YYYY-MM-DD hh:mm:ss  WARNING root stopping status aggregation...
YYYY-MM-DD hh:mm:ss  ERROR __main__ Patch vCSA failed
  • From /var/log/vmware/vcha/vcha.log, we see below mentioned error

    YYYY-MM-DDThh:mm:ssZ info vcha[40311] [Originator@6876 sub=Default] Creating SSL Contexts
    YYYY-MM-DDThh:mm:ssZ error vcha[40311] [Originator@6876 sub=Default] Failed to initialize the SSL context: N7Vmacore6Crypto15CryptoExceptionE(Crypto Exception: error:02001002:system library:fopen:No such file or directory: unable to load BIO)
    --> [context]zKq7AVECAQAAAE65RwEOdmNoYQAAENk3bGlidm1hY29yZS5zbwAAp3gsACVsLQAt6TIA7EooALNVKAAyWigANlwoAVyeEXZjaGEAAUUBBgE+DAcBH2oFAocrAmxpYmMuc28uNgABrbwF[/context]
    YYYY-MM-DDThh:mm:ss.Z panic vcha[40311] [Originator@6876 sub=Default]
    -->
    --> Panic: Failed to initialize the SSL context.
    --> Backtrace:
    --> [backtrace begin] product: vCenterHA, version: 7.0.3, build: build-XXXXX, tag: vcha, cpu: x86_64, os: linux, buildType: release
    --> backtrace[00] libvmacore.so[0x0037DA99]
    --> backtrace[01] libvmacore.so[0x002C78D3]: Vmacore::System::Stacktrace::CaptureFullWork(unsigned int)
    --> backtrace[02] libvmacore.so[0x002D6B69]: Vmacore::System::SystemFactory::CreateBacktrace(Vmacore::Ref<Vmacore::System::Backtrace>&)
    --> backtrace[03] libvmacore.so[0x00370BE5]
    --> backtrace[04] libvmacore.so[0x00370D01]: Vmacore::PanicExit(char const*)
    --> backtrace[05] libvmacore.so[0x0033614B]
    --> backtrace[06] libvmacore.so[0x003361E9]
    --> backtrace[07] vcha[0x0011A04B]
    --> backtrace[08] vcha[0x00060145]
    --> backtrace[09] vcha[0x00070C3E]
    --> backtrace[10] vcha[0x00056A1F]
    --> backtrace[11] libc.so.6[0x00022B87]
    --> backtrace[12] vcha[0x0005BCAD]
    --> [backtrace end]
    






Cause

This is caused due to the starttype of the VCHA service being set to "AUTOMATIC" instead of the default "DISABLED." This might occur if VCHA is not destroyed properly.

Example output of the VCHA service status:

root@<FQDN OF VCENTER>[ /etc/applmgmt/appliance ]# /usr/lib/vmware-vmon/vmon-cli --status vcha
Name: vcha
Starttype: AUTOMATIC
RunState: STOPPED
RunAsUser: root
CurrentRunStateDuration(ms): 578525
HealthState: UNHEALTHY
FailStop: TRUE
MainProcessId: N/A

 

Resolution

 

  1. Revert to Snapshot

    • If a snapshot of the vCenter was taken before patching, revert to the snapshot to restore the previous state.

  2. Login to vCenter via SSH

    • Use root credentials to log in to the vCenter server via SSH.

  3. Check the Status of VCHA Startup Type

    • Run the following command to check the VCHA service status:

      /usr/lib/vmware-vmon/vmon-cli --status vcha
    • Example output:

      Name: vcha
      Starttype: AUTOMATIC
      RunState: STOPPED
      RunAsUser: root
      CurrentRunStateDuration(ms): 578525
      HealthState: UNHEALTHY
      FailStop: TRUE
      MainProcessId: N/A
  4. Update the VCHA Start Type

    • If the Starttype is AUTOMATIC, update it to DISABLED by running the following command:

      vmon-cli --update vcha --starttype DISABLED
    • Once completed, the following output will be displayed:

      Completed Service State Update request.
  5. Verify the Update

    • Recheck if the Starttype has been updated:

      /usr/lib/vmware-vmon/vmon-cli --status vcha
    • Example output:

      Name: vcha
      Starttype: DISABLED
      RunState: STOPPED
      RunAsUser: root
      CurrentRunStateDuration(ms): 684334
      HealthState: UNHEALTHY
      FailStop: TRUE
      MainProcessId: N/A
  6. Restart the Patching Process

    • Once the "Starttype" is updated and verified, restart the patching process.