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

Artifactory plugin 2.12.* generic pipeline download does not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: artifactory-plugin
    • Environment:
      Jenkins 2.70 on Windows Server 2012, Agents Windows 7, very few Windows 10. Plugins all latest, artifactory plugin 2.12 and 2.12.1 won't work, downgrade to 2.11 fixes the problem.
    • Similar Issues:

      Description

      I have started experimenting with artifactory up- and download via Jenkins pipeline with artifactory plugin 2.12. Upload was no problem, download failed. Then I saw 2.12.1 and its changes and thought, it would fix my problem. But... A downgrade to 2.11 finally made my small test job work. So there seems to be another bug with 2.12.*. My small pipeline script to reproduce is as follows:

      node('unit-tests') {
      dir("${MY_WORKSPACE}
      CommonTests") {
      stage('Download artifacts') {
      def downloadSpec = '''{
      "files": [
      {
      "pattern": "repo/BASE-PIPELINE/Binaries/15.80.0/263/sw/",
      "target": "sw/"
      }
      ]
      }'''

      def server = Artifactory.server '***@artifactory.****.net'
      server.download(downloadSpec)
      }
      }
      }

      Output is:
      Started by user
      Kuypers,Dirk
      [Pipeline] node
      Running on slave09.1 in c:\Jenkins-1\workspace\TEST_Artifactory_Download
      [Pipeline] {
      [Pipeline] dir
      Running in D:\WS\CommonTests
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Download artifacts)
      [Pipeline] getArtifactoryServer
      [Pipeline] artifactoryDownload
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // dir
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      java.io.IOException: Failed to search artifact by the aql 'items.find({"repo": "repo","$or": [{"$and": [
      {"path":

      {"$match":"BASE-PIPELINE/Binaries/15.80.0/263/sw"}

      ,"name":
      {"$match":"*"}}]},{"$and": [
      {"path":

      {"$match":"BASE-PIPELINE/Binaries/15.80.0/263/sw/*"}

      ,"name":
      {"$match":"*"}}]}]})': HTTP/1.1 403 Forbidden
      at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryDependenciesClient.readResponse(ArtifactoryDependenciesClient.java:161)
      at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryDependenciesClient.searchArtifactsByAql(ArtifactoryDependenciesClient.java:114)
      at org.jfrog.build.extractor.clientConfiguration.util.AqlDependenciesHelper.collectArtifactsToDownload(AqlDependenciesHelper.java:62)
      at org.jfrog.build.extractor.clientConfiguration.util.WildcardsDependenciesHelper.retrievePublishedDependencies(WildcardsDependenciesHelper.java:86)
      at org.jfrog.build.extractor.clientConfiguration.util.DependenciesDownloaderHelper.downloadDependencies(DependenciesDownloaderHelper.java:83)
      at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecsHelper.downloadArtifactsBySpec(SpecsHelper.java:100)
      at org.jfrog.hudson.generic.FilesResolverCallable.invoke(FilesResolverCallable.java:47)
      at org.jfrog.hudson.generic.FilesResolverCallable.invoke(FilesResolverCallable.java:20)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2750)
      at hudson.remoting.UserRequest.perform(UserRequest.java:181)
      at hudson.remoting.UserRequest.perform(UserRequest.java:52)
      at hudson.remoting.Request$2.run(Request.java:336)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at hudson.remoting.Engine$1$1.run(Engine.java:98)
      at java.lang.Thread.run(Unknown Source)
      at ......remote call to JNLP4-connect connection from 1sp-slave9.rsint.net/10.0.21.186:49496(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1554)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:281)
      at hudson.remoting.Channel.call(Channel.java:839)
      at hudson.FilePath.act(FilePath.java:987)
      Caused: java.io.IOException: remote file operation failed: D:\WS\CommonTypesTests at hudson.remoting.Channel@786c6371:JNLP4-connect connection from 1sp-slave9.rsint.net/10.0.21.186:49496
      at hudson.FilePath.act(FilePath.java:994)
      at hudson.FilePath.act(FilePath.java:976)
      at org.jfrog.hudson.pipeline.executors.GenericDownloadExecutor.execution(GenericDownloadExecutor.java:41)
      at org.jfrog.hudson.pipeline.steps.DownloadStep$Execution.run(DownloadStep.java:66)
      at org.jfrog.hudson.pipeline.steps.DownloadStep$Execution.run(DownloadStep.java:46)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      at hudson.security.ACL.impersonate(ACL.java:260)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE
       

       

        Attachments

          Activity

          Hide
          eyalbe Eyal Ben Moshe added a comment -

          It looks like your cUrl command is missing the password - it prompts - "Enter host password for user 'kuypers':"

          To make it easier for you to run the command, you can JFrog CLI and run a simple search command with the same credentials your Jenkins job uses. Something like:

          jfrog rt search "repo/"

          JFrog CLI creates an AQL query behind the scenes, so it should get the same result as with cUrl. I suggest cUrl initially, so that you can test the exact same AQL query from the Jenkins build log.

          Show
          eyalbe Eyal Ben Moshe added a comment - It looks like your cUrl command is missing the password - it prompts - "Enter host password for user 'kuypers':" To make it easier for you to run the command, you can JFrog CLI and run a simple search command with the same credentials your Jenkins job uses. Something like: jfrog rt search "repo/" JFrog CLI creates an AQL query behind the scenes, so it should get the same result as with cUrl. I suggest cUrl initially, so that you can test the exact same AQL query from the Jenkins build log.
          Hide
          bruce Dirk Kuypers added a comment -

          Of course I entered the password. I tried more than one time (so no typos for the pw possible) and also tried my build account more than one time. The password is just hidden from the console output and was not copied.

          Show
          bruce Dirk Kuypers added a comment - Of course I entered the password. I tried more than one time (so no typos for the pw possible) and also tried my build account more than one time. The password is just hidden from the console output and was not copied.
          Hide
          bruce Dirk Kuypers added a comment -

          Is it possible, that this is related to:

          https://www.jfrog.com/jira/si/jira.issueviews:issue-html/HAP-946/HAP-946.html

          Because we use a proxy, too. And Artifactory is configured to bypass proxy.

          Show
          bruce Dirk Kuypers added a comment - Is it possible, that this is related to: https://www.jfrog.com/jira/si/jira.issueviews:issue-html/HAP-946/HAP-946.html Because we use a proxy, too. And Artifactory is configured to bypass proxy.
          Hide
          bruce Dirk Kuypers added a comment -

          Ok, that was the right hint. The bypassProxy is somehow ignored. Even with the explicit setting

          server.bypassProxy = true

          (and the same in the global Jenkins config) the download does not work. You can see the error 403 in the access.log of the squid server. When allowing the slave in the squid proxy settings the job is able to download.

          Show
          bruce Dirk Kuypers added a comment - Ok, that was the right hint. The bypassProxy is somehow ignored. Even with the explicit setting server.bypassProxy = true (and the same in the global Jenkins config) the download does not work. You can see the error 403 in the access.log of the squid server. When allowing the slave in the squid proxy settings the job is able to download.
          Hide
          fmateo Facu Mateo added a comment -

          I have a similar issue but I get a "404 Not found" response. 

          I downgraded to version 2.10.4 and it works as expected.

          Show
          fmateo Facu Mateo added a comment - I have a similar issue but I get a "404 Not found" response.  I downgraded to version 2.10.4 and it works as expected.

            People

            • Assignee:
              eyalbe Eyal Ben Moshe
              Reporter:
              bruce Dirk Kuypers
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: