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

Artifactory plugin 2.12.* generic pipeline download does not work

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • artifactory-plugin
    • 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.

      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
       

       

          [JENKINS-45645] Artifactory plugin 2.12.* generic pipeline download does not work

          Dirk Kuypers created issue -
          Dirk Kuypers made changes -
          Description Original: 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,91002133|https://1sp-build.rsint.net/user/kuypers]
          [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
           

           
          New: 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|https://1sp-build.rsint.net/user/kuypers]
           [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
            

           

          I was not able to reproduce this issue with version 2.12.1 of the Artifactory Plugin.

          It looks like you get a 403 Forbidden HTTP response from Artifactory...

          Does the Artifactory user you're trying to upload the files with has write permissions to this specific repository? Could it be that the repository name is incorrect?

          Additionally, you should be able to see this request in the Artifactory requests.log. The log might provide more clues as for the reason of the 403 response. Another troubleshooting step could be to use JFrog CLI with the same user, in an attempt to get more clues.

          I can't think of a scenario for this request to succeed with 2.11 and fail with 2.12. Perhaps the above suggested troubleshooting steps can shed more light on this.

          Eyal Ben Moshe added a comment - I was not able to reproduce this issue with version 2.12.1 of the Artifactory Plugin. It looks like you get a 403 Forbidden HTTP response from Artifactory... Does the Artifactory user you're trying to upload the files with has write permissions to this specific repository? Could it be that the repository name is incorrect? Additionally, you should be able to see this request in the Artifactory requests.log. The log might provide more clues as for the reason of the 403 response. Another troubleshooting step could be to use JFrog CLI with the same user, in an attempt to get more clues. I can't think of a scenario for this request to succeed with 2.11 and fail with 2.12. Perhaps the above suggested troubleshooting steps can shed more light on this.

          Dirk Kuypers added a comment -

          Thanks for the fast response!

          IMHO the 403 is somehow misleading because with 2.11 and 2.10 the same code works (we had to go back to 2.10 because 2.11 had another issue with uploading for my colleague). With 2.10, 2.11, 2.12.* I am able to upload these files with the same user credentials to the server. My test script is only a minimal snippet from a bigger script to be able to reproduce the error without having to checkout, build, upload all stuff. The bigger script works now, too, with the older plugin version.

          Have you tried my pipeline snippet with an existing artifact on your server? I think JIRA ate the double backslash for the working dir...

          Dirk Kuypers added a comment - Thanks for the fast response! IMHO the 403 is somehow misleading because with 2.11 and 2.10 the same code works (we had to go back to 2.10 because 2.11 had another issue with uploading for my colleague). With 2.10, 2.11, 2.12.* I am able to upload these files with the same user credentials to the server. My test script is only a minimal snippet from a bigger script to be able to reproduce the error without having to checkout, build, upload all stuff. The bigger script works now, too, with the older plugin version. Have you tried my pipeline snippet with an existing artifact on your server? I think JIRA ate the double backslash for the working dir...

          Eyal Ben Moshe added a comment - - edited

          I actually tried this script:

          https://github.com/JFrogDev/project-examples/blob/master/jenkins-pipeline-examples/props-example/Jenkinsfile

          It is pretty similar to yours. This is one of the scripts we use for testing new releases. Any chance you can try it out? All you need to do is replace the SERVER_ID  and run it.

          Eyal Ben Moshe added a comment - - edited I actually tried this script: https://github.com/JFrogDev/project-examples/blob/master/jenkins-pipeline-examples/props-example/Jenkinsfile It is pretty similar to yours. This is one of the scripts we use for testing new releases. Any chance you can try it out? All you need to do is replace the SERVER_ID  and run it.

          Dirk Kuypers added a comment -

          Argh, I am behind a corporate proxy and I need to work around this.:-/ They do not want us to import github projects from the internet....

          Dirk Kuypers added a comment - Argh, I am behind a corporate proxy and I need to work around this.:-/ They do not want us to import github projects from the internet....

          Dirk Kuypers added a comment -

          Ok, got it running. Cloned it to our corporate gitlab server, added the repo name and server ID and changed the git call to just checkout scm. Job runs sucessfully with 2.10. Have to wait for the next Jenkins update to re-test with 2.12.1

          Dirk Kuypers added a comment - Ok, got it running. Cloned it to our corporate gitlab server, added the repo name and server ID and changed the git call to just checkout scm. Job runs sucessfully with 2.10. Have to wait for the next Jenkins update to re-test with 2.12.1

          Dirk Kuypers added a comment - - edited

          Upgrading to 2.12.1 again shows the same error as with my scripts:
          Checking out git
          https://codequal.*****.net/kuypers/project-examples.git
          to read jenkins-pipeline-examples/props-example/Jenkinsfile
          Fetching changes from the remote Git repository
          Checking out Revision 8fa0dfd7c2169e8552e5821a421c4ab91e8fb220 (refs/remotes/origin/master)
          Commit message: "Added our repo"
          [Pipeline] node
          Running on 1sp-slave05 in D:\Jenkins\workspace\TEST_Artifactory_Download_Vanilla
          [Pipeline] {
          [Pipeline] checkout
          Cloning the remote Git repository
          remote: Counting objects
          remote: Compressing objects
          Receiving objects
          Resolving deltas
          Updating references
          Checking out Revision 8fa0dfd7c2169e8552e5821a421c4ab91e8fb220 (refs/remotes/origin/master)
          Commit message: "Added our repo"
          [Pipeline] getArtifactoryServer
          [Pipeline] readFile
          [Pipeline] artifactoryUpload
          For pattern: jenkins-pipeline-examples/resources/ArtifactoryPipeline.zip 1 artifacts were found.
          For pattern: jenkins-pipeline-examples/resources/ArtifactoryPipelineNoProps.zip 1 artifacts were found.
          [Pipeline] readFile
          [Pipeline] artifactoryDownload
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] End of Pipeline
          java.io.IOException: Failed to search artifact by the aql 'items.find({"repo": "my_repo","@p1": {"$match" : "v1"},"@p2": {"$match" : "v2"},"$or": [{"$and": [
          {"path":

          {"$match":"libs-snapshot-local"}

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

          {"$match":"libs-snapshot-local/*"}

          ,"name":
          {"$match":"*Pipeline.zip"}}]}]})': 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-slave5.rsint.net/10.0.21.38:63675(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:\Jenkins\workspace\TEST_Artifactory_Download_Vanilla at hudson.remoting.Channel@dc80d9d:JNLP4-connect connection from 1sp-slave5.rsint.net/10.0.21.38:63675
          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

          Dirk Kuypers added a comment - - edited Upgrading to 2.12.1 again shows the same error as with my scripts: Checking out git https://codequal.*****.net/kuypers/project-examples.git to read jenkins-pipeline-examples/props-example/Jenkinsfile Fetching changes from the remote Git repository Checking out Revision 8fa0dfd7c2169e8552e5821a421c4ab91e8fb220 (refs/remotes/origin/master) Commit message: "Added our repo" [Pipeline] node Running on 1sp-slave05 in D:\Jenkins\workspace\TEST_Artifactory_Download_Vanilla [Pipeline] { [Pipeline] checkout Cloning the remote Git repository remote: Counting objects remote: Compressing objects Receiving objects Resolving deltas Updating references Checking out Revision 8fa0dfd7c2169e8552e5821a421c4ab91e8fb220 (refs/remotes/origin/master) Commit message: "Added our repo" [Pipeline] getArtifactoryServer [Pipeline] readFile [Pipeline] artifactoryUpload For pattern: jenkins-pipeline-examples/resources/ArtifactoryPipeline.zip 1 artifacts were found. For pattern: jenkins-pipeline-examples/resources/ArtifactoryPipelineNoProps.zip 1 artifacts were found. [Pipeline] readFile [Pipeline] artifactoryDownload [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline java.io.IOException: Failed to search artifact by the aql 'items.find({"repo": "my_repo","@p1": {"$match" : "v1"},"@p2": {"$match" : "v2"},"$or": [{"$and": [ {"path": {"$match":"libs-snapshot-local"} ,"name": {"$match":"*Pipeline.zip"}}]},{"$and": [ {"path": {"$match":"libs-snapshot-local/*"} ,"name": {"$match":"*Pipeline.zip"}}]}]})': 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-slave5.rsint.net/10.0.21.38:63675(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:\Jenkins\workspace\TEST_Artifactory_Download_Vanilla at hudson.remoting.Channel@dc80d9d:JNLP4-connect connection from 1sp-slave5.rsint.net/10.0.21.38:63675 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

          It looks like Artifactory returns 403 Forbidden for the AQL search command.

          The fact that this worked for you with the older version and does not work with 2.12.1 is really strange. The only idea I have for the reason 403 is returned, is that this request is sent to Artifactory with no credentials or that the user has no permissions to run the AQL search. On the other hand, you say this works with the older version - I'm not sure how this can happen.

          I have the following suggested troubleshooting steps which may help get to the bottom of this:

          1. You can look at requests.log is Artifactory for this request and see if the logs provides more info about why 493 is returned.
          2. You can try and run this exact AQL (copy it from the logs) with cUrl, using the same credentials. If you get 403 response, then we can focus on why Artifactory returns 403 for this AQL search. In case it succeeds with cUrl, we should check again which credentials are used by Jenkins. 

          Eyal Ben Moshe added a comment - It looks like Artifactory returns 403 Forbidden for the AQL search command. The fact that this worked for you with the older version and does not work with 2.12.1 is really strange. The only idea I have for the reason 403 is returned, is that this request is sent to Artifactory with no credentials or that the user has no permissions to run the AQL search. On the other hand, you say this works with the older version - I'm not sure how this can happen. I have the following suggested troubleshooting steps which may help get to the bottom of this: You can look at requests.log is Artifactory for this request and see if the logs provides more info about why 493 is returned. You can try and run this exact AQL (copy it from the logs) with cUrl, using the same credentials. If you get 403 response, then we can focus on why Artifactory returns 403 for this AQL search. In case it succeeds with cUrl, we should check again which credentials are used by Jenkins. 

          Dirk Kuypers added a comment -

          Is this the right curl call? Sorry, I am not familiar with it. The server uses a self-signed certificate which is not 100 % perfect. May this be something that coul cause a 403? The curl call gives another error though.... I am not sure if that is something which could be related to the parsing erros and a windows console? 

          curl -u kuypers -k -i -X POST https://artifactory.*****.net/artifactory/api/search/aql -H "Content-Type: text/plain" -d 'items.find({"repo": "my_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":"*"}}]}]})'
          Enter host password for user 'kuypers':
          HTTP/1.1 500 Internal Server Error
          Date: Thu, 20 Jul 2017 16:24:51 GMT
          Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_auth_kerb/5.4
          Content-Type: application/json;charset=ISO-8859-1
          Content-Length: 133
          Connection: close

          {
          "errors" : [ {
          "status" : 500,
          "message" : "Artifactory failed to initialize: check Artifactory logs for errors."
          } ]
          }curl: (6) Could not resolve host: my_repo,$or
          curl: (3) [globbing] bad range specification in column 2
          curl: (3) [globbing] bad range specification in column 2
          curl: (3) [globbing] unmatched close brace/bracket in column 80
          curl: (3) [globbing] bad range specification in column 2
          curl: (3) [globbing] unmatched close brace/bracket in column 82

          Dirk Kuypers added a comment - Is this the right curl call? Sorry, I am not familiar with it. The server uses a self-signed certificate which is not 100 % perfect. May this be something that coul cause a 403? The curl call gives another error though.... I am not sure if that is something which could be related to the parsing erros and a windows console?  curl -u kuypers -k -i -X POST https://artifactory.*****.net/artifactory/api/search/aql -H "Content-Type: text/plain" -d 'items.find({"repo": "my_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":"*"}}] }]})' Enter host password for user 'kuypers': HTTP/1.1 500 Internal Server Error Date: Thu, 20 Jul 2017 16:24:51 GMT Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_auth_kerb/5.4 Content-Type: application/json;charset=ISO-8859-1 Content-Length: 133 Connection: close { "errors" : [ { "status" : 500, "message" : "Artifactory failed to initialize: check Artifactory logs for errors." } ] }curl: (6) Could not resolve host: my_repo,$or curl: (3) [globbing] bad range specification in column 2 curl: (3) [globbing] bad range specification in column 2 curl: (3) [globbing] unmatched close brace/bracket in column 80 curl: (3) [globbing] bad range specification in column 2 curl: (3) [globbing] unmatched close brace/bracket in column 82

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

              Created:
              Updated: