vCenter Server Upgrade Fails with Foreign Key Constraint Violation on vpx_host_crypto_tag_keys
search cancel

vCenter Server Upgrade Fails with Foreign Key Constraint Violation on vpx_host_crypto_tag_keys

book

Article ID: 453471

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

During the upgrade of VMware vCenter Server to version 9.1.0.0300, the installation process fails. The upgrade script fails, and the following error appears in the upgrade logs.

Log location :/var/log/vmware/vpxd/vcdb_inplace.err

ERROR: insert or update on table "vpx_host_crypto_tag_keys" violates foreign key constraint "fk_vpx_host_crypto_tag_keys" DETAIL: Key (key_id)=(####) is not present in table "vpx_host_crypto_keys".

 

Environment

  • Product: vCenter Server
  • Release: 9.1.0.0300
  • Component: Installation/Upgrades

Cause

Orphaned records exist in the vc.vpx_host_crypto_tag_keys table. The upgrade process attempts to enforce a foreign key constraint requiring that every key_id in the tag table must exist in the primary vc.vpx_host_crypto_keys table.

Resolution

 Log in to the Source vCenter

SSH into your source vCenter Server Appliance (VCSA) using the root account.

Take an offline snapshot or valid backup of the vCenter Server Appliance (VCSA) before proceeding.

  1. Log in to the vCenter Server Appliance via SSH using the root account.
  2. Connect to the vPostgres database utility: /opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB
  3. Delete the orphaned records.

NOTE : To Delete the records reach out to Broadcom Support. 

4:Exit the database utility: \q

5: Retry the vCenter Server upgrade.