jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
116 stars 188 forks source link

Issues with Downloading Large Files from Artifactory through Jenkins Pipeline : Urgent Assistance Needed #941

Open safeereshan12 opened 5 months ago

safeereshan12 commented 5 months ago

Hello,

I am currently working on a Jenkins pipeline that involves the build, upload, and download of a large file (approximately 10GB). The build and upload stages are executed on a pod template container, while the download is performed on a Linux VM, which we have connected as a node in Jenkins.

However, I am encountering issues during the download stage from Artifactory. The error message I receive is as follows:

org.jfrog.build.extractor.clientConfiguration.client.artifactory.services.DownloadToFile.saveInputStreamToFile(DownloadToFile.java:34)
    at org.jfrog.build.extractor.clientConfiguration.client.artifactory.services.DownloadToFile.setResponse(DownloadToFile.java:40)
    at org.jfrog.build.extractor.clientConfiguration.client.JFrogService.processResponse(JFrogService.java:143)
    at org.jfrog.build.extractor.clientConfiguration.client.JFrogService.execute(JFrogService.java:123)
    at org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager.downloadToFile(ArtifactoryManager.java:128)
    at org.jfrog.build.extractor.clientConfiguration.util.DependenciesDownloaderHelper.lambda$doConcurrentDownload$0(DependenciesDownloaderHelper.java:277)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 2,495,238,826; received: 1,092,704,438)
    at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:178)
    at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:135)
    at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:148)
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1487)
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:1107)
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1460)
    at org.jfrog.build.extractor.clientConfiguration.client.artifactory.services.DownloadToFile.saveInputStreamToFile(DownloadToFile.java:31)

Here is a snippet of the pipeline code for the download stage:

stage('rtDownload') {
    steps {
        rtDownload (
            serverId: "ABC - 123",
            buildName: "${JOB_NAME}",
            buildNumber: "${BUILD_NUMBER}",
            spec: """{
                "files": [
                    {
                        "pattern": "ProjectName/${JOB_NAME}/${BUILD_NUMBER}/filename.iso",
                        "target": "$WORKSPACE/$BUILD_NUMBER/source/",
                        "flat": "true"
                    }
                ]
            }"""
        )
    }
}

I am unsure if there is a file size limit for downloads from Artifactory or if there is another underlying issue causing this problem. I would greatly appreciate any insights or suggestions on how to resolve this issue.

Jenkins Version 2.440.1

Thank you in advance for your assistance.

Best Regards, Safeer Pasha

eyalbe4 commented 5 months ago

@safeereshan12, We strongly recommend switching over to the next gen JFrog Jenkins Plugin. It's superior in terms of performance, stability and feature set compared to the older Artifactory Jenkins Plugin.

kreuzberger commented 3 months ago

After upgrading our artifactory server instance to Open source license 7.38.10 rev 73810900 we get the same error.

We are using the same plugin, but that worked with the prior version of the artifcatory server well. nginx configuration is properly set, so upload the large files is no problem from jenkins. Update of jenkins plugin is not possible (currently).

The download stops each time at the same nearly same size. jt download and download via ui behave and works like expected.

Caused by: org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 3,959,299,414; received: 1,094,656,004)