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.

getting server error instead of authentication required using curl apis

Highlighted

getting server error instead of authentication required using curl apis

New Contributor

Hi I'm rookey in hadoop ,

I have configured kerberos on two different hadoop servers .

Now with one server when I run following command I see Authentication required

curl -v -X PUT -u: http://hadoop1:50070/webhdfs/v1/tk?op=CREATESNAPSHOT * About to connect() to hadoop1 port 50070 (#0) * Trying 192.168.0.1... connected * Connected to hadoop1 (192.168.0.1) port 50070 (#0) * Server auth using Basic with user '' > PUT /webhdfs/v1/tk?op=CREATESNAPSHOT HTTP/1.1 > Authorization: Basic Og== > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: hadoop1:50070 > Accept: */* > < HTTP/1.1 401 Authentication required

but for other I see server error

curl -v -X PUT -u: http://hadoop2:50070/webhdfs/v1/tk?op=CREATESNAPSHOT * About to connect() to hadoop2 port 50070 (#0) * Trying 192.168.0.2... connected * Connected to hadoop2 (192.168.0.2) port 50070 (#0) * Server auth using Basic with user '' > PUT /webhdfs/v1/tk?op=CREATESNAPSHOT HTTP/1.1 > Authorization: Basic Og== > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: hadoop2:50070 > Accept: */* > < HTTP/1.1 500 Internal Server Error

but curl -X PUT --negotiate -u: http://hadoop2:50070/webhdfs/v1/tk?op=CREATESNAPSHOT works perfectly fine, not sure whats missing at hadoop2 server configuration

3 REPLIES 3
Highlighted

Re: getting server error instead of authentication required using curl apis

Check the logs in hadoop2 hard to tell why you see a 500 error without looking at the logs

Highlighted

Re: getting server error instead of authentication required using curl apis

New Contributor

I see following error

curl -v http://hadoop2:50070/webhdfs/v1/tk?op=LISTSTATUS

* About to connect() to hadoop port 50070 (#0)

* Trying 192.168.0.2... connected

* Connected to hadoop2 (192.168.0.2) port 50070 (#0)

> GET /webhdfs/v1/tk?op=LISTSTATUS HTTP/1.1

> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2

> Host: hadoop2:50070

> Accept: */*

>

< HTTP/1.1 401 Authentication required

< Cache-Control: must-revalidate,no-cache,no-store

< Date: Tue, 04 Sep 2018 09:12:05 GMT

< Pragma: no-cache < Content-Type: text/html; charset=iso-8859-1

< X-FRAME-OPTIONS: SAMEORIGIN

< X-Frame-Options: SAMEORIGIN

< X-XSS-Protection: 1; mode=block

< Set-Cookie: JSESSIONID=xxxxxxxxxxxxxxxxxxxxx;Path=/;HttpOnly

< WWW-Authenticate: Negotiate

< Set-Cookie: hadoop.auth=; Path=/; Expires=Thu 01-Jan-1970 00:00:00 GMT; HttpOnly

< Content-Length: 1412

<

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>

<title>Error Occured</title>

</head>

<body>

<h2>Error Occured</h2> <p>Problem accessing /webhdfs/v1/tk. <hr /><i><small>Powered by Jetty://</small></i><br/>

<br/>

<br/>

for working setup I do see response like

< * Ignoring the response-body

* Connection #0 to host hadoop1 left intact

* Issue another request to this URL: 'http://hadoop1:50070/webhdfs/v1/tk?op=LISTSTATUS'

* Re-using existing connection! (#0) with host hadoop1

* Connected to hadoop1 (192.168.0.1) port 50070 (#0)

I don't see above response at non-working setup also at working setup I do not see following responses

< X-Frame-Options: SAMEORIGIN

< X-XSS-Protection: 1; mode=block

< Set-Cookie: JSESSIONID=xxxxxxxxxxxxxxxxxxxxx;Path=/;HttpOnly

Is there anything missed on server side? is it something relevant to session id or X-XSS-Protection? could not find anything significant at yarn-root-resourcemanager-hadoop2.log and hadoop-root-namenode-hadoop2.log

Highlighted

Re: getting server error instead of authentication required using curl apis

New Contributor

Hey, You will be glad to know that here we are having one of the best portal how to find specs on windows 10 which will make your work all easier in order to know about specification in your windows 10.

Don't have an account?
Coming from Hortonworks? Activate your account here