ARTIFACTORY: How to Solve the ‘Given final block not properly padded’ Error During Artifactory Import/Export

Sam Rosenstein
2021-12-27 07:04

ARTIFACTORY: How to Solve the ‘Given final block not properly padded’ Error During Artifactory Import/Export
 

When performing a system import/export for Artifactory, the following error can occur:

[http-nio-8081-exec-8] - Failed system import: Could not merge and save new descriptor [org.jfrog.common.ExecutionFailed: Last retry failed: Failed to reload configuration: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.. Not trying again]

The reason for this error is that the data is encrypted during the export and the target Artifactory is unable to properly perform the import.

 

The encryption must be disabled on the source instance. Therefore please follow these steps in order to perform the import/export:

  1. Deactivate the encryption on the source instance
  2. Export the Artifactory instance
  3. Perform the import  on the new instance
  4. Reenable encryption on the source instance

Additionally, if using an external DB instance, please connect the target to an empty DB before performing the import.