There was an error connecting to NSX manager API
A quick issue I ran into yesterday connecting a restful API client to an NSX manager – “there was an error connecting”. ย As I had connected to this manager before using an API client, I knew that it was accessible at least at some point in the past. ย I covered all the bases of general connectivity troubleshooting at the network layer. ย However, this issue “there was an error connecting to NSX manager API” turned out to be something totally different.
There was an error connecting to NSX manager API
Below is the error received connecting with an API client to the NSX manager IP address:
After ruling out general network connectivity issues, I decided to take a look at the administrative interface of the NSX manager itself to see if there were any obvious errors. ย To do that simply browse to https://<nsx manager IP>. ย Underย componentsย andย NSX management service I saw aย disconnected error on theย Lookup service URL.
When I tried to reconnect the Lookup service URL, I received an errorย “Time is not synchronized between NSX Manager and vCenter Server.” ย It appears that time is not just important in Active Directory environments! ย Sure enough when looking under the general settings the NSX manager time was in the wrong time zone and incorrectly configured.
I simply had to edit the time settings and allow the manager to synchronize the correct time.
After setting up the time, I had to go back to the NSX Management service and reestablish connectivity for the Lookup service URL with vCenter. ย After this step was completed and I had the connected green light, I was ready to try connecting again.
Immediately, after the time issue was corrected on the server with time sync as well as the lookup service URL, the connection from my API client to the NSX manager started to work.
Thoughts
This illustrates in a vCenter environment, it is important to make sure that time synchronization is configured correctly. ย Most enterprise systems whether it be Microsoft, VMware or others, start having issues with systems reporting different times. ย So if you receive the error:ย There was an error connecting to NSX manager API, once you rule out general connectivity issues, your problem may be with your time configuration. ย Hope this helps someone else out there who may run into this issue.