Error"Exception occurred in postInstallHook for autodeploy:Contract"
search cancel

Error"Exception occurred in postInstallHook for autodeploy:Contract"

book

Article ID: 385916

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Updating to vCenter 8.0 U2 is failing with "ERROR: Exception occurred in postInstallHook for autodeploy:Contract. Please check the logs for more details. Take corrective action and then resume."

Environment

vCenter Server 8.0

Cause

Failure in AutoDeploy Contract Hook 

PatchRunner.log

2024-11-27T22:50:01.127Z autodeploy:Contract ERROR autodeploy.autodeploy_patch Failed to patch autodeploy: no such table: config_pairs
 Traceback (most recent call last):
   File "/storage/seat/software-update2_ce09l8/stage/scripts/patches/payload/components-script/autodeploy/autodeploy_patch.py", line 293, in contract
     _cleanupTlsConfig(conn)
   File "/storage/seat/software-update2_ce09l8/stage/scripts/patches/payload/components-script/autodeploy/autodeploy_patch.py", line 179, in _cleanupTlsConfig
     dbConnection.execute(
 sqlite3.OperationalError: no such table: config_pairs
 2024-11-27T22:50:01.128Z autodeploy:Contract ERROR vmware_b2b.patching.executor.hook_executor Patch hook 'autodeploy:Contract' failed.
 Traceback (most recent call last):
   File "/storage/seat/software-update2_ce09l8/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor.py", line 74, in executeHook
     executionResult = systemExtension(args)
   File "/storage/seat/software-update2_ce09l8/stage/scripts/patches/libs/sdk/extensions.py", line 106, in __call__
     result = self.extension(*args)
   File "/storage/seat/software-update2_ce09l8/stage/scripts/patches/libs/sdk/extensions.py", line 123, in _func
     return func(*args)
   File "/storage/seat/software-update2_ce09l8/stage/scripts/patches/payload/components-script/autodeploy/autodeploy_patch.py", line 293, in contract
     _cleanupTlsConfig(conn)
   File "/storage/seat/software-update2_ce09l8/stage/scripts/patches/payload/components-script/autodeploy/autodeploy_patch.py", line 179, in _cleanupTlsConfig
     dbConnection.execute(
 sqlite3.OperationalError: no such table: config_pairs
 2024-11-27T22:50:01.148Z ERROR vmware_b2b.patching.phases.patcher Patch hook Patch got ComponentWrapperError.
 Traceback (most recent call last):
   File "/storage/seat/software-update2_ce09l8/stage/scripts/patches/py/vmware_b2b/patching/phases/patcher.py", line 212, in patch
     executeComponentsHook(Hook.Contract, ctx, userData, statusAggregator.reportingQueue)
   File "/storage/seat/software-update2_ce09l8/stage/scripts/patches/py/vmware_b2b/patching/utils/phase_utils.py", line 98, in executeComponentsHook
     executeComponentHook(hook, ctx, c, userData, reportingQueue)
   File "/storage/seat/software-update2_ce09l8/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-update2_ce09l8/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-update2_ce09l8/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor_process.py", line 119, in executeHook
     raise ex
 patch_errors.ComponentError
 2024-11-27T22:50:02.151Z WARNING root stopping status aggregation...
 2024-11-27T22:50:02.152Z ERROR __main__ Patch vCSA failed

 

There is an empty db file at the old location of AutoDeploy DB (/var/lib/rbd/db) and the problem is that the code during the update will move this file on top of the "real AutoDeploy DB located at the new DB location (/etc/vmware-rbd/db/db) simply because the file at the old location exists.

 

Resolution

  1. Confirm if the file exists at the old location of AutoDeploy DB -----> PatchRunner.log

 "patchable": true, 
 "replicationConfig": {
        "/storage/autodeploy/cache/vital": "/storage/autodeploy/cache/vital",
        "/var/lib/rbd/.source_version": "/var/lib/rbd/.source_version",
        "/var/lib/rbd/db": "/etc/vmware-rbd/db/db"                         <-------------------------------------------------------

     2. Confirm the file is of 0 length ls -ltrh /var/lib/rbd/db   

     3.  Rename the file in /var/lib/rbd/db to db.old

mv db db.old

     4. Patch vCenter