[HAP-855] Enhancement to Artifactory re-try capabilities for upload/download each Artifacts Created: 29/Nov/16  Updated: 13/Mar/18  Resolved: 25/Jun/17

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: Common
Affects Version/s: 2.8.1
Fix Version/s: 2.10.3

Type: Improvement Priority: High
Reporter: Narendra Yadav (Inactive) Assignee: Alexei Vainshtein
Resolution: Fixed Votes: 0
Labels: None


 Description   

Looking to enhance artifactory support re-tries in case of intermittent download/upload failures.

So for example, if the artifactory plugin failed to deploy one specific artifact (out of may artifacts) due to some intermittent issue such as a network glitch, it would then try to deploy again for a set # of times (which would be configurable) until it is successful. If all the retries fail, then the build at that point would fail. But if the retry succeeds, then the plugin moves on to the next artifact to be deployed.



 Comments   
Comment by Tomasz Długosz [ 12/Jan/18 ]

Does this really work?

Every now and then, we get issues like the following:
{{Deploying artifact: <filename>
ERROR: remote file operation failed: <path> at hudson.remoting.Channel@4276a185:JNLP4-connect connection from <host>: java.io.IOException: Failed to deploy file. Status code: 500 Response message: Artifactory returned the following errors:
Status code: 500
java.io.IOException: remote file operation failed: <path> at hudson.remoting.Channel@4276a185:JNLP4-connect connection from <host>: java.io.IOException: Failed to deploy file. Status code: 500 Response message: Artifactory returned the following errors:
Status code: 500
at hudson.FilePath.act(FilePath.java:993)
at hudson.FilePath.act(FilePath.java:975)
at org.jfrog.hudson.generic.GenericArtifactsDeployer.deploy(GenericArtifactsDeployer.java:76)
at org.jfrog.hudson.generic.ArtifactoryGenericConfigurator$1.tearDown(ArtifactoryGenericConfigurator.java:401)
at hudson.model.Build$BuildExecution.doRun(Build.java:174)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1724)
at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Caused by: java.io.IOException: Failed to deploy file. Status code: 500 Response message: Artifactory returned the following errors:
Status code: 500
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:2760)
at hudson.remoting.UserRequest.perform(UserRequest.java:205)
at hudson.remoting.UserRequest.perform(UserRequest.java:52)
at hudson.remoting.Request$2.run(Request.java:356)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
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 hudson.remoting.Engine$1$1.run(Engine.java:98)
at java.lang.Thread.run(Thread.java:748)
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from <host>
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1655)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:308)
at hudson.remoting.Channel.call(Channel.java:904)
at hudson.FilePath.act(FilePath.java:986)
at hudson.FilePath.act(FilePath.java:975)
at org.jfrog.hudson.generic.GenericArtifactsDeployer.deploy(GenericArtifactsDeployer.java:76)
at org.jfrog.hudson.generic.ArtifactoryGenericConfigurator$1.tearDown(ArtifactoryGenericConfigurator.java:401)
at hudson.model.Build$BuildExecution.doRun(Build.java:174)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1724)
at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Archiving artifacts
Recording fingerprints}}

We have number of retries set to 9 in global Jenkins config page, but it looks like there is no retrying at all.

Comment by Tomasz Długosz [ 13/Mar/18 ]

Does this retry mechanism work when deployment failed because of server side issues? Or maybe it only helps for broken connections?

Generated at Fri May 24 11:33:00 UTC 2019 using JIRA 7.6.3#76005-sha1:8a4e38d34af948780dbf52044e7aafb13a7cae58.