"ERROR: insert or update on table "vpx_entity" violates foreign key constraint "fk_vpx_ent_ref_vpx_ent_type" when upgrading vCenter Server
search cancel

"ERROR: insert or update on table "vpx_entity" violates foreign key constraint "fk_vpx_ent_ref_vpx_ent_type" when upgrading vCenter Server

book

Article ID: 345430

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
  • Upgrading from vCenter Server 6.0 U3g/U3h deployed with embedded Postgres DB to vCenter Server 6.5 U2b/U2c (vPostgres DB) fails.
  • Upgrading from vCenter Server 6.0 U3g/U3h deployed with embedded Postgres DB to vCenter Server 6.7a/6.7b/6.7c/6.7d (vPostgres DB) fails.
  • These issues are observed when the vCenter Server database is migrated from Postgres to vPostgres.
  • The Upgrade failure may contain entries like:

    VMware VirtualCenter failed firstboot. An error occurred while invoking external command : 'Command: ['/usr/sbin/vpxd', '-L'] Stderr: '
  • In the /var/log/firstboot/vpxd_firstboot.py_xxxx_stderr.log file, you see entries similar to:

    2018-08-16T14:37:41.559Z   VirtualCenter firstboot failed
     
  • In the /var/log/vmware/vpxd/vcdb_import.err file, you see entries similar to:

    pg_restore: [archiver] unsupported version (1.13) in file header
    pg_restore: [archiver] unsupported version (1.13) in file header

     
  • In the /var/log/vmware/vpxd/vpxd.log file, you see entries similar to:

    2018-08-16T14:37:41.554Z error vpxd[7F9037595800] [Originator@6876 sub=Main] Init failed. VdbError: Error[VdbODBCError] (-1) "ODBC error: (23503) - ERROR: insert or update on table "vpx_entity" violates foreign key constraint "fk_vpx_ent_ref_vpx_ent_type";
    --> Error while executing the query" is returned when executing SQL statement "INSERT INTO VPX_ENTITY (ID, NAME, TYPE_ID, PARENT_ID) VALUES (?, ?, ?, ?)"
    --> Backtrace:


    Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.


Cause

This issue occurs because the upgrade and migration paths from vCenter Server 6.0 Update 3g deployed with embedded Postgres DB to vCenter Server 6.5 and 6.7 are not supported. For more information, see the VMware vCenter Server 6.0 Update 3g Release Notes.

Resolution

This is a known issue affecting upgrades and migration paths from vCenter Server 6.0 Update 3g deployed with embedded Postgres DB to vCenter Server 6.5 and 6.7.

This issue is resolved in vSphere 6.5 Update 2d and 6.7 Update 1, available at VMware Downloads.

Additional Information

For More information on: Disclaimer: VMware is not responsible for the reliability of any data, opinions, advice, or statements made on third-party websites. Inclusion of such links does not imply that VMware endorses, recommends, or accepts any responsibility for the content of such sites.