开发者问题收集

Jenkins Pipeline 在上传工件时失败

2022-04-26
4732

我正尝试使用我的 Jenkins 文件将文件上传到 Artifactory 存储库。 管道在 Artifactory 上传阶段失败。

我使用的是 Jfrog-Artifactory 插件版本:3.15.4。

#Pipeline Script
rtUpload (
   serverId: 'app1-artifactory',
   spec: """{
      "files": [
            {
                "pattern": "*app*.tar.gz",
                "target": "myrepo/${Artifactory_Directory}/${Bld_ID}/artifacts/"
            },
            {
                "pattern": "*app*.tar.Z",
                "target": "myrepo/${Artifactory_Directory}/${Bld_ID}/artifacts/"
            }
         ]
    }"""
)
#Error
java.lang.Exception: Error occurred during operation, please refer to logs for more information.
    at org.jfrog.build.extractor.producerConsumer.ProducerConsumerExecutor.start(ProducerConsumerExecutor.java:85)
    at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecsHelper.uploadArtifactsBySpec(SpecsHelper.java:101)
    at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:166)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to mymachine
        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
        at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
        at hudson.remoting.Channel.call(Channel.java:1001)
        at hudson.FilePath.act(FilePath.java:1159)
        at hudson.FilePath.act(FilePath.java:1148)
        at org.jfrog.hudson.pipeline.common.executors.GenericUploadExecutor.execute(GenericUploadExecutor.java:56)
        at org.jfrog.hudson.pipeline.declarative.steps.generic.UploadStep$Execution.runStep(UploadStep.java:39)
        at org.jfrog.hudson.pipeline.declarative.steps.generic.UploadStep$Execution.runStep(UploadStep.java:24)
        at org.jfrog.hudson.pipeline.ArtifactorySynchronousNonBlockingStepExecution.run(ArtifactorySynchronousNonBlockingStepExecution.java:54)
        at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
        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)
Caused: java.lang.RuntimeException: Failed uploading artifacts by spec
    at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:168)
    at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:117)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3317)
    at hudson.remoting.UserRequest.perform(UserRequest.java:211)
    at hudson.remoting.UserRequest.perform(UserRequest.java:54)
    at hudson.remoting.Request$2.run(Request.java:376)
    at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
    at hudson.remoting.InterceptingExecutorService$$Lambda$8/0x000000008800fe60.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(FutureTask.java:277)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.lang.Thread.run(Thread.java:825)

有时在重建管道时,它会运行而不会出现错误,并且文件会成功上传到存储库。可能是什么问题?

2个回答

这似乎是一个未解决的问题 https://issues.jenkins.io/browse/JENKINS-66424

将 Artifactory 插件降级到版本 3.10.5 是解决问题前的解决方法。

kr_devops
2022-06-02

此问题已在 Jenkins 官方网站上公开

https://issues.jenkins.io/browse/JENKINS-66424

请检查链接。

Abhishek Patwa
2022-06-02