I had the same issues and wanted to update with what I debugged and how I fixed it.
I pulled back the environment that the user was running through the ambari-sudo script. The quick test is
/var/lib/ambari-agent/ambari-sudo.sh su hdfs -l -s /bin/bash -c 'env' That showed me that there were http_proxy values being set which I found out was because of the default env variables that are being source from /etc/profile.d/ directory.
For my fix, I just added the local machines to no_proxy and the install went forward.
Hope that helps
... View more