fabric8io / docker-maven-plugin

Maven plugin for running and creating Docker images
https://dmp.fabric8.io
Apache License 2.0
1.88k stars 644 forks source link

Socket connection error #660

Open hwellmann opened 7 years ago

hwellmann commented 7 years ago

Description

With a local build of 0.18-SNAPSHOT from the integration branch, I'm getting the following errors:

[INFO] --- docker-maven-plugin:0.18-SNAPSHOT:build (default-build) @ foo-docker ---
[INFO] I/O exception (java.net.SocketException) caught when processing request to {}->unix://127.0.0.1:1: already connected
[INFO] Retrying request to {}->unix://127.0.0.1:1
[INFO] I/O exception (java.net.SocketException) caught when processing request to {}->unix://127.0.0.1:1: already connected
[INFO] Retrying request to {}->unix://127.0.0.1:1
[INFO] I/O exception (java.net.SocketException) caught when processing request to {}->unix://127.0.0.1:1: already connected
[INFO] Retrying request to {}->unix://127.0.0.1:1
[ERROR] DOCKER> Cannot create docker access object

This is a regression from 0.18.1.

Info

chonton commented 7 years ago

I have potentially similar problem. On a macbook using master branch commit f7008c3, I see the following stacktrace when running the samples:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:docker-maven-plugin:0.18-SNAPSHOT:start (start) on project dmp-sample-net: Cannot create docker access object
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot create docker access object
        at io.fabric8.maven.docker.AbstractDockerMojo.createDockerAccess(AbstractDockerMojo.java:297)
        at io.fabric8.maven.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:199)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
Caused by: io.fabric8.maven.docker.access.DockerAccessException: Cannot extract API version from server unix://127.0.0.1:1
        at io.fabric8.maven.docker.access.hc.DockerAccessWithHcClient.getServerApiVersion(DockerAccessWithHcClient.java:129)
        at io.fabric8.maven.docker.AbstractDockerMojo.createDockerAccess(AbstractDockerMojo.java:290)
        ... 23 more
Caused by: java.net.SocketException: already connected
        at java.net.Socket.connect(Socket.java:569)
        at io.fabric8.maven.docker.access.hc.util.AbstractNativeSocketFactory.connectSocket(AbstractNativeSocketFactory.java:42)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:220)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:139)
        at io.fabric8.maven.docker.access.hc.ApacheHttpClientDelegate.get(ApacheHttpClientDelegate.java:67)
        at io.fabric8.maven.docker.access.hc.DockerAccessWithHcClient.getServerApiVersion(DockerAccessWithHcClient.java:125)
at io.fabric8.maven.docker.access.hc.DockerAccessWithHcClient.getServerApiVersion(DockerAccessWithHcClient.java:125)
        ... 24 more
[DEBUG] Connection manager is shutting down

Reverting commit 7afec26 fixes this problem.

rhuss commented 7 years ago

I just reverted the change, so hopefully your regressions are gone. Unfortunately I don't have much time yet to investigate this. Except for some reduced code, it doesnt promised much benefit anyway, so switching back is not an issue.