Deleted packages and Artifactory's Cache

How Remote Repository Metadata works

AuthorFullName__c
Patrick Russell
articleNumber
000004530
ft:sourceType
Salesforce
FirstPublishedDate
2019-08-23T07:13:48Z
lastModifiedDate
2024-03-10T07:49:26Z
VersionNumber
12

Up to this point, we've been talking about remote uploads, but what if a remote repository deletes a package? Say a given binary was cached in Artifactory before it was removed upstream, shouldn't it still be available to download? The answer is actually: No, because Artifactory is trying to mirror the remote site, the binary's metadata is being served directly from the upstream source. If the metadata says a particular package has been deleted, the client will receive a 404 Not Found error.

This said, the package hasn't truly been lost! To undelete a given package, it can be copied to a local Artifactory repository. There, Artifactory's local metadata calculation will list the package as available for download. However, as it is tedious to have to go to your UI and manually copy packages just to start using them again, we recommend that you:
  • Download and install Artifactory's Remote Backup User Plugin (which must have a JSON configuration file present to function as intended). 
  • Create a local Artifactory repository of the same package type as the remote and configure the plugin to copy the remote cache to the local repository.
  • Create a virtual repository and have remote clients use its URL instead.
With this system, any file that has been deleted on the remote site will be copied to the local repository and its metadata will be seamlessly merged with the remote's metadata.

Note: There are usually good reasons for deleting certain packages. Accordingly, there may be some risk in continuing to use a particular deprecated package. Additionally, package overwrites will never appear to the download client, as old local files will be served first.