将Jenkins Artifact发布到Artifactory时出错

时间:2016-04-28 09:13:53

标签: jenkins continuous-integration artifactory artifact jenkins-2

我在从Jenkins(版本2.0)向Artifactory(版本4.4.2)发布zip文件时遇到问题。这两台机器都使用Windows Server 2012

我得到的是以下错误信息,有没有人在此之前遇到此问题?

 For pattern: Test_Upload.zip 1 artifacts were found
Deploying artifact: http://TESTPC:####/artifactory/Test_UploadFiles/Test_Upload.zip
ERROR: Connection reset by peer: socket write error
java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.write(AbstractSessionOutputBuffer.java:181)
    at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:115)
    at org.apache.http.entity.FileEntity.writeTo(FileEntity.java:101)
    at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
    at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:112)
    at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:117)
    at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:265)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:203)
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:237)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:122)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:685)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:487)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    at org.jfrog.build.client.PreemptiveHttpClient.execute(PreemptiveHttpClient.java:88)
    at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:199)
    at org.jfrog.build.client.ArtifactoryHttpClient.upload(ArtifactoryHttpClient.java:195)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:618)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:329)
    at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.deploy(GenericArtifactsDeployer.java:181)
    at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:153)
    at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:121)
    at hudson.FilePath.act(FilePath.java:990)
    at hudson.FilePath.act(FilePath.java:968)
    at org.jfrog.hudson.generic.GenericArtifactsDeployer.deploy(GenericArtifactsDeployer.java:80)
    at org.jfrog.hudson.generic.ArtifactoryGenericConfigurator$1.tearDown(ArtifactoryGenericConfigurator.java:340)
    at hudson.model.Build$BuildExecution.doRun(Build.java:173)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)

3 个答案:

答案 0 :(得分:0)

尝试使用Artifactory REST API运行与Jenkins作业相同的发布操作 - 您应该获得更好的诊断信息。

答案 1 :(得分:0)

以下curl命令可以验证凭据(假设可以无意覆盖文件内容),

curl -isS https://artifactory.COMPANY.TLD/artifactory/REPO/FILE -X PUT -T ~/Downloads/FILE -u 'CI_USER:CI_PASS'

答案 2 :(得分:0)

在 Artifactory UI 上创建一个存储库密钥类似于部署阶段(在 jenkins 管道中)的目标对我有用

artifactory deployment stage enter image description here