ARTIFACTORY: Repositories with a "-cache" suffix cannot be deleted

ARTIFACTORY: Repositories with a "-cache" suffix cannot be deleted

AuthorFullName__c
Elina Floim
articleNumber
000005824
ft:sourceType
Salesforce
FirstPublishedDate
2023-07-18T19:29:49Z
lastModifiedDate
2023-07-18
VersionNumber
1

The creation of remote repositories with names prefixed with "-cache" was permitted in some Artifactory versions, such as version 7.47.14. Later versions enforced this behavior since the "-cache" suffix is strictly reserved for remote repositories and is appended by default to their names after the repository creation. Allowing remote repositories to be created with this suffix resulted in remote-cache repositories being created with a double cache suffix (for example, npm-remote-cache-cache), leading to unexpected behavior when working with these repositories. 

Attempts to delete these repositories in versions greater than 7.47.14 resulted in the following error:

2023-07-10T09:15:45.459Z [jfrt ] [ERROR] [cf2f67c2e91f0e0 ] [leteRepositoryConfigService:98] [http-nio-8081-exec-8] - Deleting repo 'test-cache' failed: Cannot retrieve 'test-cache' repo config from the RepositoryConfigService. Please use the RepositoryService instead.
java.lang.IllegalArgumentException: Cannot retrieve 'test-cache' repo config from the RepositoryConfigService. Please use the RepositoryService instead.

User-added image


This behavior has been addressed in version 7.63.5 of Artifactory and it is now possible to delete these repositories using the Apply Artifactory YAML Configuration Changes REST API call.

For example, to delete the “test-cache” remote repository, the following command can be used:
$ curl -XPATCH -u user:password https://$ART_HOST/artifactory/api/system/configuration -H "Content-Type: application/yaml" -T configuration.yml 

The configuration.yml contains the following:
remoteRepositories:
  test-cache: null


More information on the Artifactory YAML configuration options can be found here.