Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39594

Frequent, intermittent "Failed to deploy artifacts: Could not transfer artifact" errors when uploading to Nexus 3

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Windows Server 2012r2, Jenkins installed by Windows installer, v2.19
      Nexus Artifact Uploader plugin v2.7
      Nexus 3 OSS

      I have a step to upload a zip artefact from my build process to a Nexus install (which, in this case, is running on the same machine as Jenkins). Around 50% of the time it works perfectly, the other 50% of the time it fails.

      Looking in the nexus request.log, I can see that on the successful attempts, the following sequence of requests is issued against Nexus:

      10.61.245.104 - - [08/Nov/2016:18:04:32 +0000] "PUT /repository/XYZ.Core/XYZCore/TechRegistry/0.0.1.52/TechRegistry-0.0.1.52.zip HTTP/1.1" 401 0 1
      10.61.245.104 - XYZbuild-s [08/Nov/2016:18:04:33 +0000] "PUT /repository/XYZ.Core/XYZCore/TechRegistry/0.0.1.52/TechRegistry-0.0.1.52.zip HTTP/1.1" 201 0 234
      10.61.245.104 - - [08/Nov/2016:18:04:33 +0000] "PUT /repository/XYZ.Core/XYZCore/TechRegistry/0.0.1.52/TechRegistry-0.0.1.52.zip.sha1 HTTP/1.1" 401 0 2
      10.61.245.104 - XYZbuild-s [08/Nov/2016:18:04:33 +0000] "PUT /repository/XYZ.Core/XYZCore/TechRegistry/0.0.1.52/TechRegistry-0.0.1.52.zip.sha1 HTTP/1.1" 201 0 13
      10.61.245.104 - - [08/Nov/2016:18:04:33 +0000] "PUT /repository/XYZ.Core/XYZCore/TechRegistry/0.0.1.52/TechRegistry-0.0.1.52.zip.md5 HTTP/1.1" 401 0 4
      10.61.245.104 - XYZbuild-s [08/Nov/2016:18:04:33 +0000] "PUT /repository/XYZ.Core/XYZCore/TechRegistry/0.0.1.52/TechRegistry-0.0.1.52.zip.md5 HTTP/1.1" 201 0 16
      

      i.e. it is doing unauthenticated requests then re-trying with the correct authentication as configured.

      On the failed requests, all I see is the very first of these requests:

      10.61.245.104 - - [08/Nov/2016:18:05:03 +0000] "PUT /repository/XYZ.Core/XYZCore/TechRegistry/0.0.1.53/TechRegistry-0.0.1.53.zip HTTP/1.1" 401 0 1
      

      .. and in the Jenkins build log, I get the following:

      Uploading artifact XYZ.Core.TechRegistry-0.0.1-53.zip started....
      GroupId: XYZCore
      ArtifactId: TechRegistry
      Classifier: 
      Type: zip
      Version: 0.0.1.53
      File: XYZ.Core.TechRegistry-0.0.1-53.zip
      Repository:XYZ.Core
      Failed to deploy artifacts: Could not transfer artifact XYZCore:TechRegistry:zip:0.0.1.53 from/to XYZ.Core (http://XYZartifacts.to.dev.xyz.local:8080/repository/XYZ.Core): null to http://XYZartifacts.to.dev.xyz.local:8080/repository/XYZ.Core/XYZCore/TechRegistry/0.0.1.53/TechRegistry-0.0.1.53.zip
      ERROR: Uploading file XYZ.Core.TechRegistry-0.0.1-53.zip failed.
      

      I have verified that the artefact does not already exist (as I understand that can cause a 401 error), so it isn't the typical "trying to re-upload the same version" issue. Re-running the build causes it to work usually, although it isn't a straightforward alternating between working and not.

      Would it be possible for the plugin to not attempt to do an unauthenticated request before doing the authenticated request for each upload, when it has credentials given to it?

            pskumar448 Suresh Kumar
            mhughes Mark Hughes
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: