ARTIFACTORY: Unable to delete the artifacts/file with the special character in Artifactory

ARTIFACTORY: Unable to delete the artifacts/file with the special character in Artifactory

AuthorFullName__c
Ujwal Poovaiah
articleNumber
000005925
ft:sourceType
Salesforce
FirstPublishedDate
2023-11-30T21:40:49Z
lastModifiedDate
2023-12-07
VersionNumber
3

Sometime Artifacts will be uploaded with Special characters  such as “?” and also sometimes it is noticed that due to keyboard layout/format( German umlauts “ä, ö, ü, ß ..etc”) the artifacts will be uploaded with special character, due to this we will be unable to delete these artifacts from the Artifactory UI or using the REST API . 

Deleting from the UI will not make any changes the file still still exists and not be removed:

User-added image

User-added image


REST API will return 404 unable to locate  the artifact error message:

curl -uadmin:"password*" -XDELETE "http://artifactory.com/artifactory/maven-local/test???1.jar"

{
  "errors" : [ {
    "status" : 404,
    "message" : "Could not locate artifact 'maven-local:test' (Nothing to delete)."
  } ]
}

Log Entries
==> artifactory-request.log <==
2023-11-28T08:27:41.441Z|400d3606085d50ef|0.0.0.0|admin|DELETE|/maven-local/test|404|-1|0|7|curl/8.1.2

==> artifactory-service.log <==
2023-11-28T08:27:41.437Z [jfrt ] [INFO ] [400d3606085d50ef] [r.s.RepositoryServiceImpl:3044] [http-nio-8081-exec-6] - Could not locate artifact 'maven-local:test' (Nothing to delete).
However we can delete it by renaming the file( without any special characters ) at the database level by executing the below query and then delete the file from the UI.

Steps are as below:(Tested in MYSQL Database)

1. Confirm if the database collation is “Latin1_General_CS_AI” by executing the below command, if yes then follow from the step3.
SELECT CONVERT (varchar(256), SERVERPROPERTY('collation'));

2. Artifacts with a special character “test???1.jar”

User-added image

3. Execute the below database query to rename the file.
(NOTE: Take a back of these artifact before renaming and removing in case if you need this artifact)
SELECT * FROM nodes where node_name LIKE 'test???1.jar' AND repo = 'maven-local';

UPDATE nodes SET node_name='demofile' WHERE node_name LIKE 'test???1.jar' AND repo = 'maven-local';

4. We can observe that the file 'test???1.ja' is renamed to demofile

User-added image

5. Once the file name is updated, delete from the UI.

User-added image