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.

wait for port doesn't work on Windows

See original GitHub issue

Wait for port doesn’t work on Windows.

As an example:

<ports>
  <port>3336:3306</port>
</ports>
<wait>
  <tcp>
    <ports>
      <port>3306</port>
    </ports>
  </tcp>
  <time>40000</time>
</wait>

This won’t work, while the following works and maven plugin connects to mysql using jdbc:mysql://localhost:3336

<wait>
  <time>10000</time>
</wait>

Maven: 3.3.9 docker-maven-plugin: 0.15.16 Windows 10

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
pvorbcommented, Jan 16, 2018

The configuration at branch “working” of my sample project now works with docker-maven-plugin v0.23.0 and boot2docker v18.01.0-ce on Windows 7 64-bit.

In short, it uses mapped mode port configurations:

<ports>
    <port>9092:9092</port>
</ports>
<wait>
    <tcp>
        <mode>mapped</mode>
        <ports>
            <port>9092</port>
        </ports>
    </tcp>
    <time>60000</time>
</wait>
0reactions
emetsgercommented, Oct 19, 2018

I think I’m seeing the same problem on a Mac using docker-machine. I specify:

<wait>
    <tcp>
       <mode>mapped</mode>
       <ports>
            <port>${mail.imaps.port}</port>
            <port>${mail.smtp.port}</port>
        </ports>
    </tcp>
</wait>
<ports>
    <port>${mail.smtp.port}:25</port>
    <port>${mail.imap.port}:143</port>
    <port>${mail.imaps.port}:993</port>
    <port>${mail.msp.tls.port}:587</port>
</ports>

(Ports are allocated by the build-helper-maven-plugin earlier in the POM)

  • M-D-P version: 0.27.2
  • MacOS: 10.11.6
  • Docker version: 17.10.0-ce, build f4ffd25
  • Docker Machine version: version 0.13.0, build 9ba6da9

When I run mvn clean verify -X -e (in the notification-integration module containing the MDP plugin configuration) I get the errors:

  • [ERROR] DOCKER> Error occurred during container startup, shutting down...
  • Cannot watch on port 61334, since there is no network binding

The ports are properly mapped according to the debug output below:

ports = [61332:25, 61333:143, 61334:993, 61335:587]
...
HostConfig":{"PortBindings":{"25/tcp":[{"HostPort":"61332"}],"143/tcp":[{"HostPort":"61333"}],"587/tcp":[{"HostPort":"61335"}],"993/tcp":[{"HostPort":"61334"}]}

If I use a simple <wait><time>15000</time></wait> the Maven build succeeds (MDP starts containers, integration tests run successfully for my project, etc.)

The relavent output:

[DEBUG] Configuring mojo 'io.fabric8:docker-maven-plugin:0.27.2:start' with basic configurator -->
[DEBUG]   (f) autoCreateCustomNetworks = false
[DEBUG]   (f) execution = io.fabric8:docker-maven-plugin:0.27.2:start {execution: start-docker-its}
[DEBUG]   (f) alias = mail
[DEBUG]   (s) name = oapass/docker-mailserver:latest
[DEBUG]   (f) mode = mapped
[DEBUG]   (f) ports = [61334, 61332]
[DEBUG]   (f) tcp = io.fabric8.maven.docker.config.WaitConfiguration$TcpConfiguration@5d601832
[DEBUG]   (f) wait = io.fabric8.maven.docker.config.WaitConfiguration@3ca17943
[DEBUG]   (f) skip = false
[DEBUG]   (f) hostname = mail
[DEBUG]   (f) domainname = local.domain
[DEBUG]   (f) ports = [61332:25, 61333:143, 61334:993, 61335:587]
[DEBUG]   (f) bind = [maildata:/var/mail, mailstate:/var/mail-state]
[DEBUG]   (f) volumes = io.fabric8.maven.docker.config.RunVolumeConfiguration@5170bc02
[DEBUG]   (f) env = {DMS_DEBUG=0, DOMAINNAME=local.domain, ENABLE_SPAMASSASSIN=0, HOSTNAME=mail, ONE_DIR=1, OVERRIDE_HOSTNAME=mail.local.domain, PERMIT_DOCKER=network, SMTP_ONLY=0, TLS_LEVEL=intermediate}
[DEBUG]   (f) run = io.fabric8.maven.docker.config.RunImageConfiguration@c0c8f96
[DEBUG]   (f) alias = fcrepo
[DEBUG]   (s) name = oapass/fcrepo:4.7.5-3.1
[DEBUG]   (f) skip = false
[DEBUG]   (f) url = http://fedoraAdmin:moo@${docker.host.address}:61336/fcrepo/rest/
[DEBUG]   (f) time = 180000
[DEBUG]   (f) wait = io.fabric8.maven.docker.config.WaitConfiguration@3bd08435
[DEBUG]   (f) ports = [61336:61336, 61337:61337, 61338:61338]
[DEBUG]   (f) env = {FCREPO_ACTIVEMQ_CONFIGURATION=classpath:/activemq-queue.xml, FCREPO_HOST=fcrepo, FCREPO_JMS_BASEURL=http://${docker.host.address}:61336/fcrepo/rest/, FCREPO_JMS_PORT=61337, FCREPO_LOG_LEVEL=DEBUG, FCREPO_PORT=61336, FCREPO_STOMP_PORT=61338}
[DEBUG]   (f) run = io.fabric8.maven.docker.config.RunImageConfiguration@3e52ed5d
[DEBUG]   (f) images = [ImageConfiguration {name='oapass/docker-mailserver:latest', alias='mail'}, ImageConfiguration {name='oapass/fcrepo:4.7.5-3.1', alias='fcrepo'}]
[DEBUG]   (f) keepContainer = false
[DEBUG]   (f) logStdout = false
[DEBUG]   (f) maxConnections = 100
[DEBUG]   (f) project = MavenProject: org.dataconservancy.pass.notify:notification-integration:0.0.1-2.3-SNAPSHOT @ /Users/esm/workspaces/pass/notification-services/notification-integration/pom.xml
[DEBUG]   (f) removeVolumes = false
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@589b028e
[DEBUG]   (f) settings = org.apache.maven.execution.SettingsAdapter@28e94c2
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipExtendedAuth = false
[DEBUG]   (f) skipMachine = false
[DEBUG]   (f) skipRun = false
[DEBUG]   (f) startParallel = false
[DEBUG]   (f) useColor = true
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[DEBUG] DOCKER> Container create config: {"Image":"oapass/docker-mailserver:latest","Hostname":"mail","Domainname":"local.domain","ExposedPorts":{"25/tcp":{},"143/tcp":{},"587/tcp":{},"993/tcp":{}},"Env":["DOMAINNAME=local.domain","HOSTNAME=mail","DMS_DEBUG=0","TLS_LEVEL=intermediate","ONE_DIR=1","OVERRIDE_HOSTNAME=mail.local.domain","ENABLE_SPAMASSASSIN=0","PERMIT_DOCKER=network","SMTP_ONLY=0"],"Labels":{"dmp.coordinates":"org.dataconservancy.pass.notify:notification-integration:0.0.1-2.3-SNAPSHOT"},"HostConfig":{"PortBindings":{"25/tcp":[{"HostPort":"61332"}],"143/tcp":[{"HostPort":"61333"}],"587/tcp":[{"HostPort":"61335"}],"993/tcp":[{"HostPort":"61334"}]},"Binds":["maildata:/var/mail","mailstate:/var/mail-state"],"VolumesFrom":[]},"Volumes":{"/var/mail":{},"/var/mail-state":{}}}
[INFO] DOCKER> [oapass/docker-mailserver:latest] "mail": Start container 1e866bfdc620
[ERROR] DOCKER> Error occurred during container startup, shutting down...
[DEBUG] DOCKER> shutdown will wait max of 0 seconds before removing container
[INFO] DOCKER> [oapass/docker-mailserver:latest] "mail": Stop and removed container 1e866bfdc620 after 0 ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.390 s
[INFO] Finished at: 2018-10-18T22:37:33-04:00
[INFO] Final Memory: 53M/989M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.27.2:start (start-docker-its) on project notification-integration: Execution start-docker-its of goal io.fabric8:docker-maven-plugin:0.27.2:start failed: Cannot watch on port 61334, since there is no network binding -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:docker-maven-plugin:0.27.2:start (start-docker-its) on project notification-integration: Execution start-docker-its of goal io.fabric8:docker-maven-plugin:0.27.2:start failed: Cannot watch on port 61334, since there is no network binding
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	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:309)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
	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:497)
	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.PluginExecutionException: Execution start-docker-its of goal io.fabric8:docker-maven-plugin:0.27.2:start failed: Cannot watch on port 61334, since there is no network binding
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 20 more
Caused by: java.lang.IllegalArgumentException: Cannot watch on port 61334, since there is no network binding
	at io.fabric8.maven.docker.service.WaitService.getTcpWaitChecker(WaitService.java:170)
	at io.fabric8.maven.docker.service.WaitService.prepareWaitCheckers(WaitService.java:115)
	at io.fabric8.maven.docker.service.WaitService.wait(WaitService.java:50)
	at io.fabric8.maven.docker.service.helper.StartContainerExecutor.waitAndPostExec(StartContainerExecutor.java:58)
	at io.fabric8.maven.docker.service.helper.StartContainerExecutor.startContainers(StartContainerExecutor.java:44)
	at io.fabric8.maven.docker.StartMojo.lambda$startImage$0(StartMojo.java:307)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:117)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:38)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:77)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:260)
	at java.util.concurrent.ExecutorCompletionService.submit(ExecutorCompletionService.java:181)
	at io.fabric8.maven.docker.StartMojo.startImage(StartMojo.java:301)
	at io.fabric8.maven.docker.StartMojo.executeInternal(StartMojo.java:169)
	at io.fabric8.maven.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:225)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 21 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
esm:~/workspaces/pass/notification-services/notification-integration (integration)$ 
Read more comments on GitHub >

github_iconTop Results From Across the Web

TCP/IP port exhaustion troubleshooting - Windows Client
Learn how to troubleshoot port exhaustion issues. Port exhaustion occurs when all the ports on a machine are used.
Read more >
How to Fix Port in Use Error in Windows 11/10 - Techbout
To fix "Port in use, please wait" error message in Windows 10, open Printer properties and make sure that correct Port type is...
Read more >
Printer port in use please wait Error in Windows 10
Printer port in use please wait Error in Windows 10 · Open Settings · Select Update and Security · Select Troubleshoot · Select...
Read more >
How to Fix Port in Use, Please Wait – Printer Error Message in ...
The Printer Troubleshooter is the first step in resolving the "Port in use, please wait" error. Most print problems can be resolved using...
Read more >
Port in use, please wait - Printer error message in Windows 11 ...
However, the printer continues to print wirelessly from phones. This suggests there's some problem existing between the printer and the computer ...
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