I am working on a pipeline on Jenkins, in which a step is to download an artifact from Artifactory. It worked fine, but for one artifact, I receive a Calculated MD5 cheksum is different from original error. I've seen a question with no real answer on that subject.
The important thing is as follows: Jenkins does download the artifact, but the zip file is 70MB larger than it is on Artifactory. If I download it manually using the link it echoes in the logs, I get the correct file.
My stage:
stage("Download Artifact"){
def server = Artifactory.server 'MYARTIFACTORYSERVER'
def downloadSpec = """{
"files": [
{
"pattern": "${sourcerepository}/${artifactpath}/${artifactname}/${artifactversion}${versionsuffix}/*${artifactidentifier}.zip",
"target": "artifact-to-sign/"
}
]
}"""
server.download(downloadSpec)
}
My logs:
Downloading artifacts using pattern: path/to/artifact/*.zip
Beginning to resolve Build Info published dependencies.
Downloading 'http://URL/artifactory/path/to/artifact/OBFUSCATED.zip'...
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: Calculated MD5 checksum is different from original, Original: 'CHECKSUM1' Calculated: 'CHECKSUM2'
Any clue as to why the file size is different? The content of the zip file seems identical in size. When unzipped, the checksum of the content is identical to Artifactory.
When trying to unzip it, 7zip gives a warning: There are some data after the end of the payload data.
Additional testing has shown that the Artifactory download plugin corrupted downloads above 100MB, despite correct configuration of the Artifactory server. The reason behind this corruption, or whether it is a bug with the plugin or not, has not been established.
There's a way to avoid the issue by not using Artifactory to download the artifact in the first place. I do this by using curl.
curl http://URL/artifactory/path/to/artifact/OBFUSCATED.zip --output OBFUSCATED.zip
The plugin seems not to struggle for uploads over 100MB, and they work using the Artifactory plugin.