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

Artifactory plugin using entire artifact path for deploying URL

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Not A Defect
    • Component/s: artifactory-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.89.4 on Windows Server 2012 R2. Artifactory plugin 2.14.0.
    • Similar Issues:

      Description

      Artifactory plugin is using the entire artifact file system path when attempting to deploy the artifact from a freestyle job using Job configuration File Spec. I believe the cause of the issue was upgrading Jenkins to 2.89.4 from 2.73.3, as this job has been working successfully before the upgrade (but I also upgraded plugins, not sure Artifactory plugin's dependencies).

       

      File spec looks like so:

      {
      "files": [
      {
      "pattern": "${WORKSPACE}/App-${App_Version}.zip",
      "target": "my-repo/App/${App_Version}/",
      "recursive": "true",
      "flat" : "false"
      }
      ]
      }

       

      The artifact is properly identified in the job when run, but when it goes to deploy it uses the entire C:\ file system path in the URL. Log output looks like:

      For pattern: C:/Jenkins/jobs/app/workspace/app-version-1.6.11.zip 1 artifacts were found.
      Deploying artifact: https://server.com/artifactory/repos/app/1.6.11/C%3A/Jenkins/jobs/app/workspace/app-version-1.6.11.zip
      ERROR: Failed to deploy file. Status code: 500 Response message: Artifactory returned the following errors:
      Invalid path. ':' is not a valid name character: repos/app/1.6.11/C:/ Status code: 500
      java.io.IOException: Failed to deploy file. Status code: 500 Response message: Artifactory returned the following errors:
      Invalid path. ':' is not a valid name character: repos/app/1.6.11/C:/ Status code: 500
      at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:656)
      at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:343)
      at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecsHelper.deploy(SpecsHelper.java:291)
      at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecsHelper.uploadArtifactsBySpec(SpecsHelper.java:65)
      at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:189)
      at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:130)
      at hudson.FilePath.act(FilePath.java:997)
      at hudson.FilePath.act(FilePath.java:975)
      at org.jfrog.hudson.generic.GenericArtifactsDeployer.deploy(GenericArtifactsDeployer.java:76)
      at org.jfrog.hudson.generic.ArtifactoryGenericConfigurator$1.tearDown(ArtifactoryGenericConfigurator.java:401)
      at hudson.model.Build$BuildExecution.doRun(Build.java:174)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      at hudson.model.Run.execute(Run.java:1724)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE

       

      It is failing due to the : character in C:\, but regardless it should not be trying to deploy to that URL. Before the 2.89.4 upgrade it was working fine, now broken with no changed to the job config.
       

        Attachments

          Activity

          Hide
          eyalbe Eyal Ben Moshe added a comment - - edited

          Please try removing the $

          {WORKSPACE}

          / prefix from you File Spec pattern value, leaving only:

          "pattern": "App-${App_Version}.zip"
          

          This change was the result of a major bug which was fixed a few months ago.
          The bug prevented the upload of files which are not located inside the workspace.
          We do our best to avoid behavior changes, but in this case, it was unavoidable.
          We applogise for the inconvenience caused by this. Please let us know if this resolves the issue.

          Show
          eyalbe Eyal Ben Moshe added a comment - - edited Please try removing the $ {WORKSPACE} / prefix from you File Spec pattern value, leaving only: "pattern" : "App-${App_Version}.zip" This change was the result of a major bug which was fixed a few months ago. The bug prevented the upload of files which are not located inside the workspace. We do our best to avoid behavior changes, but in this case, it was unavoidable. We applogise for the inconvenience caused by this. Please let us know if this resolves the issue.
          Hide
          modemboy Andrew Grether added a comment -

          Eyal Ben Moshe thanks, that did the trick. No need to apologize with that fast of a response.

          Show
          modemboy Andrew Grether added a comment - Eyal Ben Moshe thanks, that did the trick. No need to apologize with that fast of a response.
          Hide
          modemboy Andrew Grether added a comment - - edited

          Fixed with config change, feel free to close

          Show
          modemboy Andrew Grether added a comment - - edited Fixed with config change, feel free to close
          Hide
          psk1987 Prachi Khadke added a comment -

          Still getting 

           

          hudson.remoting.Channel$CallSiteStackTrace: Remote call to slave1
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
          at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
          at hudson.remoting.Channel.call(Channel.java:952)
          at hudson.FilePath.act(FilePath.java:998)
          at hudson.FilePath.act(FilePath.java:987)
          at org.jfrog.hudson.pipeline.executors.GenericUploadExecutor.execution(GenericUploadExecutor.java:52)
          at org.jfrog.hudson.pipeline.steps.UploadStep$Execution.run(UploadStep.java:65)
          at org.jfrog.hudson.pipeline.steps.UploadStep$Execution.run(UploadStep.java:46)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          java.io.IOException: Failed to deploy file. Status code: 401 Response message: Artifactory returned the following errors: 
          Unauthorized Status code: 401
          at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:672)
          at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:353)
          at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecsHelper.deploy(SpecsHelper.java:291)
          at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecsHelper.uploadArtifactsBySpec(SpecsHelper.java:65)
          at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:190)
          at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:131)
          at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2816)
          at hudson.remoting.UserRequest.perform(UserRequest.java:210)
          at hudson.remoting.UserRequest.perform(UserRequest.java:53)
          at hudson.remoting.Request$2.run(Request.java:364)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          

           

          Show
          psk1987 Prachi Khadke added a comment - Still getting    hudson.remoting.Channel$CallSiteStackTrace: Remote call to slave1 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737) at hudson.remoting.UserResponse.retrieve(UserRequest.java:313) at hudson.remoting.Channel.call(Channel.java:952) at hudson.FilePath.act(FilePath.java:998) at hudson.FilePath.act(FilePath.java:987) at org.jfrog.hudson.pipeline.executors.GenericUploadExecutor.execution(GenericUploadExecutor.java:52) at org.jfrog.hudson.pipeline.steps.UploadStep$Execution.run(UploadStep.java:65) at org.jfrog.hudson.pipeline.steps.UploadStep$Execution.run(UploadStep.java:46) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:290) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) java.io.IOException: Failed to deploy file. Status code: 401 Response message: Artifactory returned the following errors: Unauthorized Status code: 401 at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:672) at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:353) at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecsHelper.deploy(SpecsHelper.java:291) at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecsHelper.uploadArtifactsBySpec(SpecsHelper.java:65) at org.jfrog.hudson. generic .GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:190) at org.jfrog.hudson. generic .GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:131) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2816) at hudson.remoting.UserRequest.perform(UserRequest.java:210) at hudson.remoting.UserRequest.perform(UserRequest.java:53) at hudson.remoting.Request$2.run(Request.java:364) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)  

            People

            • Assignee:
              eyalbe Eyal Ben Moshe
              Reporter:
              modemboy Andrew Grether
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: