Skip to content

connect docker has error #2290

Closed
Closed

Description

@347866243

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

Activity

  1. SeBBBe commented on Jan 2, 2024

    @SeBBBe

    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)
    
  2. azuenko commented on Jan 2, 2024

    @azuenko

    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

  3. azuenko commented on Jan 2, 2024

    @azuenko

    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?

  4. 347866243 commented on Jan 5, 2024

    @347866243
    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

  5. Sineaggi commented on Jan 11, 2024

    @Sineaggi
    Contributor

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

  6. izian commented on Jan 15, 2024

    @izian

    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.

  7. added a commit that references this issue on Feb 26, 2024
    3514b3b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions