When you attempt to patch or upgrade vCenter Server Appliance, the operation fails during the post-installation phase with the error message:
Installation Failed Exception occurred in postInstallHook for vcintegrity Patch. Please check the logs for more details. Take corrective action and then resume.
The patch operation fails specifically during the database schema upgrade phase for the vSphere Lifecycle Manager (vLCM) component. In /var/log/vmware/applmgmt/PatchRunner.log, you see the error:
Failed to upgrade database schema. return code: 204
The root cause is found in /var/log/vmware/applmgmt/update_microservice.log, which shows a PostgreSQL error when attempting to create a database type that already exists:
[DATABASE] Vdb::RunScript, SQL Exec Error: "ODBC error: (42710) - ERROR: type "lccm_lifecycle_state" already exists;
Error while executing the query" is returned when executing SQL statement "CREATE TYPE lccm_lifecycle_state AS ENUM (
'POST_PROVISIONING',
'POST_POWER_ON'
)"
This database inconsistency prevents the vcIntegrity patch hook from completing successfully, causing the entire vCenter patch or upgrade operation to fail. The vCenter Server remains on its current version and cannot be updated until the vLCM database is reset.
Additional symptoms reported:
vCenter Server 7.x and newer
During a vCenter Server patch or upgrade, the database schema upgrade process attempts to create new PostgreSQL database type objects in the vSphere Lifecycle Manager (vLCM) database. The upgrade script executes SQL statements to define these types, including the lccm_lifecycle_state enum type used to track lifecycle states during patching operations.
When the schema upgrade script attempts to create the lccm_lifecycle_state type, PostgreSQL returns SQLSTATE error code 42710, indicating that this database type object already exists. This prevents the CREATE TYPE statement from completing successfully. The failure cascades through the vcIntegrity component, which returns error code 204 to indicate the database schema upgrade failed, and ultimately causes the entire patch operation to terminate.
This condition most commonly occurs after a previous incomplete or failed patch attempt that partially created database objects without completing the full schema upgrade. The database type remains in the vLCM database from the incomplete operation, but the overall schema upgrade process did not complete successfully. When you retry the patch operation, the upgrade script attempts to create the same type again, encountering the duplicate object error.
This issue is more likely to occur when:
Note: Resetting the vLCM database removes custom baselines, custom images, and NSX VIBs. You will need to recreate any custom baselines or images after the resolution is complete.
Important: Before proceeding, create a powered-off snapshot of the vCenter Server VM to provide a rollback point:
To resolve this issue, reset the vSphere Lifecycle Manager database:
service-control --stop vmware-updatemgr
python /usr/lib/vmware-updatemgr/bin/updatemgr-utility.py reset-db
rm -rf /storage/updatemgr/patch-store/*
service-control --start vmware-updatemgr
If NSX-T is deployed in your environment (vCenter Server 7.0 U1 and later):
After completing the database reset, the NSX depot must be re-uploaded to vCenter. Follow Resetting the VMware Update Manager Database
Post-resolution verification:
After successfully completing the steps, the patch upgrade should succeed.
Identifying this issue before attempting a patch:
You can check for this specific database condition by examining the log files from a previous failed patch attempt:
grep -i "Failed to upgrade database schema. return code: 204" /var/log/vmware/applmgmt/PatchRunner.log
To check for the specific database type error:
grep -E "(lccm_lifecycle_state already exists|SQLState='42710')" /var/log/vmware/applmgmt/update_microservice.log
Log file locations:
The key error messages for this issue are found in:
/var/log/vmware/applmgmt/PatchRunner.log - Contains the vcIntegrity patch failure and return code 204/var/log/vmware/applmgmt/update_microservice.log - Contains the PostgreSQL SQLSTATE 42710 error showing which database type already existsRelated information:
For information about resetting the vLCM database and NSX-T recovery procedures, see Resetting the VMware Update Manager Database
For a different database schema upgrade issue involving the amcheck_next extension, see Upgrade or Patching to vCenter 7.0 Update 2 or later fails during vPostgres upgrade when amcheck_next extension is present in vCenter Database