简体   繁体   English

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

[英]Jenkins Artifactory Plugin not working with recent Artifactory version

We have the following steps in our Jenkinsfile (trying to upload artifacts to our Artifactory server): 我们在Jenkinsfile执行以下步骤(尝试将工件上传到Artifactory服务器):

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

This used to work until we updated to a newer version of Artifactory. 在我们更新到较新版本的Artifactory之前,此方法一直有效。 Ever since the update, we get the following error when running the build job: 自更新以来,运行构建作业时,我们会收到以下错误消息:

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

Some background regarding our setup: 有关设置的一些背景:

  • Jenkins version 2.69 Jenkins版本2.69
  • Artifactory version 5.8.4 Artifactory版本5.8.4
  • Artifactory plugin version 2.14.0 Artifactory插件版本2.14.0
  • the error started to appear with a recent update of Artifactory 该错误开始出现在Artifactory的最新更新中
  • the Artifactory log shows no output for the error Artifactory日志未显示错误输出
  • we are sitting behind a proxy, but no_proxy is set correctly, at least we can curl https://... to our Artifactory host 我们坐在代理后面,但是正确设置了no_proxy ,至少我们可以将curl https://...到我们的Artifactory主机
  • we have self-signed certificates for Artifactory, but they should be properly added to the java truststore and the system truststore, since we can open URLs in java apps as well as with curl without any issues. 我们有Artifactory的自签名证书,但是应该将它们正确添加到java信任库和系统信任库中,因为我们可以在java应用程序中打开URLs ,也可以使用curl来打开URLs ,而不会出现任何问题。

Any idea how we could debug this issue? 知道如何调试此问题吗?

I had a very similar issue and found the solution in the configuration of the Artifactory-Jenkins plugin (manage jenkins --> configure system --> artifactory). 我遇到了一个非常相似的问题,并在Artifactory-Jenkins插件的配置(管理jenkins->配置系统->人工制品)中找到了解决方案。

What I did was changing the Artifactory server URL from: 我所做的是从以下位置更改了Artifactory服务器URL:

https://<artifactorydomain.com>

to the new URL (adding the /artifactory ): 到新的URL(添加/artifactory ):

https://<artifactorydomain.com>/artifactory

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM