<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: curl command failing in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176822#M139072</link>
    <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/10115/sahmad43.html" nodeid="10115"&gt;@Sami Ahmad&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;You have to use negotiate for all the curl calls&lt;/P&gt;&lt;PRE&gt;curl --negotiate -u -H "Accept: text/xml" &lt;A href="http://hadoop1:17001/version" target="_blank"&gt;http://hadoop1:17001/version&lt;/A&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 29 Jun 2018 22:04:45 GMT</pubDate>
    <dc:creator>asirna</dc:creator>
    <dc:date>2018-06-29T22:04:45Z</dc:date>
    <item>
      <title>curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176821#M139071</link>
      <description>&lt;P&gt;my rest server is up and running and the following command works&lt;/P&gt;&lt;PRE&gt;[root@hadoop1 ~]# curl --negotiate -u : 'http://hadoop1:17001/status/cluster'
1 live servers, 0 dead servers, 6.0000 average load
1 live servers
    hadoop5.xxx.com:16020 1530282635984
        requests=0, regions=6
        heapSizeMB=145
        maxHeapSizeMB=2007
&lt;/PRE&gt;&lt;P&gt;but the other curl commands are failing with authentication error . I have a Kerberos ticket acquired from&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/etc/security/keytabs/hbase.service.keytab&lt;/P&gt;&lt;PRE&gt;[root@hadoop1 ~]# curl -H "Accept: text/xml" &lt;A href="http://hadoop1:17001/version" target="_blank"&gt;http://hadoop1:17001/version&lt;/A&gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/&amp;gt;
&amp;lt;title&amp;gt;Error 401 Authentication required&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;&amp;lt;h2&amp;gt;HTTP ERROR 401&amp;lt;/h2&amp;gt;
&amp;lt;p&amp;gt;Problem accessing /version. Reason:
&amp;lt;pre&amp;gt;    Authentication required&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;hr /&amp;gt;&amp;lt;i&amp;gt;&amp;lt;small&amp;gt;Powered by Jetty://&amp;lt;/small&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;br/&amp;gt;                                           
&amp;lt;br/&amp;gt;

&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jun 2018 21:56:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176821#M139071</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-29T21:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176822#M139072</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/10115/sahmad43.html" nodeid="10115"&gt;@Sami Ahmad&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;You have to use negotiate for all the curl calls&lt;/P&gt;&lt;PRE&gt;curl --negotiate -u -H "Accept: text/xml" &lt;A href="http://hadoop1:17001/version" target="_blank"&gt;http://hadoop1:17001/version&lt;/A&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jun 2018 22:04:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176822#M139072</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-06-29T22:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176823#M139073</link>
      <description>&lt;P&gt;also this command works &lt;/P&gt;&lt;PRE&gt;# curl --negotiate -i -u : -X GET -H "Accept: text/xml" &lt;A href="http://$(hostname):17001/" target="_blank"&gt;http://$(hostname):17001/&lt;/A&gt;
HTTP/1.1 401 Authentication required
WWW-Authenticate: Negotiate
Set-Cookie: hadoop.auth=; Path=/; HttpOnly
Content-Type: text/html; charset=iso-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1393
HTTP/1.1 200 OK
Set-Cookie: hadoop.auth="u=hbase&amp;amp;p=hbase/hadoop1.xxx.com@XXX.US&amp;amp;t=kerberos&amp;amp;e=1530321348642&amp;amp;s=D797P7EN3+vVCB0S2WblChieQrs="; Path=/; HttpOnly
Content-Type: text/xml
Cache-Control: no-cache
Content-Length: 141
&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&amp;lt;TableList&amp;gt;&amp;lt;table name="UFM"/&amp;gt;&amp;lt;table name="WZ"/&amp;gt;&amp;lt;table name="state_code"/&amp;gt;&amp;lt;/TableList&amp;gt;[root@hadoop1 ~]#

&lt;/PRE&gt;&lt;P&gt;but this command fails &lt;/P&gt;&lt;PRE&gt;# curl -H "Accept: text/xml" &lt;A href="http://$(hostname):17001/" target="_blank"&gt;http://$(hostname):17001/&lt;/A&gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/&amp;gt;
&amp;lt;title&amp;gt;Error 401 Authentication required&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;&amp;lt;h2&amp;gt;HTTP ERROR 401&amp;lt;/h2&amp;gt;
&amp;lt;p&amp;gt;Problem accessing /. Reason:
&amp;lt;pre&amp;gt;    Authentication required&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;hr /&amp;gt;&amp;lt;i&amp;gt;&amp;lt;small&amp;gt;Powered by Jetty://&amp;lt;/small&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;br/&amp;gt;                                           
&amp;lt;br/&amp;gt;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jun 2018 22:23:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176823#M139073</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-29T22:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176824#M139074</link>
      <description>&lt;P&gt;ok I will use negotiate  ..can you tell why I am not seeing the right formatted output of table names but I see "&amp;lt;" "&amp;gt;" around them ?&lt;/P&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&amp;lt;TableList&amp;gt;&amp;lt;table name="UFM"/&amp;gt;&amp;lt;table name="WZ"/&amp;gt;&amp;lt;table name="state_code"/&amp;gt;&amp;lt;/TableList&amp;gt;[root@hadoop1 ~]#
&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jun 2018 22:28:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176824#M139074</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-29T22:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176825#M139075</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/10115/sahmad43.html" nodeid="10115"&gt;@Sami Ahmad&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;This is not an issue. You can use some xml formatter to pretty print it since you are getting proper results.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 22:45:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176825#M139075</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-06-29T22:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176826#M139076</link>
      <description>&lt;P&gt;I am getting the proper results .. the tables are there in the xml list  "UFM" "WZ" ,   how can I make them appear in normal format  like ?&lt;/P&gt;&lt;P&gt;UFM&lt;/P&gt;&lt;P&gt;WZ &lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 23:02:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176826#M139076</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-29T23:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176827#M139077</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10115/sahmad43.html" nodeid="10115"&gt;@Sami Ahmad&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;You need to use some XML parsers to parse the results and get the table names to get the desired output you want.&lt;/P&gt;&lt;P&gt;&lt;A href="https://unix.stackexchange.com/questions/83385/parse-xml-to-get-node-value-in-bash-script" target="_blank"&gt;https://unix.stackexchange.com/questions/83385/parse-xml-to-get-node-value-in-bash-script&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 23:09:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176827#M139077</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-06-29T23:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176828#M139078</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="77874-capture.jpg" style="width: 607px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19642iE2E9F1DF69DD7599/image-size/medium?v=v2&amp;amp;px=400" role="button" title="77874-capture.jpg" alt="77874-capture.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;please see above , this is from the hortonworks document , how they are able to get the right output without any xml parsing ?</description>
      <pubDate>Sun, 18 Aug 2019 09:51:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176828#M139078</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2019-08-18T09:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176829#M139079</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/10115/sahmad43.html" nodeid="10115"&gt;@Sami Ahmad&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;To get output in the above format you should not pass the "Accept: text/xml" header. Just try hitting&lt;/P&gt;&lt;PRE&gt;curl --negotiate -u &lt;A href="http://hadoop1:17001" target="_blank"&gt;http://hadoop1:17001&lt;/A&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jun 2018 23:57:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176829#M139079</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-06-29T23:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176830#M139080</link>
      <description>&lt;P&gt;he doesn't like the syntax of this &lt;/P&gt;&lt;PRE&gt;# curl --negotiate -u &lt;A href="http://hadoop1:17001" target="_blank"&gt;http://hadoop1:17001&lt;/A&gt;
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information

&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jun 2018 01:08:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176830#M139080</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-30T01:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: curl command failing</title>
      <link>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176831#M139081</link>
      <description>&lt;P&gt;oh the following syntax worked &lt;/P&gt;&lt;PRE&gt;[root@hadoop1 ~]# curl --negotiate -i -u : -X GET -H "Accept: text" &lt;A href="http://$(hostname):17001/" target="_blank"&gt;http://$(hostname):17001/&lt;/A&gt;
HTTP/1.1 401 Authentication required
WWW-Authenticate: Negotiate
Set-Cookie: hadoop.auth=; Path=/; HttpOnly
Content-Type: text/html; charset=iso-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1393
HTTP/1.1 200 OK
Set-Cookie: hadoop.auth="u=hbase&amp;amp;p=hbase/hadoop1.xxx.com@XXX.US&amp;amp;t=kerberos&amp;amp;e=1530331783162&amp;amp;s=Ypuvww45JSzCbQwTbc5ysWmaSfI="; Path=/; HttpOnly
Content-Type: text/plain
Cache-Control: no-cache
Content-Length: 18
UFM
WZ
state_code

&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jun 2018 01:11:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/curl-command-failing/m-p/176831#M139081</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-30T01:11:03Z</dc:date>
    </item>
  </channel>
</rss>

