Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

401 Unauthorized: Credentials were missing or incorrect while trying to access templeton status

Highlighted

401 Unauthorized: Credentials were missing or incorrect while trying to access templeton status

Expert Contributor

Hi Folks,

We have setup WebHCat on the HDP 2.4.x setup. Going to Ambari Server and checking the status ( Ambari -> Services -> Hive -> WebHCatServer) shows green/started. Now on trying to access through the putty/terminal

curl -i -u ambariAdmin:adminPassword http://<TemplatetonServer>:50111/templeton/v1/status

, I am issuing curl command like following. (This is the same admin user id password I use to login to Ambari web interface), but the console shows me :

curl -i -u ambariAdmin:adminPassword http://<TemplatetonServer>:50111/templeton/v1/status


<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 401 Authentication required</title>
</head>
<body>
<h2>HTTP ERROR: 401</h2>
<p>Problem accessing /templeton/v1/status. Reason:
<pre>    Authentication required</pre></p>

Not sure if I am missing something.

It would be great if someone can help me figure it out.

Thanks.

SS.

4 REPLIES 4

Re: 401 Unauthorized: Credentials were missing or incorrect while trying to access templeton status

New Contributor

@Smart Solutions

As you are connecting to the templeton REST API server you will not use the same REST calling syntax as Ambari. Thus, you can drop the '-u ambariAdmin:adminPassword' clause in your REST Request.

When I want status for the templeton server I use the call:

curl -s 'http://<TemplatetonServer>:50111/templeton/v1/status'

Re: 401 Unauthorized: Credentials were missing or incorrect while trying to access templeton status

Expert Contributor

Thanks @mjohnson , as per the suggestion I removed -u id:pw option and now I m running :

curl -s 'http://localhost:50111/templeton/v1/status'

But still I see the same problem.

<title>Error 401 Authentication required</title>
</head>
<body>
<h2>HTTP ERROR: 401</h2>
<p>Problem accessing /templeton/v1/status. Reason:
<pre>    Authentication required</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>

Re: 401 Unauthorized: Credentials were missing or incorrect while trying to access templeton status

@Smart Solutions

Is your cluster Kerberos?

Secure Cluster

To run WebHCat on a secure cluster follow the Permissions instructions above but create a Kerberos principal for the WebHCat server with the nameUSER/host@realm.

Also, set the WebHCat configuration variables templeton.kerberos.principal and templeton.kerberos.keytab.

curl -&-negotiate -u:http://cluster.$PRINCIPAL.$REALM:50111/templeton/v1/status 

Re: 401 Unauthorized: Credentials were missing or incorrect while trying to access templeton status

Expert Contributor

Thanks @SBandaru.

Yes this is a Kerberized cluster.

I am looking at the document but permission part it is not clear which user should I add for impersonation. When I see the custom core-site xml , I see already hadoop.proxyuser.hcat.groups and hadoop.proxyuser.hcat.hosts are set to *.

Do I need add any more entries?

I also see templeton.kerberos.principal is set to HTTP/_HOST@MyREALMName and templeton.kerberos.keytab to /etc/security/keytabs/spnego.service.keytab.

I don't understand what to fill in for the following values?

1) cluster

2) .$PRINCIPAL.$REALM

The value $PRINCIPAL.$REALM is it : spnego.MyRealm ?

curl -&-negotiate -u:http://cluster.$PRINCIPAL.$REALM:50111/templeton/v1/status