Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-25500

Hive Service Check Fails if the trustStorePassword has Special character $

    XMLWordPrintableJSON

    Details

      Description

      Problem statement : Hive Service Check Fails if the trustStorePassword has Special character $

      the error logs say :

      2020-04-10 08:20:14,748 - Execute['! (beeline -u 'jdbc:hive2://c4229-node3.coelab.cloudera.com:10000/;transportMode=binary;ssl=true;sslTrustStore=/tmp/keystore1.jks;trustStorePassword=[PROTECTED]' -n hive -e ';' 2>&1 | awk '{print}' | grep -vz -i -e 'Connected to:' -e 'Transaction isolation:' -e 'inactive HS2 instance; use service discovery')'] {'path': ['/bin/', '/usr/bin/', '/usr/lib/hive/bin/', '/usr/sbin/'], 'timeout_kill_strategy': 2, 'timeout': 30, 'user': 'ambari-qa'}
      2020-04-10 08:20:19,509 - Connection to c4229-node3.coelab.cloudera.com on port 10000 failed
      2020-04-10 08:20:24,513 - Execute['! (beeline -u 'jdbc:hive2://c4229-node3.coelab.cloudera.com:10000/;transportMode=binary;ssl=true;sslTrustStore=/tmp/keystore1.jks;trustStorePassword=[PROTECTED]' -n hive -e ';' 2>&1 | awk '{print}' | grep -vz -i -e 'Connected to:' -e 'Transaction isolation:' -e 'inactive HS2 instance; use service discovery')'] {'path': ['/bin/', '/usr/bin/', '/usr/lib/hive/bin/', '/usr/sbin/'], 'timeout_kill_strategy': 2, 'timeout': 30, 'user': 'ambari-qa'}
      2020-04-10 08:20:28,927 - Connection to c4229-node3.coelab.cloudera.com on port 10000 failed
      

      Root cause : the trustStorePassword should idaelly be passed in single quotes to ignore the $ sign, the fix lies in : https://github.com/apache/ambari/blob/a4b2901a9a16e356c230fb647471e099b2d965ba/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py#L61

      changing

        beeline_url.extend(['ssl={ssl_str}', 'sslTrustStore={ssl_keystore}', 'trustStorePassword={ssl_password!p}'])
      

      to :

        beeline_url.extend(['ssl={ssl_str}', 'sslTrustStore={ssl_keystore}', "trustStorePassword='{ssl_password!p}'"])
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                asnaik Akhil Naik
                Reporter:
                asnaik Akhil Naik
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m