java.io.IOException: native write() failed : Broken pipe
See original GitHub issueI’m using the bmuschko/gradle-docker-plugin to build an image for a Spring Boot application. The plugin uses docker-java
for the remote tasks.
FROM azul/zulu-openjdk-alpine:11
ADD libs/app-0.0.1-SNAPSHOT.jar /app/
ADD distributions/health-probe.tgz /
RUN mv /health-probe* /scripts
ENTRYPOINT ["java"]
CMD ["-jar", "/app/app-0.0.1-SNAPSHOT.jar"]
This Dockerfile
can be used to successfully build an image from the command line but fails with the following exception when ran from Gradle:
Error during callback
java.lang.RuntimeException: java.io.IOException: native write() failed : Broken pipe
at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:153)
at com.github.dockerjava.httpclient5.ApacheDockerHttpClient.execute(ApacheDockerHttpClient.java:8)
at com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:228)
at com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:269)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: native write() failed : Broken pipe
at com.github.dockerjava.httpclient5.UnixDomainSocket$UnixSocketOutputStream.write(UnixDomainSocket.java:319)
at com.bmuschko.gradle.docker.shaded.org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:117)
Also filed corresponding bug https://github.com/bmuschko/gradle-docker-plugin/issues/972.
java --version
openjdk 11.0.7 2020-04-14 LTS
OpenJDK Runtime Environment Zulu11.39+15-CA (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM Zulu11.39+15-CA (build 11.0.7+10-LTS, mixed mode)
Gradle 6.6.1.
Issue Analytics
- State:
- Created 3 years ago
- Comments:24 (5 by maintainers)
Top Results From Across the Web
java.io.IOException: Broken pipe - Stack Overflow
Error message suggests that the client has closed the connection while the server is still trying to write out a response.
Read more >How I fixed java.io.IOException: Broken Pipe in Java (Wildfly ...
In simple term, Broken Pipe means that a machine is attempting to read or write data from/to a pipe, while the machine on...
Read more >Frequent java.io.IOException: broken pipe messages ... - Jira
The Atlassian team has performed testing that validates that the "Broken pipe" logging output is not the artefact of a bug but rather...
Read more >What can be reason java.io.IOException: Broken pipe?
1. Client or Server are shutting down too fast. Like, Server provides response and stops the connection rather than complete the protocol and ......
Read more >java.io.IOException: native write() failed : Broken pipe
java.io.IOException: native write() failed : Broken pipe.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It turns out that docker image names can only contain lowercase letters.
@asarkar Maybe you can try to see how you are naming the image you are trying to build. In micronaut’s case it takes the name from
rootProject.name
insettings.gradle
@asarkar @bmuschko @bsideup I may have found a way to reproduce this, at least via the gradle-docker-plugin which micronaut uses to build native docker images. If any upper case letters are present in the value of
rootProject.name
key insettings.gradle
, image building will break. Example,rootProject.name="myapp"
will work butrootProject.name="Myapp"
will NOT work@bsideup Does this give any hint as to where the problem is?