Jenkins Artifactory 插件不适用于最新的 Artifactory 版本
Jenkins Artifactory Plugin not working with recent Artifactory version
我们在 Jenkinsfile
中有以下步骤(尝试将工件上传到我们的 Artifactory 服务器):
def server = script.Artifactory.server("our-artifactory-server-id")
def uploadSpec = """{
"files": [
{
"pattern": "${sourcePath}",
"target": "${targetPath}"
}
]
}"""
server.upload(uploadSpec)
在我们更新到较新版本的 Artifactory 之前,这一直有效。自更新以来,运行 构建作业时出现以下错误:
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.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService.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.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:260)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution.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
关于我们设置的一些背景:
- 詹金斯版本
2.69
- Artifactory 版本
5.8.4
- Artifactory 插件版本
2.14.0
- 最近更新 Artifactory 后开始出现错误
- Artifactory 日志未显示错误的输出
- 我们坐在代理后面,但
no_proxy
设置正确,至少我们可以 curl https://...
到我们的 Artifactory 主机
- 我们有 Artifactory 的自签名证书,但它们应该正确添加到 java 信任库和系统信任库,因为我们可以在 java 应用程序中打开
URLs
curl
也没有任何问题。
知道我们如何调试这个问题吗?
我有一个非常相似的问题,并在 Artifactory-Jenkins 插件的配置中找到了解决方案(管理 jenkins --> 配置系统 --> artifactory)。
我所做的是将 Artifactory 服务器 URL 更改为:
https://<artifactorydomain.com>
到新的URL(添加/artifactory
):
https://<artifactorydomain.com>/artifactory
希望对您有所帮助。
我们在 Jenkinsfile
中有以下步骤(尝试将工件上传到我们的 Artifactory 服务器):
def server = script.Artifactory.server("our-artifactory-server-id")
def uploadSpec = """{
"files": [
{
"pattern": "${sourcePath}",
"target": "${targetPath}"
}
]
}"""
server.upload(uploadSpec)
在我们更新到较新版本的 Artifactory 之前,这一直有效。自更新以来,运行 构建作业时出现以下错误:
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.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService.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.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:260)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution.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
关于我们设置的一些背景:
- 詹金斯版本
2.69
- Artifactory 版本
5.8.4
- Artifactory 插件版本
2.14.0
- 最近更新 Artifactory 后开始出现错误
- Artifactory 日志未显示错误的输出
- 我们坐在代理后面,但
no_proxy
设置正确,至少我们可以curl https://...
到我们的 Artifactory 主机 - 我们有 Artifactory 的自签名证书,但它们应该正确添加到 java 信任库和系统信任库,因为我们可以在 java 应用程序中打开
URLs
curl
也没有任何问题。
知道我们如何调试这个问题吗?
我有一个非常相似的问题,并在 Artifactory-Jenkins 插件的配置中找到了解决方案(管理 jenkins --> 配置系统 --> artifactory)。
我所做的是将 Artifactory 服务器 URL 更改为:
https://<artifactorydomain.com>
到新的URL(添加/artifactory
):
https://<artifactorydomain.com>/artifactory
希望对您有所帮助。