ARTIFACTORY: How to identify and fix all artifacts with missing client checksums

ARTIFACTORY: How to identify and fix all artifacts with missing client checksums

AuthorFullName__c
Paul Pan
articleNumber
000005357
FirstPublishedDate
2022-08-03T11:15:55Z
lastModifiedDate
2025-05-15
Artifacts in Aritfactory have Client Checksum and Server Checksum. Server checksum is calculated by artifactory while Client Checksum is provided by deployer. 

You can refer to this article for more details on client checksum, server checksum and checksum policy

In case where a client checksum is missing and your checksum policy is client-checksums,
You will see warnings “client did not publish a checksum value…”. 
You can also fix the checksums individually in the UI. 

However, if you have many exits artifacts with missing client checksums, you might need a scalable solution. 

You should first try to verify how you are deploying your artifacts and check why is client checksum is not deployed so that newly deployed artifacts does not have the issue. 


Change Checksum Policy

The easiest way to bypass the mixing client checksum issue if you are seeking for an immediate workaround is to change the checksum policy.

In local repository settings, you can change checksum policy from “verify against client checksums” to “Trust server generated checksums”.

Note that some repository types does not support direct change of checksum policy in UI. You will need to modify the config descriptor in order to make the change.

Prior to 7.49.x  Repository config descriptor is in global config descriptor under  artifactory.config.latest.xml

You should file the relevant localRepoChecksumPolicyType for your repositories and change them from client-checksums to server-generated-checksums

<localRepoChecksumPolicyType>client-checksums</localRepoChecksumPolicyType>

To

<localRepoChecksumPolicyType>server-generated-checksums</localRepoChecksumPolicyType>

<localRepository>
            <key>example-repo-local</key>
            ...
   <localRepoChecksumPolicyType>client-checksums</localRepoChecksumPolicyType>
            ...
        </localRepository>

After 7.49.x, Repository config descriptor is under $JFROG_HOME/artifactory/var/etc/artifactory/artifactory.repository.config.latest.json

So you would need to change "checksumPolicyType": "client-checksums" to "checksumPolicyType": "server-generated-checksums"
{
     "type": "local",
     "key": "example-repo-local",
     ...
     "repoTypeConfig": {
       ...
       "checksumPolicyType": "client-checksums",
       ...
     },
     ...
   }


Identify all the artifacts with missing client checksum in a repo

The fastest way to identify all the artifacts with missing client checksum is to run the following query:


Select repo, node_path, node_name FROM nodes Where sha1_original IS NULL AND sha1_actual IS NOT NULL AND repo=’some_repo’;


Fix checksum in bulk


Right now, we do not have an api to fix checksum for an entire repository.

If you need a quick fix to update all missing checksum in an repo, you can run the following query:

Update nodes Set sha1_original='NO_ORIG' Where sha1_original IS NULL AND sha1_actual IS NOT NULL AND repo=’some_repo’;

Note that db schema are subject to change, so please take back up before running the above query