• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • artifactory-plugin
    • None
    • Jenkins 2.19.4
      Artifactory Plugin: 2.8.1
      Pipeline: 2.4

      Attempt to redeploy an artifact for a jenkins pipeline when the configured user does not have permissions in artifactory results in connection reset error on the slave. The build aborts and the error cannot be catured in a try/catch

      Artifactory log error:
      2016-12-05 14:37:51,357 [http-nio-8081-exec-12253] [WARN ] (o.a.r.ArtifactoryResponseBase:107) - Sending HTTP error code 403: Not enough permissions to overwrite artifact 'kit-dev-local:com/jsitelecom/kit/15.05.00.354/kit.manifest' (user 'build' needs DELETE permission).

      Jenkins Error:
      java.io.IOException: remote file operation failed: D:\ws\Jenkins/TestJobs/Test_Kit at hudson.remoting.Channel@61b06c49:dt-kit4: java.net.SocketException: Connection reset
      at hudson.FilePath.act(FilePath.java:1014)
      at hudson.FilePath.act(FilePath.java:996)
      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.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
      at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
      at org.jfrog.hudson.pipeline.types.ArtifactoryServer.upload(ArtifactoryServer.java:121)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap.invoke(PojoMetaMethodSite.java:213)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18)
      at com.jsitelecom.BuildRecord.uploadArtifacts(/var/lib/jenkins/jobs/Jenkins/jobs/TestJobs/jobs/Test_Kit/builds/27/libs/JSI/src/com/jsitelecom/BuildRecord.groovy:429)
      at com.jsitelecom.BuildRecord.onComplete(/var/lib/jenkins/jobs/Jenkins/jobs/TestJobs/jobs/Test_Kit/builds/27/libs/JSI/src/com/jsitelecom/BuildRecord.groovy:178)
      at WorkflowScript.run(WorkflowScript:81)
      at timestampedNode.call(/var/lib/jenkins/workflow-libs/vars/timestampedNode.groovy:19)
      at __cps.transform__(Native Method)
      at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
      at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
      at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
      at sun.reflect.GeneratedMethodAccessor336.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:76)
      at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
      at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
      at sun.reflect.GeneratedMethodAccessor315.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
      at com.cloudbees.groovy.cps.Next.step(Next.java:58)
      at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
      at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:163)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224)
      at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
      at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.net.SocketException: Connection reset
      at java.net.SocketInputStream.read(SocketInputStream.java:209)
      at java.net.SocketInputStream.read(SocketInputStream.java:141)
      at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:160)
      at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:84)
      at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:206)
      at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:191)
      at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137)
      at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
      at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
      at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
      at java.io.InputStreamReader.read(InputStreamReader.java:184)
      at java.io.Reader.read(Reader.java:140)
      at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2001)
      at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1980)
      at org.apache.commons.io.IOUtils.copy(IOUtils.java:1957)
      at org.apache.commons.io.IOUtils.copy(IOUtils.java:1907)
      at org.apache.commons.io.IOUtils.toString(IOUtils.java:778)
      at org.apache.commons.io.IOUtils.toString(IOUtils.java:803)
      at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:206)
      at org.jfrog.build.client.ArtifactoryHttpClient.upload(ArtifactoryHttpClient.java:195)
      at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:579)
      at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:282)
      at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.deploy(GenericArtifactsDeployer.java:217)
      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:2772)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:325)
      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 hudson.remoting.Engine$1$1.run(Engine.java:69)
      at java.lang.Thread.run(Thread.java:745)
      at ......remote call to dt-kit4(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1433)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      at hudson.remoting.Channel.call(Channel.java:797)
      at hudson.FilePath.act(FilePath.java:1007)
      at hudson.FilePath.act(FilePath.java:996)
      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.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
      at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
      at org.jfrog.hudson.pipeline.types.ArtifactoryServer.upload(ArtifactoryServer.java:121)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap.invoke(PojoMetaMethodSite.java:213)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18)
      ... 31 more

          [JENKINS-40230] redeploy artifact crashes job

          Hi Marc,
          I think that response message should be improved and indicate the missing deployment permission, but shouldn't the build fail when the deployment fails?

          Eyal Ben Moshe added a comment - Hi Marc, I think that response message should be improved and indicate the missing deployment permission, but shouldn't the build fail when the deployment fails?

          Marc Robinson added a comment -

          I think an improved message is fine. The main issue is that this kills the entire pipeline thread and prevents any additional error handling. I am not able to catch the current error and send notifications, report status, etc.

          My expectation is that it can be logged appropriately and caught upstream as an exception so it can be handled by the user.

          Marc Robinson added a comment - I think an improved message is fine. The main issue is that this kills the entire pipeline thread and prevents any additional error handling. I am not able to catch the current error and send notifications, report status, etc. My expectation is that it can be logged appropriately and caught upstream as an exception so it can be handled by the user.

          mcrooney added a comment -

          Thanks, this issue was a life saver! I kept seeing "Connection reset" and had no idea what was wrong. It was indeed Artifactory permissions. I would love to see an improved error message

          mcrooney added a comment - Thanks, this issue was a life saver! I kept seeing "Connection reset" and had no idea what was wrong. It was indeed Artifactory permissions. I would love to see an improved error message

          I'm adding my vote to request a better error message here as well. It is an infrequent, but not rare issue for us. Unfortunately it always confuses the developer who runs into the issue into thinking there is an Artifactory problem and they escalate the issue pretty quickly since they see "Caused by: java.net.SocketException: Connection reset" in the Jenkins build log, which they interpret as a network problem or an issue with the Artifactory repository. Since they do not have access to the Artifactory log, they never see the "[DENIED DELETE]" entry in the access log. If they had that information they would have a much better chance of figuring out that they are trying to overwrite an already released artifact.

          We still encounter this with version 2.15.0 of the Artifactory plugin in Jenkins 2.89.3. 

          John McCullough added a comment - I'm adding my vote to request a better error message here as well. It is an infrequent, but not rare issue for us. Unfortunately it always confuses the developer who runs into the issue into thinking there is an Artifactory problem and they escalate the issue pretty quickly since they see "Caused by: java.net.SocketException: Connection reset" in the Jenkins build log, which they interpret as a network problem or an issue with the Artifactory repository. Since they do not have access to the Artifactory log, they never see the " [DENIED DELETE] " entry in the access log. If they had that information they would have a much better chance of figuring out that they are trying to overwrite an already released artifact. We still encounter this with version 2.15.0 of the Artifactory plugin in Jenkins 2.89.3. 

            eyalbe Eyal Ben Moshe
            marcrobinson Marc Robinson
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: