"Error code 500127" when creating a NAT rule on NSX-T backed OVDC in VMware Cloud Director
book
Article ID: 372116
calendar_today
Updated On:
Products
VMware Cloud Director
Issue/Introduction
While trying to create a NAT Rule in an Org VDC backed by NSX-T, it fails with below error in VMware Cloud Director:
ERROR: [ cxxxxxx6-3xx4-xxxf-axx6-09xxxxxx7 ] Internal Server Error - java.util.concurrent.ExecutionException: com.vmware.vcloud.common.network.VsmException: Bad Request: Cannot create an object with path=[/infra/services/VCD-INTERNAL-TCP-1433] as it already exists., error code 500127
Note: In this case the NAT rule is being created with port number 1433
Environment
VMware Cloud Director 10.x
Cause
This issue happens when the application port profile created as part of the NAT rule is not available anymore in the vCD DB. However, it is present in the NSX-T Manager.
This issue can also be seen when application port profiles being out of sync between vCD and NSX-T.
Resolution
Check if the corresponding NAT rule is present in the vCD database:
Connect to vCD database from the primary cell: sudo -su postgres psql vcloud
Run the query to check the availability of NAT rule: select * from application_port_profile where backing_path like '/infra/services/VCD-INTERNAL-TCP-1433';
If the output of the above db command returns nothing, sync the application port profiles between vCD and NSX-T using vCD API:
PUT https://vcd_host/cloudapi/1.0.0/applicationPortProfiles/sync?filter=networkProviderId==URN_ID_OF_NSXT_MANAGER
How to establish an API connection to VMware Cloud Director, click here