ARTIFACTORY: Why am I seeing “Unsupported archive extension: ‘null’” when deploying archives with the “X-Explode-Archive: true” header

Hanan Kemelman
2022-10-23 10:28

You can deploy an archive to Artifactory and automatically extract it.
When using this useful feature you may encounter the following error:“{
 "errors" : [ {
   "status" : 500,
   "message" : "Unsupported archive extension: 'null'; nested exception is java.lang.IllegalArgumentException: Unsupported archive extension: 'null'"
 } ]
}”

This error occurs when deploying an archive without an extension or when deploying an archive without a trailing slash in the path.

When deploying an archive file, you need to deploy it to a path or provide the target filename. 
The URL path with a trailing "/" indicates it's a path while without that it is a filename. 
The supported archive types are: zip; tar; tar.gz; and tgz.

So when deploying to "https://<MY_URL>/artifactory/<REPOSITORY>/archives" the file name is set to "archives" so the extension is null.
You should use one of the following options:

"https://<MY_URL>/artifactory/<REPOSITORY>/archives/" to deploy the archive with the original name to the archives directory
"https://<MY_URL>/artifactory/<REPOSITORY>/archives/my.zip" to deploy the archive to the archives directory and name it “my.zip”