<?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: Beeline command failing with error 4 in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381247#M244269</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/107114"&gt;@jayes&lt;/a&gt;&amp;nbsp;If we intend to use kerberos auth, we need to pass username in the connection string. Remove "&lt;SPAN&gt;user=loki" and also two usernames we passed using "-n".&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;-n loki -n /tmp/cmdcvhive.3935975.140226804802880&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;In &lt;A href="https://cwiki.apache.org/confluence/display/hive/hiveserver2+clients#HiveServer2Clients-BeelineCommandOptions" target="_blank" rel="noopener"&gt;Beeline&lt;/A&gt; '-n' is used to pass the username for authentication purpose. If we are using kerberos, then we can avoid this completely.&amp;nbsp; Please review your script and fix it wherever this is coming from. Unless we review the complete script, it will be difficult to say what's causing this issue.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Dec 2023 14:07:25 GMT</pubDate>
    <dc:creator>smruti</dc:creator>
    <dc:date>2023-12-26T14:07:25Z</dc:date>
    <item>
      <title>Beeline command failing with error 4</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/380991#M244200</link>
      <description>&lt;P&gt;Hello Team,&lt;BR /&gt;&lt;BR /&gt;I am running a process in which i am trying to run beeline command.&lt;BR /&gt;While running beeline command with sudo it is working but if i am trying to run beeline in a process which if forked from parent process with the hive user it is failing with error 4&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you please help me to debug what's going wrong or anything that i need to set.&lt;BR /&gt;&lt;BR /&gt;If i do su hiveuser and run the same command t works but while running via process it is failing.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Command that i see while running via fork process :&lt;/P&gt;&lt;P&gt;bash /opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p0.15945976/bin/../lib/hive/bin/beeline -u 'jdbc:hive2://machine1.domain.com:2181/default;password=***;principal=hive/_HOST@DOMAIN.COM;serviceDiscoveryMode=zooKeeper;ssl=true;sslTrustStore=/var/lib/cloudera-scm-agent/agent-cert/cm-auto-global_truststore.jks;trustStorePassword=*****;user=HiveUser;zooKeeperNamespace=hiveserver2' -n loki -n /tmp/cmdcvhive.4015998.140520474391872 --showHeader=false --outputformat=tsv2 -e 'use underscoretest; show tables;'&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 09:59:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/380991#M244200</guid>
      <dc:creator>jayes</dc:creator>
      <dc:date>2023-12-19T09:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Beeline command failing with error 4</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381060#M244218</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/107114"&gt;@jayes&lt;/a&gt;&amp;nbsp;Can you share the logs, its hard to say without looking at logs but just a hunch it can be because of Kerberos authentication.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 06:16:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381060#M244218</guid>
      <dc:creator>cloude</dc:creator>
      <dc:date>2023-12-21T06:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Beeline command failing with error 4</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381078#M244226</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/107114"&gt;@jayes&lt;/a&gt;&amp;nbsp;The beeline command seems to be using both kerberos(principal) and username-password based authentication? What's the auth mechanism we are aiming for? Also, what's the error message? When you fork it from another process, which user the beeline command runs as?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within the JDBC connection string, we are trying to authenticate as "HiveUser" however we are also using -n switch and authenticating as loki user. It's confusing. We need not use "-n" in this case.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 11:01:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381078#M244226</guid>
      <dc:creator>smruti</dc:creator>
      <dc:date>2023-12-21T11:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Beeline command failing with error 4</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381149#M244244</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/31734"&gt;@cloude&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Which logs should i share cause the moment the beeline command is launched in another process it fails. so i dont have a way to check why is it failing. it just says process exited with error 4.&lt;BR /&gt;&lt;BR /&gt;Can you please help here to know which logs file might have those error ?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 11:16:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381149#M244244</guid>
      <dc:creator>jayes</dc:creator>
      <dc:date>2023-12-22T11:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Beeline command failing with error 4</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381150#M244245</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/82698"&gt;@smruti&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;The setup has kerberos authentication.&amp;nbsp;&lt;BR /&gt;There is no error message the moment the process is launched with loki user, the process exits with error 4.&lt;BR /&gt;Sorry but the HiveUser and loki user is same its just replacing the username went wrong.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The same command when i do su loki and then run the same command it works. or if the same command is ran using sudo it works. Issue is with launching it with other process.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 11:20:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381150#M244245</guid>
      <dc:creator>jayes</dc:creator>
      <dc:date>2023-12-22T11:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Beeline command failing with error 4</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381151#M244246</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/107114"&gt;@jayes&lt;/a&gt;&amp;nbsp;please share the exact error. What do you mean error code 4? Is it exit code? The error must be getting logged to stdout/stderr. If nothing is getting logged, in the JDBC connection string could you also add "--verbose=true"&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;bash /opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p0.15945976/bin/../lib/hive/bin/beeline -u 'jdbc:hive2://machine1.domain.com:2181/default;password=***;principal=hive/_HOST@DOMAIN.COM;serviceDiscoveryMode=zooKeeper;ssl=true;sslTrustStore=/var/lib/cloudera-scm-agent/agent-cert/cm-auto-global_truststore.jks;trustStorePassword=*****;user=HiveUser;zooKeeperNamespace=hiveserver2' --showHeader=false --outputformat=tsv2 --verbose=true&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 Dec 2023 11:34:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381151#M244246</guid>
      <dc:creator>smruti</dc:creator>
      <dc:date>2023-12-22T11:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Beeline command failing with error 4</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381221#M244263</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/82698"&gt;@smruti&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Yes the exit code is 4.&lt;BR /&gt;&lt;BR /&gt;I tried to redirect the stdout and stderr to the file but there was no file created.&lt;BR /&gt;&lt;BR /&gt;Following is output of ps -eaf :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;loki 3936766 3935975 0 02:06 ? 00:00:00 bash /opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p0.15945976/bin/../lib/hive/bin/beeline -u 'jdbc:hive2://machine.domain.com:2181/default;password=**;principal=hive/_HOST@DEVEMC.COMMVAULT.COM;serviceDiscoveryMode=zooKeeper;ssl=true;sslTrustStore=/var/lib/cloudera-scm-agent/agent-cert/cm-auto-global_truststore.jks;trustStorePassword=***;user=loki;zooKeeperNamespace=hiveserver2' -n loki -n /tmp/cmdcvhive.3935975.140226804802880 --showHeader=false --outputformat=tsv2 --verbose=true -e 'use underscoretest; show tables;' &amp;gt;&amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;loki 3936766 3935975 2 02:06 ? 00:00:00 bash /opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p0.15945976/bin/../lib/hive/bin/beeline -u 'jdbc:hive2://machine.domain.com:2181/default;password=**;principal=hive/_HOST@DEVEMC.COMMVAULT.COM;serviceDiscoveryMode=zooKeeper;ssl=true;sslTrustStore=/var/lib/cloudera-scm-agent/agent-cert/cm-auto-global_truststore.jks;trustStorePassword=**;user=loki;zooKeeperNamespace=hiveserver2' -n loki -n /tmp/cmdcvhive.3935975.140226804802880 --showHeader=false --outputformat=tsv2 --verbose=true -e 'use underscoretest; show tables;' &amp;gt;&amp;gt; /tmp/file 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2023 07:13:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381221#M244263</guid>
      <dc:creator>jayes</dc:creator>
      <dc:date>2023-12-26T07:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Beeline command failing with error 4</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381247#M244269</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/107114"&gt;@jayes&lt;/a&gt;&amp;nbsp;If we intend to use kerberos auth, we need to pass username in the connection string. Remove "&lt;SPAN&gt;user=loki" and also two usernames we passed using "-n".&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;-n loki -n /tmp/cmdcvhive.3935975.140226804802880&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;In &lt;A href="https://cwiki.apache.org/confluence/display/hive/hiveserver2+clients#HiveServer2Clients-BeelineCommandOptions" target="_blank" rel="noopener"&gt;Beeline&lt;/A&gt; '-n' is used to pass the username for authentication purpose. If we are using kerberos, then we can avoid this completely.&amp;nbsp; Please review your script and fix it wherever this is coming from. Unless we review the complete script, it will be difficult to say what's causing this issue.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2023 14:07:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381247#M244269</guid>
      <dc:creator>smruti</dc:creator>
      <dc:date>2023-12-26T14:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Beeline command failing with error 4</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381266#M244277</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/82698"&gt;@smruti&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Please let me know if any way where we can have call or meet to review the script ?&lt;/P&gt;&lt;P&gt;I will in mean time will try to remove the -n options and check if that works.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 06:49:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-command-failing-with-error-4/m-p/381266#M244277</guid>
      <dc:creator>jayes</dc:creator>
      <dc:date>2023-12-27T06:49:22Z</dc:date>
    </item>
  </channel>
</rss>

