VCSA patching to 8.0U3 fails with "Exception occurred in postInstallHook for analytics:Patch"
search cancel

VCSA patching to 8.0U3 fails with "Exception occurred in postInstallHook for analytics:Patch"

book

Article ID: 380460

calendar_today

Updated On:

Products

VMware vCenter Server 8.0

Issue/Introduction

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

In /var/log/vmware/applmgmt/PatchRunner.log we see the below entries: 

yyyy-mm-dd analytics:Patch INFO extensions Found patch hook <module 'analytics' from '/storage/seat/software-updateub3xs7ou/stage/scripts/patches/payload/components-script/analytics/__init__.py'>:Patch'
yyyy-mm-dd analytics:Patch INFO extensions Executing patch hook '<module 'analytics' from '/storage/seat/software-updateub3xs7ou/stage/scripts/patches/payload/components-script/analytics/__init__.py'>:Patch' with context <patch_specs.PatchContext object at 0x7f926be8f220>.
yyyy-mm-dd analytics:Patch INFO analytics Executing Patch Hook for Analytics Service
yyyy-mm-dd analytics:Patch ERROR vmware_b2b.patching.executor.hook_executor Patch hook 'analytics:Patch' failed.
Traceback (most recent call last):
  File "/storage/seat/software-updateub3xs7ou/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor.py", line 74, in executeHook
    executionResult = systemExtension(args)
  File "/storage/seat/software-updateub3xs7ou/stage/scripts/patches/libs/sdk/extensions.py", line 106, in __call__
    result = self.extension(*args)
  File "/storage/seat/software-updateub3xs7ou/stage/scripts/patches/libs/sdk/extensions.py", line 123, in _func
    return func(*args)
  File "/storage/seat/software-updateub3xs7ou/stage/scripts/patches/payload/components-script/analytics/__init__.py", line 113, in patch
    move_files(PUSH_TELEMETRY_DIRECTORY_OLD_STAGE, PUSH_TELEMETRY_DIRECTORY_STAGE)
  File "/storage/seat/software-updateub3xs7ou/stage/scripts/patches/payload/components-script/analytics/__init__.py", line 163, in move_files
    shutil.move(os.path.join(source_dir, file_name), target_dir)
  File "/usr/lib/python3.10/shutil.py", line 814, in move
    raise Error("Destination path '%s' already exists" % real_dst)
shutil.Error: Destination path '/storage/analytics/stage/vcenter-all.vpxd.drs.7_0u1_ph-vpxd-1218e9be-0323-4af0-8756-5846ad135f18_processed_logs' already exists
yyyy-mm-dd ERROR vmware_b2b.patching.phases.patcher Patch hook Patch got ComponentWrapperError.
Traceback (most recent call last):
  File "/storage/seat/software-updateub3xs7ou/stage/scripts/patches/py/vmware_b2b/patching/phases/patcher.py", line 208, in patch
    _patchComponents(ctx, userData, statusAggregator.reportingQueue)
  File "/storage/seat/software-updateub3xs7ou/stage/scripts/patches/py/vmware_b2b/patching/phases/patcher.py", line 90, in _patchComponents
    executeComponentHook(Hook.Patch, ctx, c, userData, reportingQueue)
  File "/storage/seat/software-updateub3xs7ou/stage/scripts/patches/py/vmware_b2b/patching/executor/execution_facade.py", line 97, in executeComponentHook
    result = executeHook(c.patchScript, hook, args,
  File "/storage/seat/software-updateub3xs7ou/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/seat/software-updateub3xs7ou/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor_process.py", line 119, in executeHook
    raise ex
patch_errors.ComponentError

Environment

VMware vCenter Server 8.0.x

Cause

Starting with vCenter 8.0 Update 3, the analytics service stores telemetry log files in a new directory. In rare cases, if previous update attempts had failed and reverted, when patching to vCenter 8.0 Update 3, the attempt to copy the telemetry log files to the new location might fail because these files already exist from a prior patching attempt.

Resolution

After ensuring that a valid snapshot of the vCenter server (Offline snapshot in case of Enhanced Linked Mode) is present, take an SSH session to the vCenter server. Please proceed with the deletion of all files under the following locations:

  • /storage/log/vmware/analytics/stage
  • /storage/log/vmware/analytics/prod
  • /storage/analytics/stage
  • /storage/analytics/prod

Afterwards, retry the patch update again.

Additional Information