[ 
https://issues.apache.org/jira/browse/RANGER-3683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18033464#comment-18033464
 ] 

wu qingguo edited comment on RANGER-3683 at 10/28/25 8:20 AM:
--------------------------------------------------------------

When adding the Hive service in Ranger 2.5, I also encountered this error. I 
have confirmed that the username and password are entered correctly.

 

my log is:

2025-10-28 08:19:27,478 [timed-executor-pool-0] WARN 
[SecureClientLogin.java:123] Can't find keyTab Path : null
2025-10-28 08:19:27,478 [timed-executor-pool-0] WARN 
[SecureClientLogin.java:127] Can't find principal : null
2025-10-28 08:19:27,478 [timed-executor-pool-0] ERROR [PasswordUtils.java:165] 
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:934)
        at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:845)
        at com.sun.crypto.provider.PBES1Core.doFinal(PBES1Core.java:416)
        at 
com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(PBEWithMD5AndDESCipher.java:316)
        at javax.crypto.Cipher.doFinal(Cipher.java:2165)
        at 
org.apache.ranger.plugin.util.PasswordUtils.decrypt(PasswordUtils.java:150)
        at 
org.apache.ranger.plugin.util.PasswordUtils.decryptPassword(PasswordUtils.java:138)
        at org.apache.ranger.plugin.client.BaseClient.login(BaseClient.java:109)
        at org.apache.ranger.plugin.client.BaseClient.<init>(BaseClient.java:61)
        at org.apache.ranger.plugin.client.BaseClient.<init>(BaseClient.java:53)
        at 
org.apache.ranger.services.hive.client.HiveClient.<init>(HiveClient.java:76)
        at 
org.apache.ranger.services.hive.client.HiveClient.connectionTest(HiveClient.java:827)
        at 
org.apache.ranger.services.hive.client.HiveResourceMgr.connectionTest(HiveResourceMgr.java:49)
        at 
org.apache.ranger.services.hive.RangerServiceHive.validateConfig(RangerServiceHive.java:82)
        at 
org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:732)
        at 
org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:719)
        at 
org.apache.ranger.biz.ServiceMgr$TimedCallable.call(ServiceMgr.java:680)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
2025-10-28 08:19:27,478 [timed-executor-pool-0] INFO [BaseClient.java:111] 
Password decryption failed; trying connection with received password string
2025-10-28 08:19:27,478 [timed-executor-pool-0] INFO [BaseClient.java:126] Init 
Login: security not enabled, using username
2025-10-28 08:19:27,479 [timed-executor-pool-0] INFO [HiveClient.java:93] Since 
Password is NOT provided, Trying to use UnSecure client with username and 
password
2025-10-28 08:19:27,479 [timed-executor-pool-0] ERROR [PasswordUtils.java:165] 
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:934)
        at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:845)
        at com.sun.crypto.provider.PBES1Core.doFinal(PBES1Core.java:416)
        at 
com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(PBEWithMD5AndDESCipher.java:316)
        at javax.crypto.Cipher.doFinal(Cipher.java:2165)
        at 
org.apache.ranger.plugin.util.PasswordUtils.decrypt(PasswordUtils.java:150)
        at 
org.apache.ranger.plugin.util.PasswordUtils.decryptPassword(PasswordUtils.java:138)
        at 
org.apache.ranger.services.hive.client.HiveClient.initConnection(HiveClient.java:716)
        at 
org.apache.ranger.services.hive.client.HiveClient.access$100(HiveClient.java:56)
        at 
org.apache.ranger.services.hive.client.HiveClient$2.run(HiveClient.java:98)
        at 
org.apache.ranger.services.hive.client.HiveClient$2.run(HiveClient.java:96)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at 
org.apache.ranger.services.hive.client.HiveClient.initHive(HiveClient.java:96)
        at 
org.apache.ranger.services.hive.client.HiveClient.<init>(HiveClient.java:77)
        at 
org.apache.ranger.services.hive.client.HiveClient.connectionTest(HiveClient.java:827)
        at 
org.apache.ranger.services.hive.client.HiveResourceMgr.connectionTest(HiveResourceMgr.java:49)
        at 
org.apache.ranger.services.hive.RangerServiceHive.validateConfig(RangerServiceHive.java:82)
        at 
org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:732)
        at 
org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:719)
        at 
org.apache.ranger.biz.ServiceMgr$TimedCallable.call(ServiceMgr.java:680)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
2025-10-28 08:19:27,479 [timed-executor-pool-0] INFO [HiveClient.java:718] 
Password decryption failed; trying Hive connection with received password string
2025-10-28 08:19:27,479 [timed-executor-pool-0] ERROR [HiveResourceMgr.java:51] 
<== HiveResourceMgr.connectionTest Error: 
org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive 
Thrift Server instance
2025-10-28 08:19:27,479 [timed-executor-pool-0] ERROR 
[RangerServiceHive.java:84] <== RangerServiceHive.validateConfig 
Error:org.apache.ranger.plugin.client.HadoopException: Unable to connect to 
Hive Thrift Server instance
2025-10-28 08:19:27,479 [timed-executor-pool-0] ERROR [ServiceMgr.java:682] 
TimedCallable.call: Error:org.apache.ranger.plugin.client.HadoopException: 
Unable to connect to Hive Thrift Server instance
2025-10-28 08:19:27,481 [http-nio-6080-exec-2] ERROR [ServiceMgr.java:231] ==> 
ServiceMgr.validateConfig 
Error:org.apache.ranger.plugin.client.HadoopException: 
org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive 
Thrift Server instance


was (Author: JIRAUSER310949):
When adding the Hive service in Ranger 2.5, I also encountered this error. I 
have confirmed that the username and password are entered correctly.

> Hive-plugin is used in Ranger Admin
> -----------------------------------
>
>                 Key: RANGER-3683
>                 URL: https://issues.apache.org/jira/browse/RANGER-3683
>             Project: Ranger
>          Issue Type: Bug
>          Components: admin
>    Affects Versions: 2.2.0
>            Reporter: wangjiucheng
>            Priority: Blocker
>         Attachments: test.png
>
>
> Hive-plugin was integrated in Range-Admin 2.2.0, but an error occurred while 
> testing the connection
>  
> {code:java}
> 2022-03-24 13:54:54,556 [timed-executor-pool-0] INFO  
> org.apache.ranger.plugin.client.BaseClient (BaseClient.java:111) - Password 
> decryption failed; trying connection with received password string
> 2022-03-24 13:54:54,556 [timed-executor-pool-0] INFO  
> org.apache.ranger.plugin.client.BaseClient (BaseClient.java:126) - Init 
> Login: security not enabled, using username
> 2022-03-24 13:54:54,556 [timed-executor-pool-0] INFO  
> apache.ranger.services.hive.client.HiveClient (HiveClient.java:93) - Since 
> Password is NOT provided, Trying to use UnSecure client with username and 
> password
> 2022-03-24 13:54:54,556 [timed-executor-pool-0] ERROR 
> org.apache.ranger.plugin.util.PasswordUtils (PasswordUtils.java:165) - 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.prepareInputBuffer(CipherCore.java:1005)
>     at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:848)
>     at com.sun.crypto.provider.PBES1Core.doFinal(PBES1Core.java:432)
>     at 
> com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(PBEWithMD5AndDESCipher.java:316)
>     at javax.crypto.Cipher.doFinal(Cipher.java:2164)
>     at 
> org.apache.ranger.plugin.util.PasswordUtils.decrypt(PasswordUtils.java:150)
>     at 
> org.apache.ranger.plugin.util.PasswordUtils.decryptPassword(PasswordUtils.java:138)
>     at 
> org.apache.ranger.services.hive.client.HiveClient.initConnection(HiveClient.java:716)
>     at 
> org.apache.ranger.services.hive.client.HiveClient.access$100(HiveClient.java:56)
>     at 
> org.apache.ranger.services.hive.client.HiveClient$2.run(HiveClient.java:98)
>     at 
> org.apache.ranger.services.hive.client.HiveClient$2.run(HiveClient.java:96)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at javax.security.auth.Subject.doAs(Subject.java:422)
>     at 
> org.apache.ranger.services.hive.client.HiveClient.initHive(HiveClient.java:96)
>     at 
> org.apache.ranger.services.hive.client.HiveClient.<init>(HiveClient.java:77)
>     at 
> org.apache.ranger.services.hive.client.HiveClient.connectionTest(HiveClient.java:827)
>     at 
> org.apache.ranger.services.hive.client.HiveResourceMgr.connectionTest(HiveResourceMgr.java:48)
>     at 
> org.apache.ranger.services.hive.RangerServiceHive.validateConfig(RangerServiceHive.java:82)
>     at 
> org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:660)
>     at 
> org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:647)
>     at 
> org.apache.ranger.biz.ServiceMgr$TimedCallable.call(ServiceMgr.java:608)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>     at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>     at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>     at java.lang.Thread.run(Thread.java:748)
> 2022-03-24 13:54:54,558 [timed-executor-pool-0] INFO  
> apache.ranger.services.hive.client.HiveClient (HiveClient.java:718) - 
> Password decryption failed; trying Hive connection with received password 
> string
>  {code}
>  
> I don't know how to solve it
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to