Overview:

ARTIFACTORY: How to resolve metadata migration issues after upgrade due to sha256 values missing for artifacts

AuthorFullName__c
Shivani Budhodi
articleNumber
000005410
ft:sourceType
Salesforce
FirstPublishedDate
2022-09-14T15:34:18Z
lastModifiedDate
2024-03-10T07:44:53Z
VersionNumber
3
Artifactory natively supports sha-256 and when a file is deployed to any repository, the sha-256 checksum is calculated by Artifactory and it is maintained in the database. Artifactory 5.5 implements a database schema change to natively support SHA-256 checksums.

There may be some situations where Artifactory was been upgraded multiple times to different 6.x versions which have sha-256 compatibility, however, in certain cases, there could be a few artifacts that still has no sha-256 calculated as it was deployed on Artifactory when running on a version below 5.5

When using Artifactory from below 5.5 versions, while upgrading to the latest versions of 7.x, there is a possibility that there could be some artifacts that might not be having a sha-256 associated with it. This indicates that the sha-256 were not calculated for the specific artifacts nor the migration for sha-256 is performed 

Hence, after upgrading to the 7.x version, it is possible to encounter the below error which indicates that sha-256 entry is not available for this specific artifact in the database.
java.lang.IllegalStateException: Failed executing api/v1/packages/gav%3A%2F%2Forg.maven.testr%3Ajunit, with response code: HTTP/1.1 500 Internal Server Error and response message: {"cause":"Internal error while processing request","message":"Error patching package with id: (gav://org.maven.test:junit): did not find matching file in db after insert attempt"}

Due to this uncalculated SHA-256 checksum following warning can be observed in the UI during migration: