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.

Setup Hive repo in Ranger and Test Connection fails with error : Input length must be multiple of 8 when decrypting with padded cipher

Highlighted

Setup Hive repo in Ranger and Test Connection fails with error : Input length must be multiple of 8 when decrypting with padded cipher

New Contributor

Hi ,

I am receiving below error , while create the hive repo using Ambari and running test connection

Connection Failed.

Unable to retrieve any files using given parameters, You can still save the repository and start creating policies, but you would not be able to use autocomplete for resource names. Check ranger_admin.log for more info.

org.apache.ranger.plugin.client.HadoopException: Unable to login to Hadoop environment [jaguar_cluster_hive].

Unable to login to Hadoop environment [cluster_hive].

Unable to decrypt password due to error.

Input length must be multiple of 8 when decrypting with padded cipher.

******************** xa_portal.log file show below error message

- Unable to decrypt password due to error javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:922)

********************

We are using open JDK . Cipher.getMaxAllowedKeyLength is : 2147483647

We are just using Ranger with LDAP / AD ( no kerberos )

Thanks For your help in advance

Naveen.

3 REPLIES 3

Re: Setup Hive repo in Ranger and Test Connection fails with error : Input length must be multiple of 8 when decrypting with padded cipher

Can you try saving the repository configuration before trying the Test Connection?

What version are you using? You might be likely hitting this https://issues.apache.org/jira/browse/RANGER-1342

Re: Setup Hive repo in Ranger and Test Connection fails with error : Input length must be multiple of 8 when decrypting with padded cipher

New Contributor

Hi Hortonworks support,

This issue is still in HDP-2.6.5.1175 (Ranger 0.7.0 - 2.6.4.0-91 ).

The issue is identified(by hortonworks) and also resolved(by Apache Ranger) and committed in the same release later:

https://github.com/apache/ranger/commit/ed6488361660aecbba1d006f26218e5193995f8f


Now the question is:

1)In which HDP Stack version this fix was released?

2)Is it better to just build the above committed code from GitHub and install in component servers wherever ranger is installed(rather than doing entire HDP Stack upgrade)? OR

3)Is it possible to just replace the respective jar files in all component plugin paths below? Please suggest

  • /usr/hdp/2.6.4.0-91/hive/lib/ranger-hive-plugin-impl/ranger-plugins-common-0.7.0.2.6.4.0-91.jar
    /usr/hdp/2.6.4.0-91/hive2/lib/ranger-hive-plugin-impl/ranger-plugins-common-0.7.0.2.6.4.0-91.jar
    /usr/hdp/2.6.4.0-91/ranger-hive-plugin/lib/ranger-hive-plugin-impl/ranger-plugins-common-0.7.0.2.6.4.0-91.jar

Re: Setup Hive repo in Ranger and Test Connection fails with error : Input length must be multiple of 8 when decrypting with padded cipher

New Contributor

The below code is missing in HadoopConfigHolder.java file


public class HadoopConfigHolder
{
..
  private void initLoginInfo() {
  ..
    String plainTextPwd = prop.getProperty("password");
      try {
        this.password = PasswordUtils.encryptPassword(plainTextPwd);
      } catch (IOException e) {
        throw new HadoopException("Unable to initialize login info", e);
      } 
  ..
  }
..
}