VCSA 6.5 U1c – Error 503 – vpxd.log duplicate key value violates unique constraint

While trying to deploy an OVA/OVF today I kept experiencing Error 503’s and VCSA would become unavailable.  If I tried to reload the web client I’d see:

After poking around for a while, I checked vpxd.log (located in /var/log/vmware/vpxd/) and saw several concerning things such as:

--> Panic: Unrecoverable VmRootError. Panic!

and, ultimately:

[VdbStatement] SQLError was thrown: "ODBC error: (23505) - ERROR: duplicate key value violates unique constraint "pk_vpx_dvport_membership";

Ah!  Interesting.  After some searching I found the solution.  Take a snapshot of your VCSA or a backup of its Postgres DB.  SSH into your VCSA and run  service vmware-vpxd stop.  Then, connect to the Postgres DB by issuing the following:

root@kcloud1vcsa2 [ ~ ]# /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres

Next up, select some data from the VPX_DVS table:

Notice we get a vDS with  id of 25 and 9.  With that, run the following command but specify the values your output return for  DVS_ID :

Notice the column called  dvport_key.  Find the highest value, and add 1 for port_counter in the next statement.  For instance, in the output above, we’d be considering a value of 17 (16+1).  Now, run the following:

Obviously substitute your values.  You should get the “Update 1” return.  Once done for all vDS, quit the Postgres client by running:

VCDB-# \q

Finally, give your VCSA a reboot and you should be all fixed up!  Remember to delete your snapshot if you took one!

Thanks for reading let me know if you have this issue and whether or not the above fixes it.

Author: Jon

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share This
%d bloggers like this: