How to resolve the “Given final block not properly padded. Such issues can arise if a bad key is used during decryption” error

How to resolve the “Given final block not properly padded. Such issues can arise if a bad key is used during decryption” error

AuthorFullName__c
Daniel Poterman
articleNumber
000005089
FirstPublishedDate
2021-05-31T10:08:16Z
lastModifiedDate
2025-05-14
Versions: Artifactory 6.X and 7.X

In some cases you may encounter the following error when starting Artifactory:

[jfrt ] [ERROR] [4543429d2a8d1892] [ctoryContextConfigListener:126] [art-init] - Application could not be initialized: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
java.lang.reflect.InvocationTargetException: null


This error suggests that there is an issue with either the join.key or the master.key files Artifactory uses to securely connect with its database. These files are created when you start Artifactory for the first time, and losing the master.key is a serious problem.