Skip to content

connect docker has error #2290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
347866243 opened this issue Jan 2, 2024 · 6 comments · Fixed by #2294
Closed

connect docker has error #2290

347866243 opened this issue Jan 2, 2024 · 6 comments · Fixed by #2294

Comments

@347866243
Copy link

caught when processing request to {}->unix://localhost:2375 ,but my host config is unix://var/run/docker.sock ,so where is localhost:2375

@SeBBBe
Copy link

SeBBBe commented Jan 2, 2024

Seeing something similar in a Spring Boot project when upgrading to Spring Boot 3.2.1:

java.lang.RuntimeException: org.apache.hc.client5.http.HttpHostConnectException: Connect to unix://localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused

	at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:195)
	at com.github.dockerjava.httpclient5.ApacheDockerHttpClient.execute(ApacheDockerHttpClient.java:9)
	at com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:228)
	at com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:202)
	at com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:74)
	at com.github.dockerjava.core.exec.ListContainersCmdExec.execute(ListContainersCmdExec.java:44)
	at com.github.dockerjava.core.exec.ListContainersCmdExec.execute(ListContainersCmdExec.java:15)
	at com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
	at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)

@azuenko
Copy link

azuenko commented Jan 2, 2024

Same issue here. First reported on 21 Dec 2023. Docker Java is configured to use UNIX socket at unix://var/run/docker.sock, but since a while we started getting the error

org.apache.hc.client5.http.HttpHostConnectException: Connect to unix://localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused.

as if the UNIX socket docker host setting is ignored.

Update: downgrading to SpringBoot 3.1.6 has fixed the issues

@azuenko
Copy link

azuenko commented Jan 2, 2024

As mentioned in spring-projects/spring-boot#38953 one of the reasons could be the bump of org.apache.httpcomponents.client5 in the recent SB release. As docker-java uses Apache http client library, the more recent v5.2.3 could be incompatible with the docker-java code.

Would it be possible to bump org.apache.httpcomponents.client5 to 5.2.3 and test it?

@347866243
Copy link
Author

[request processing failed;nested exception is java.lang.RuntimeException:java.io.IOException: docker-java com.sun.jna.LasteErrorException:[2] No such file or directory ] with root cause

@Sineaggi
Copy link
Contributor

I've opened a PR with a fix for this here #2294

@izian
Copy link

izian commented Jan 15, 2024

We just landed here because we upgraded spring boot plugin for Gradle to 3.2.1 and the world came crashing down in our build pipeline as a result of the new apache code pulled in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants