Jenkins Artifactory插件不适用于最近的Artifactory版本

时间:2018-03-08 16:08:15

标签: jenkins groovy jenkins-plugins jenkins-pipeline artifactory

我们在N中有以下步骤(尝试将工件上传到Artifactory服务器):

Jenkinsfile

这一直有效,直到我们更新到更新版本的Artifactory。自更新以来,运行构建作业时出现以下错误:

def server = script.Artifactory.server("our-artifactory-server-id")
def uploadSpec = """{
  "files": [
  {
    "pattern": "${sourcePath}",
    "target": "${targetPath}"
  }
 ]
}"""
server.upload(uploadSpec)

有关我们设置的一些背景知识:

  • Jenkins版本java.io.IOException: Failed to deploy file. Status code: 400 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$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(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:745) at ......remote call to docker-bc26fb0b91c4(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: /home/jenkins/workspace/tration_feature_jenkinsfile-ANARWI2SDBPRVZNIYHCS6XKXIAD2SZ5ZTHM6DRXHYSARAQHPWEMQ at hudson.remoting.Channel@4c39a5aa:docker-bc26fb0b91c4 at hudson.FilePath.act(FilePath.java:994) at hudson.FilePath.act(FilePath.java:976) 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: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:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Finished: FAILURE
  • Artifactory version 2.69
  • Artifactory插件版本5.8.4
  • 错误开始出现,最近更新了Artifactory
  • Artifactory日志显示错误输出
  • 我们坐在代理后面,但2.14.0设置正确,至少我们可以no_proxy到我们的Artifactory主持人
  • 我们有Artifactory的自签名证书,但是它们应该正确地添加到java信任库和系统信任库中,因为我们可以在java应用程序中打开curl https://...以及在URLs中打开curl的问题。

知道如何调试此问题吗?

1 个答案:

答案 0 :(得分:2)

我有一个非常类似的问题,在Artifactory-Jenkins插件的配置中找到了解决方案(管理jenkins - > configure system - > artifactory)。

我所做的是更改Artifactory服务器URL:

https://<artifactorydomain.com>

到新网址(添加/artifactory):

https://<artifactorydomain.com>/artifactory

希望这有帮助。