question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.io.IOException: native write() failed : Broken pipe

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Comments:24 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
Deepakkoli93commented, Sep 14, 2021

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 in settings.gradle

1reaction
Deepakkoli93commented, Sep 14, 2021

@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 in settings.gradle, image building will break. Example, rootProject.name="myapp" will work but rootProject.name="Myapp" will NOT work

@bsideup Does this give any hint as to where the problem is?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found