VMware Cloud Community
cool_ashfaque
Contributor
Contributor

"Encountered internal error" During Upgrade of vCenter 7.0.3 to vCenter 8.0 at Stage-2

Hi All,

I am trying to upgrade my vCenter 7.0.3 to vCenter 8.0 and it is getting error on Stage 2, error log file and screenshot I have attached. I tried 3 times but every time I am getting same error at same stage. Kindly help.

0 Kudos
6 Replies
MustafaSadek
Enthusiast
Enthusiast

If the VC hosted in othe physical host  vcenter . Try to restart the main vc and then check again 

0 Kudos
Dalaj
Contributor
Contributor

Same problem. On the second step, when I try to update 7.0.3 to 8 it always fails on
Upgrade import failed due to error Error while creating constraints: psql.bin:/storage/seat/cis-export-folder/vcdb/create_constr.sql:21: ERROR: relation "vsan_historical_health_2022_1_cluster_id_group_id_test_id__key2" already exists

0 Kudos
BaijuParambil
Contributor
Contributor

@cool_ashfaque @Dalaj Can you please try below steps on source vCenter Server :

  • Backup vCenter Server (Take Powered Off snapshot of all vCenter Servers if VC is part of Enhanced Linked Mode)
  • SSH to VCSA
  • Connect to Postgres Database using command - "/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres"
  • Execute below query in VCDB prompt

alter table vc.vsan_historical_health drop constraint uk_vsan_historical_health;

  • Execute below query to create a unique index

CREATE UNIQUE INDEX IF NOT EXISTS UK_VSAN_HISTORICAL_HEALTH on VC.VSAN_HISTORICAL_HEALTH (
CLUSTER_ID,
GROUP_ID,
TEST_ID,
CREATION_TIME
) TABLESPACE hs4;

  • Ideally, you can retry the upgrade after this step. If not, please share result of below Two queries and based on the result I can confirm if you are good to retry the upgrade

Query - 1

select i.relname idxname, t.relname tablename, idx.indisunique
from pg_index idx
join pg_class i on (idx.indexrelid = i.oid)
join pg_class t on (t.oid = idx.indrelid)
where t.relname like 'vsan_historical_health%'
and idx.indisunique = true;

Query - 2

select t.relname rablename, con.conname, con.contype
from pg_constraint con
join pg_class t on (t.oid = con.conrelid)
where t.relname like 'vsan_historical_health%';

  • Exit from VCDB using command \q
ArmexB
Contributor
Contributor

Same error for me in a lab-setup. Coming from VC7u3 to VC8

Error: "Upgrade import failed due to error Error while creating constraints: psql.bin:/storage/seat/cis-export-folder/vcdb/create_constr.sql:25: ERROR: relation "vsan_historical_health_2022_1_cluster_id_group_id_test_id__key2" already exists"

@BaijuParambil your proposed solution worked for me. Now migrated to VC8.

Just a short message (also for others) to confirm it worked. Thanks

maxyardley
Enthusiast
Enthusiast

I am having a similar issue however mine is related to a different service, "vmcam" opposed to "vpostgres" as OP had. I have attached a screenshot of my error as well and it always occurs during the "VMware vSphere Authentication Proxy" part of Stage-2. 

 

vcam.png

I found this KB from 6.5>6.7 which described this problem exactly as I have it in reference to firstboot logs on the destination vCenter instance, however I have verified that the "VMware vSphere Authentication Proxy" service is not running prior to the upgrade, and the installation still fails with the same error.

0 Kudos
maxyardley
Enthusiast
Enthusiast

In reference to the specific error I had:

Ensure that your "administrator" account (the one required by vCenter to upgrade) has permissions granted by the DCAdmins group under SSO > Users and Groups.

0 Kudos