ARTIFACTORY: How to resolve ‘Failed to initialize remote repository '<repo-name>'. Repository will be blacked-out!’ observed in the logs after the Artifactory migration

ARTIFACTORY: How to resolve ‘Failed to initialize remote repository '<repo-name>'. Repository will be blacked-out!’ observed in the logs after the Artifactory migration

AuthorFullName__c
Vishal Suvarna
articleNumber
000006077
ft:sourceType
Salesforce
FirstPublishedDate
2024-04-21T12:12:55Z
lastModifiedDate
2024-04-21
VersionNumber
1
Symptom:
After completion of Artifactory migration, while accessing the remote repository, the UI may throw ‘500’ error code. The application will be returning the following error in the logs:
2024-03-27T09:01:45.301Z [1;32m[jfrt ][0;39m [1;31m[ERROR][0;39m [7194610e11439b40] [r.s.RepositoryServiceImpl:3795] [art-init            ] - Failed to initialize remote repository test-remote-repo'. Repository will be blacked-out!
org.jfrog.security.crypto.exception.CryptoRuntimeException: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
	at org.jfrog.security.crypto.EncryptionWrapperBase.decryptFallback(EncryptionWrapperBase.java:195)
	at org.jfrog.security.crypto.EncryptionWrapperBase.decrypt(EncryptionWrapperBase.java:129)

Solution:
1. Get all the repo names:
 curl -u admin <URL>/artifactory/api/repositories

2. For each of the affected repos, get the configuration:
curl -u admin <URL>/artifactory/api/repositories/<repo-name> -o config.file

3. Save config to a file, update the password variable to plain text password (can be temp and then
update later through UI once this encryption issue is fixed)
Replace the below section with a plain text password:
"password" : "JE2gqbrFJtDZ3UoUcyT64FrYq8J2H9tt5Qh3okQzgtytvyuifs"

For example:

User-added image

4. Update config with new plaintext/temp password:
curl -u admin -XPOST  <URL>/artifactory/api/repositories/icvs-remote -H "Content-Type: application/json" -d @config.file