Short post. A few days ago, I tried to install the latest patch, vCenter 8 Update 2b, and it failed. Ok, it happens. But not every time on the fresh vCenter deployment. I saw the error message:
Exception occurred in the postInstallHook for last_component:Patch.
Please check the logs for more details. Take corrective action and then resume.

In the logs, I have found in logs that the PSCHealth service can’t start.
Performing start operation on profile: ALL...
, stderr=Service-control failed. Error: Failed to start services in profile ALL. RC=2, stderr=Failed to start pschealth services. Error: Service crashed while starting
2024-03-03T17:59:30.71Z 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-updatelpvv5_r1/stage/scripts/patches/payload/components-script/last_component/__init__.py", line 266, in _perfromStartAllVmwareServices
  _startAllVMwareServices(addHookData)
 File "/storage/updatemgr/software-updatelpvv5_r1/stage/scripts/patches/payload/components-script/last_component/__init__.py", line 255, 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-updatelpvv5_r1/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor.py", line 74, in executeHook
  executionResult = systemExtension(args)
 File "/storage/updatemgr/software-updatelpvv5_r1/stage/scripts/patches/libs/sdk/extensions.py", line 106, in __call__
  result = self.extension(*args)
 File "/storage/updatemgr/software-updatelpvv5_r1/stage/scripts/patches/libs/sdk/extensions.py", line 123, in _func
  return func(*args)
 File "/storage/updatemgr/software-updatelpvv5_r1/stage/scripts/patches/payload/components-script/last_component/__init__.py", line 289, in patch
  _perfromStartAllVmwareServices(addHookData)
 File "/storage/updatemgr/software-updatelpvv5_r1/stage/scripts/patches/payload/components-script/last_component/__init__.py", line 271, in _perfromStartAllVmwareServices
  _startAllVMwareServices(addHookData)
 File "/storage/updatemgr/software-updatelpvv5_r1/stage/scripts/patches/payload/components-script/last_component/__init__.py", line 255, in _startAllVMwareServices
  raise UserError(FAILED_TO_START_SERVICES_TEXT)
patch_errors.UserError: Failed to start all services after successful patching.
2024-03-03T17:59:30.125Z ERROR vmware_b2b.patching.phases.patcher Patch hook Patch got ComponentWrapperError.
Traceback (most recent call last):
 File "/storage/updatemgr/software-updatelpvv5_r1/stage/scripts/patches/py/vmware_b2b/patching/phases/patcher.py", line 208, in patch
  _patchComponents(ctx, userData, statusAggregator.reportingQueue)
 File "/storage/updatemgr/software-updatelpvv5_r1/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-updatelpvv5_r1/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-updatelpvv5_r1/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-updatelpvv5_r1/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor_process.py", line 119, in executeHook
  raise ex
patch_errors.ComponentError
2024-03-03T17:59:31.136Z WARNING root stopping status aggregation...
2024-03-03T17:59:31.139Z ERROR __main__ Patch vCSA failed
Cause and Solution:
The cause was that I had a different Timezone on the ESXi host and vCenter server. As you know, ESXi is in the UTC timezone by default.
So, the solution was to change timezone on the vCenter Server to UTC, install the patch and then go back with timezone to the previous one.
I hope that the issue is only with that particular patch. I have installed patches many times in the past and there was not a problem with a timezone. I hope it help you, if you will hit the same issue.
