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:
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”
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
5. Once the file name is updated, delete from the UI.