Thanks @Jay Kumar SenSharma ! The no_proxy was what was missing, but the curl -iv flag in this answer was what helped me figure out why it worked on one machine but not the other. So I put this as the accepted answer and gave the other one a vote.
... View more
I am setting up a test cluster and have some issues with the Ambari REST-API. I get a 403 error whenever I use localhost, but it works when I use FQDN. This works: curl -u admin:admin -H "X-Requested-by:ambari" -i -k -X GET https://<FQDN>:8443/api/v1/clusters/<CLUSTERNAME>/services/ This does not work: curl -u admin:admin -H "X-Requested-by:ambari" -i -k -X GET https://127.0.0.1:8443/api/v1/clusters/<CLUSTERNAME>/services/ The latter returns: HTTP/1.1 403 Forbidden Cache-Control: no-cache Pragma: no-cache
Content-Type: text/html; charset=utf-8 Proxy-Connection: close
curl: (56) Received HTTP code 403 from proxy after CONNECT We have other clusters where the setup looks identical to me and calls using FQDN and localhost works just fine. I can't figure out why it does not work in this case. I need localhost to work because commands like ambari-server sync-ldap are using the REST-API with localhost behind the scenes. Currently when I run ambari-server sync-ldap --groups=/root/groups.txt I get: Syncing specified users and groups.ERROR: Exiting with exit code 1.
REASON: Sync event creation failed. Error details: <urlopen error Tunnel connection failed: 403 Forbidden>
... View more