Artifactory Gradle plugin giving broken pipe

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Artifactory Gradle plugin giving broken pipe

dori
Hi all,

I am running a build on a CI server using "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"

This is one of four java builds all with the same setup - 3 work fine but one is failing with the stack trace listed below. the 3 which pass are all pushing an artifact to artifactory of size <10kb and the failing one is ~80Kb. The deploy works locally and fails with CI - the CI guys dont know what could be causing the below and wondering if anyone can shed any light on what maybe causing the broken pipe and if there are any size limitations / permission limitationsI am not aware of in the plugin that could result in this issue!

Thanks for any pointers :)

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':artifactoryPublish'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:306)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:169)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.Main.doAction(Main.java:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.internal.UncheckedException: java.net.SocketException: Broken pipe
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:66)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 47 more
Caused by: java.net.SocketException: Broken pipe
        at org.apache.http.impl.io.AbstractSessionOutputBuffer.write(AbstractSessionOutputBuffer.java:169)
        at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:119)
        at org.apache.http.entity.FileEntity.writeTo(FileEntity.java:107)
        at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:98)
        at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
        at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:122)
        at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:271)
        at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:197)
        at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:257)
        at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
        at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:715)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:520)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
        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:619)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:330)
        at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.deployArtifacts(BuildInfoBaseTask.java:409)
        at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.prepareAndDeploy(BuildInfoBaseTask.java:284)
        at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.collectProjectBuildInfo(BuildInfoBaseTask.java:363)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
        ... 54 more
Reply | Threaded
Open this post in threaded view
|

Re: Artifactory Gradle plugin giving broken pipe

uriahl
Hi Dori,

Neither the Jenkins Artifactory Plugin nor your Artifactory server will impose any direct size limitations for remote deployments. The "broken pipe" error could sometimes surface in out of memory situations (when the deployment process is disrupted due to insufficient memory to perform the procedure). If you are accessing Artifactory via a proxy server, it's also possible that this server terminates the connection according to its own criteria/imposing its own limitations (such as a size limit). We recommend debugging this by trying to directly deploy a file of similar proportions using an HTTP client such as cURL and the Artifactory REST API (bypassing any proxy servers in the way), which is essentially what the JAP is doing.

HTH,
Uriah
Reply | Threaded
Open this post in threaded view
|

Re: Artifactory Gradle plugin giving broken pipe

dori
Thanks for the reply - I have partially solved the issue - insomuch as its not causing me an issue anymore but cant explain it fully.

I have set artifactory up so my deploy user only has deploy permissions and not delete - this is so versioned artifacts cannot be redeployed by accident. For all my other repos this will result in a 403 (as expected) if a version number already exists for the artifact that is trying to be deployed. However, for this repo it will give a broken pipe.

No idea why is acting differntly but at least I know what the issue is, was a bit of a red herring for me.

May represent a bug with the plugin? I can see its using HttpClient which used to be super buggy....maybe okhttp would be better!
Reply | Threaded
Open this post in threaded view
|

Re: Artifactory Gradle plugin giving broken pipe

sspacey
In reply to this post by dori
I had the same same error but the cause was simple - user didn't have permission to upload to the repo.
This is clear from the gradle debug trace below. The plugin does PUT gets a 403 and for some reason tries the PUT again. The 2nd PUT results in the Broken Pipe. Whatever, the problem was solved by granting the user upload permission, PUT succeeds on 1st attempt. (gradle artifactory plugin 4.4.0, artifactory 4.11.0)

10:14:21.510 [DEBUG] [org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask] Uploading artifacts to Artifactory at 'http://xxxx:8081/artifactory'
10:14:21.510 [LIFECYCLE] [org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask] Deploying artifact: http://xxxx:8081/artifactory/libs-release-local/org/xxxx.jar
10:14:21.517 [DEBUG] [org.apache.http.impl.conn.BasicClientConnectionManager] Get connection for route {}->http://xxxx:8081
10:14:21.517 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnectionOperator] Connecting to xxxx:8081
10:14:21.518 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: best-match
10:14:21.518 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
10:14:21.518 [DEBUG] [org.apache.http.client.protocol.RequestTargetAuthentication] Target auth state: UNCHALLENGED
10:14:21.518 [DEBUG] [org.apache.http.client.protocol.RequestProxyAuthentication] Proxy auth state: UNCHALLENGED
10:14:21.518 [DEBUG] [org.apache.http.impl.client.DefaultHttpClient] Attempt 1 to execute request
10:14:21.518 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Sending request: GET /artifactory/api/system/version HTTP/1.1
10:14:21.521 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 200 OK
10:14:21.521 [DEBUG] [org.apache.http.impl.client.DefaultHttpClient] Connection can be kept alive indefinitely
10:14:21.522 [DEBUG] [org.apache.http.impl.conn.BasicClientConnectionManager] Releasing connection org.apache.http.impl.conn.ManagedClientConnectionImpl@252f2de5
10:14:21.522 [DEBUG] [org.apache.http.impl.conn.BasicClientConnectionManager] Connection can be kept alive indefinitely
10:14:21.522 [DEBUG] [org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask] Version result: {"version":"4.11.0","revision":"40239","addons":[],"license":"Artifactory OSS"}
10:14:21.523 [DEBUG] [org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask] Full Artifact Http path: PUT http://xxxx:8081/artifactory/libs-release-local/org/xxxx.jar;build.timestamp=1472026458568;build.name=xxxx;build.number=1472026458820 HTTP/1.1
@Http Headers: [X-Checksum-Sha1: b4dfb2a45625237baf5b238a54be5eab59840915, X-Checksum-Md5: aa38c8b7e9334341d460c6195f8d4cfe]
10:14:21.523 [DEBUG] [org.apache.http.impl.conn.BasicClientConnectionManager] Get connection for route {}->http://xxxx:8081
10:14:21.523 [DEBUG] [org.apache.http.impl.client.DefaultHttpClient] Stale connection check
10:14:21.525 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: best-match
10:14:21.525 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
10:14:21.526 [DEBUG] [org.apache.http.client.protocol.RequestTargetAuthentication] Target auth state: UNCHALLENGED
10:14:21.526 [DEBUG] [org.apache.http.client.protocol.RequestProxyAuthentication] Proxy auth state: UNCHALLENGED
10:14:21.527 [DEBUG] [org.apache.http.impl.client.DefaultHttpClient] Attempt 1 to execute request
10:14:21.527 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Sending request: PUT /artifactory/libs-release-local/org/xxxx.jar;build.timestamp=1472026458568;build.name=xxxx;build.number=1472026458820 HTTP/1.1
10:14:21.531 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 403 Forbidden
10:14:21.531 [DEBUG] [org.apache.http.impl.client.DefaultHttpClient] Connection can be kept alive indefinitely
10:14:21.533 [DEBUG] [org.apache.http.impl.conn.BasicClientConnectionManager] Releasing connection org.apache.http.impl.conn.ManagedClientConnectionImpl@139fb628
10:14:21.533 [DEBUG] [org.apache.http.impl.conn.BasicClientConnectionManager] Connection can be kept alive indefinitely
10:14:21.545 [DEBUG] [org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask] Failed checksum deploy of checksum 'b4dfb2a45625237baf5b238a54be5eab59840915' with statusCode: 403
10:14:21.546 [DEBUG] [org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask] Full Artifact Http path: PUT http://xxxx:8081/artifactory/libs-release-local/org/xxxx.jar;build.timestamp=1472026458568;build.name=xxxx;build.number=1472026458820 HTTP/1.1
@Http Headers: [X-Checksum-Sha1: b4dfb2a45625237baf5b238a54be5eab59840915, X-Checksum-Md5: aa38c8b7e9334341d460c6195f8d4cfe]
10:14:21.546 [DEBUG] [org.apache.http.impl.conn.BasicClientConnectionManager] Get connection for route {}->http://xxxx:8081
10:14:21.546 [DEBUG] [org.apache.http.impl.client.DefaultHttpClient] Stale connection check
10:14:21.548 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: best-match
10:14:21.548 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
10:14:21.548 [DEBUG] [org.apache.http.client.protocol.RequestTargetAuthentication] Target auth state: UNCHALLENGED
10:14:21.548 [DEBUG] [org.apache.http.client.protocol.RequestProxyAuthentication] Proxy auth state: UNCHALLENGED
10:14:21.548 [DEBUG] [org.apache.http.impl.client.DefaultHttpClient] Attempt 1 to execute request
10:14:21.549 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Sending request: PUT /artifactory/libs-release-local/org/xxxx.jar;build.timestamp=1472026458568;build.name=xxxx;build.number=1472026458820 HTTP/1.1
10:14:21.550 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 100 Continue
10:14:21.556 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection 0.0.0.0:50290<->10.11.16.35:8081 closed
10:14:21.556 [DEBUG] [org.apache.http.impl.client.DefaultHttpClient] Closing the connection.
10:14:21.556 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection 0.0.0.0:50290<->10.11.16.35:8081 closed
10:14:21.557 [INFO] [org.apache.http.impl.client.DefaultHttpClient] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
10:14:21.557 [DEBUG] [org.apache.http.impl.client.DefaultHttpClient] Broken pipe
java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:153)