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

Artifactory plugin 2.12.* generic pipeline download does not work

    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 -

          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.

          Show
          eyalbe 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.
          Hide
          bruce 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...

          Show
          bruce 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...
          Hide
          eyalbe 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.

          Show
          eyalbe 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.
          Hide
          bruce 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....

          Show
          bruce 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....
          Hide
          bruce 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

          Show
          bruce 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
          Hide
          bruce 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

          Show
          bruce 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
          Hide
          eyalbe 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:

          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. 
          Show
          eyalbe 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. 
          Hide
          bruce 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

          Show
          bruce 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
          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: