API uri using /node errors out with message "Error proxying request to: ####0bb4-####-11ea-####-b859########."
https://<nsx-manager>/api/v1/transport-nodes/<edge-id>/node
above api returns the below error.
{
"error_code": 36580,
"error_message": "Error proxying request to: ####0bb4-####-11ea-####-b859########.",
"module_name": "node-services"
}
VMware NSX
Indirect curl request made for CentralAPI on edge node is unable to connect to localhost over port 7441, which serves Node API server.
curl: (7) Failed to connect to localhost port 7441: Connection refused
Validate the hosts file to make sure there is an entry for localhost with ip 127.0.0.1 to handle the Central API request over port 7441.
Non-working output of /etc/hosts file:
127.0.0.1 edge01 ---------------------> It should be updated as "localhost"
10.#.160.# edge01
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Workaround:
On Edge cli, root mode.
cat /etc/hosts
127.0.0.1 localhost --------------------> Updated
10.#.160.# edge01
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Logs to validate:
From edge node, var/log/syslog:
2024-09-17T13:29:02.567Z edge01 NSX 1667 - [nsx@6876 comp="nsx-edge" subcomp="mpa-client" tid="1694" level="INFO"] [PlatformManagement] MpaClientHostService Received: Msg type (com.vmware.nsx.platform_management.CentralApiRequestMsg)corelationId (f13d####-5f19-####-b67b-1af2######) from APH (ffa3####-95cb-####-b71c-9785########)
2024-09-17T13:29:02.567Z edge01 NSX 1667 - [nsx@6876 comp="nsx-edge" subcomp="platform-client" tid="1694" level="INFO"] [HandleMsg] Received Message from MPA [8]
2024-09-17T13:29:02.567Z edge01 NSX 1667 - [nsx@6876 comp="nsx-edge" subcomp="platform-client" tid="1694" level="INFO"] Unhandled BSON Type [0]
2024-09-17T13:29:02.567Z edge01 NSX 1667 - [nsx@6876 comp="nsx-edge" subcomp="platform-client" tid="1694" level="INFO"] ProcessReceiveMessages: correlationId: f13d####-5f19-####-b67b-1af2######
2024-09-17T13:29:02.567Z edge01 NSX 1667 - [nsx@6876 comp="nsx-edge" subcomp="platform-client" tid="1694" level="INFO"] Typeid:com.vmware.nsx.platform_management.CentralApiRequestMsg
2024-09-17T13:29:02.590Z edge01 NSX 1667 - [nsx@6876 comp="nsx-edge" subcomp="platform-client" tid="1694" level="ERROR" errorCode="MPA80012"] [ProcessApiRequest] error invoke central api request, rc:7, output:, error:curl: (7) Failed to connect to localhost port 7441: Connection refused