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

rtUpload / rtDownload fail with HTTP 401 / 403

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: artifactory-plugin
    • Labels:
      None
    • Environment:
      - Jenkins v2.190.1 / Windows
      - Artifactory Plugin v3.4.x
      - Artifactory 6.12.2
    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            reenberg Jesper Reenberg added a comment -

             Since you mention that you have the authorize-project plugin installed, chances are that you are using some other plugins that might break things?

            I would suggest to verify that it fails for you on a clean install.  If not, then start adding plugins until you find out which one that might interfere.

            I still can't reproduce your results, and I'm doing it in a clean install with only this plugin installed and all its dependencies.  
            Also note that we are running this in production with god knows which other plugins (though not the authorize-project), and we don't see any issue using credentials.

            Show
            reenberg Jesper Reenberg added a comment -  Since you mention that you have the authorize-project plugin installed, chances are that you are using some other plugins that might break things? I would suggest to verify that it fails for you on a clean install.  If not, then start adding plugins until you find out which one that might interfere. I still can't reproduce your results, and I'm doing it in a clean install with only this plugin installed and all its dependencies.   Also note that we are running this in production with god knows which other plugins (though not the authorize-project), and we don't see any issue using credentials.
            Hide
            ethorsa ethorsa added a comment - - edited

            I have setup a clean Jenkins v2.204.2 without any plugins (not even suggested ones). Next adding necessary plugins (pipeline, git and artifactory support) and start testing using the
            pipeline mentioned in earlier. The job succeeded. Gradually adding plugin by plugin with a test after each – still working. Finally this brought up the cause: After installation of the Authorize Project plugin it kept working, but after setting it's strategy to "Run as Specific User" it started failing with the well known error. Changing strategy to "Run as User who Triggered Build" it worked again (however, this breaks functionality with pipelines). See plugins-of-clean-test.txt for a complete list of installed plugins and their versions.

            There are already related issues: JENKINS-58902JENKINS-55624

            Show
            ethorsa ethorsa added a comment - - edited I have setup a clean Jenkins v2.204.2 without any plugins (not even suggested ones). Next adding necessary plugins (pipeline, git and artifactory support) and start testing using the pipeline mentioned in earlier. The job succeeded. Gradually adding plugin by plugin with a test after each – still working. Finally this brought up the cause: After installation of the Authorize Project plugin it kept working, but after setting it's strategy to "Run as Specific User" it started failing with the well known error. Changing strategy to "Run as User who Triggered Build" it worked again (however, this breaks functionality with pipelines). See  plugins-of-clean-test.txt for a complete list of installed plugins and their versions. There are already related issues:  JENKINS-58902 ,  JENKINS-55624
            Hide
            ethorsa ethorsa added a comment -

            JENKINS-58902 gives some implementation hints.

            Show
            ethorsa ethorsa added a comment - JENKINS-58902 gives some implementation hints.
            Hide
            eyalbe Eyal Ben Moshe added a comment - - edited

            Could this be a bug in the "authorize-project" plugin? See https://github.com/jfrog/jenkins-artifactory-plugin/issues/247

            Show
            eyalbe Eyal Ben Moshe added a comment - - edited Could this be a bug in the "authorize-project" plugin? See  https://github.com/jfrog/jenkins-artifactory-plugin/issues/247
            Hide
            ethorsa ethorsa added a comment -

            A quick update: Still broken with recent Artifactory Plugin v3.6.1 (Jenkins v2.204.5, Authorize Project v1.3.0).

            Show
            ethorsa ethorsa added a comment - A quick update: Still broken with recent Artifactory Plugin v3.6.1 (Jenkins v2.204.5, Authorize Project v1.3.0).

              People

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

                Dates

                Created:
                Updated: