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

rtUpload / rtDownload fail with HTTP 401 / 403

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • artifactory-plugin
    • None
    • - Jenkins v2.190.1 / Windows
      - Artifactory Plugin v3.4.x
      - Artifactory 6.12.2

      After Updating to the artifactory plugin v3.4.1 all up- or downloads using the declarative steps fail by 401 (upload) / 403 (download) HTTP errors.

      Both are working with v3.3.x and broken with 3.4.x.

      According the Artifactory logs the steps do not authenticate. 

       

      Upload

      rtUpload(serverId: 'artifactory-test', specPath: 'spec-ul.json')
      rtPublishBuildInfo(serverId: 'artifactory-test')
      

      Fails with error 401:

      Unauthorized Status code: 401
          at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:44)
      [...]
      

       

      Download

      rtDownload(serverId: 'artifactory-test', specPath: 'spec-dl.json')  

      Fails with error 403:

      java.io.IOException: Failed to search artifact by the aql 'items.find({"repo": "msys2","path": {"$ne": "."}, "$or": [{"$and": [{"path": { "$match": "distrib"},"name": { "$match": "msys2-x86_64-latest.tar.xz"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","size","type","property")': HTTP/1.1 403 
          at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryDependenciesClient.getResponseStream(ArtifactoryDependenciesClient.java:136)
      [...]
      

      Configuration

      Artifactory is configured in the Jenkins settings (id artifactory-test in the examples) and useses the Credentials Plugin to access credentials.

      The Test Connection button returns the correct Artifactory version.

       

      Tested version of the plugin

       

      Version Result
      3.3.0
      3.3.1
      3.3.2
      3.4.0
      3.4.1

       

      Workaround

      Downgrade to a v3.3.x release.

          [JENKINS-59973] rtUpload / rtDownload fail with HTTP 401 / 403

          ethorsa created issue -
          ethorsa made changes -
          Attachment New: stacktrace-download.log [ 49342 ]
          ethorsa made changes -
          Attachment New: stacktrace-upload.log [ 49343 ]
          ethorsa made changes -
          Description Original: After Updating to the _artifactory plugin v3.4.1_ all up- or downloads using the declarative steps fail by 401 (upload) / 403 (download) HTTP errors.

          Both are working with v3.3.x and broken with 3.4.x.

          According the Artifactory logs the steps do not authenticate. 

           
          h3. Upload
          {code:java}
          rtUpload(serverId: 'artifactory-test', specPath: 'spec-ul.json')
          rtPublishBuildInfo(serverId: 'artifactory-test')
          {code}
          Fails with error 401:
          {noformat}
          Unauthorized Status code: 401
              at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:44)
          [...]
          {noformat}
           
          h3. Download
          {code:java}
          rtDownload(serverId: 'artifactory-test', specPath: 'spec-dl.json') {code}
          Fails with error 403:
          {noformat}
          java.io.IOException: Failed to search artifact by the aql 'items.find({"repo": "msys2","path": {"$ne": "."}, "$or": [{"$and": [{"path": { "$match": "distrib"},"name": { "$match": "msys2-x86_64-latest.tar.xz"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","size","type","property")': HTTP/1.1 403
              at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryDependenciesClient.getResponseStream(ArtifactoryDependenciesClient.java:136)
          [...]
          {noformat}
          h3. Configuration

          Artifactory is configured in the Jenkins settings (id {{artifactory-test}} in the examples) and useses the _Credentials Plugin_ to access credentials.

          The _Test Connection_ button returns the correct Artifactory version.

           
          h3. Tested version of the plugin

           
          ||Version||Result||
          |3.3.0|(/)|
          |3.3.1|(/)|
          |3.3.2|(/)|
          |3.4.0|(x)|
          |3.4.1|(x)|
          New: After Updating to the _artifactory plugin v3.4.1_ all up- or downloads using the declarative steps fail by 401 (upload) / 403 (download) HTTP errors.

          Both are working with v3.3.x and broken with 3.4.x.

          According the Artifactory logs the steps do not authenticate. 

           
          h3. Upload
          {code:java}
          rtUpload(serverId: 'artifactory-test', specPath: 'spec-ul.json')
          rtPublishBuildInfo(serverId: 'artifactory-test')
          {code}
          Fails with error 401:
          {noformat}
          Unauthorized Status code: 401
              at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:44)
          [...]
          {noformat}
           
          h3. Download
          {code:java}
          rtDownload(serverId: 'artifactory-test', specPath: 'spec-dl.json') {code}
          Fails with error 403:
          {noformat}
          java.io.IOException: Failed to search artifact by the aql 'items.find({"repo": "msys2","path": {"$ne": "."}, "$or": [{"$and": [{"path": { "$match": "distrib"},"name": { "$match": "msys2-x86_64-latest.tar.xz"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","size","type","property")': HTTP/1.1 403
              at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryDependenciesClient.getResponseStream(ArtifactoryDependenciesClient.java:136)
          [...]
          {noformat}
          h3. Configuration

          Artifactory is configured in the Jenkins settings (id {{artifactory-test}} in the examples) and useses the _Credentials Plugin_ to access credentials.

          The _Test Connection_ button returns the correct Artifactory version.

           
          h3. Tested version of the plugin

           
          ||Version||Result||
          |3.3.0|(/)|
          |3.3.1|(/)|
          |3.3.2|(/)|
          |3.4.0|(x)|
          |3.4.1|(x)|

           

          h3. Workaround

          Downgrade to a v3.3.x release.
          ethorsa made changes -
          Issue Type Original: New Feature [ 2 ] New: Bug [ 1 ]
          ethorsa made changes -
          Attachment New: artifactory-jenkins-log.log [ 49714 ]
          ethorsa made changes -
          Attachment New: jenkins-artifactory-global-config.png [ 49715 ]
          ethorsa made changes -
          Remote Link New: This issue links to "#247 - Credentials cannot be retrieved when authorize-project plugin is enabled (Web Link)" [ 24419 ]
          ethorsa made changes -
          Attachment New: plugins-of-clean-test.txt [ 50342 ]
          ethorsa made changes -
          Link New: This issue relates to JENKINS-58902 [ JENKINS-58902 ]
          ethorsa made changes -
          Link New: This issue relates to JENKINS-55624 [ JENKINS-55624 ]

            Unassigned Unassigned
            ethorsa ethorsa
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: