3

I am running some Integration tests on a Windows 10 machine. I have a Java maven project that uses io.fabric8 docker maven plugin to manage docker images and containers.

I am having issues when my Integration Tests are trying to communicate with docker container.

I'm seeing the following error:

 Failed to execute goal io.fabric8:docker-maven-plugin:0.19.0:start (prepare-it) on project some-app-name: Execution prepare-it of goal io.fabric8:docker-maven-plugin:0.19.0:start failed: Start-Job failed with unexpected exception: [rabbitmq:3-management-alpine] "rabbitmq": Timeout after 55148 ms while waiting on url http://127.0.0.1:65474 -> [Help 1]

I've tried running it with mvn clean install -Dlocal.host=0.0.0.0 and mvn clean install -Dlocal.host=127.0.0.1 with no luck. Similiar error message as above.

My windows 10 environment variable is: DOCKER_HOST env variable is set to tcp://username-remotelinux.somecloudprovider.co.uk:2375

When I run docker ps, I see the following:

$ docker ps
CONTAINER ID        IMAGE                                                                                    COMMAND                  CREATED             STATUS              PORTS                                                                                      NAMES
34b43c52ca96        rabbitmq:3-management-alpine                                                             "docker-entrypoint.s…"   13 seconds ago      Up 11 seconds       4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp   docker_rabbitmq_1

I also checked the IP address of the container:

$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' c6314df1cd10
172.24.0.5

I've noticed that the ip address of the container is different to what I see when I run docker ps.

Is there a reason why its different?

How do I get this to work? Any ideas?

UPDATE 1: I've also tried using 0.33.0 version of the docker maven plugin with no luck. I'm getting the same error as above

UPDATE 2: I've also tried running with mvn install -Ddocker.host=tcp://username-remotelinux.somecloudprovider.co.uk:2375 with no luck. There must be something I'm missing. How to get maven to table to remote docker

breaktop
  • 1,899
  • 4
  • 37
  • 58
  • You're using quite an old version of Docker Maven Plugin. Could you please try with [0.33.0](https://search.maven.org/artifact/io.fabric8/docker-maven-plugin/0.33.0/maven-plugin) and see if it works for you – Rohan Kumar Mar 20 '20 at 06:07
  • @RohanKumar I've tried with 0.33.0 and getting the same error. `Timeout after 55267 ms while waiting on url`. Exactly the same error. – breaktop Mar 20 '20 at 06:52
  • Would it be possible for you to share a reproducible sample? Also, I would suggest filing an issue on Github regarding this. – Rohan Kumar Mar 20 '20 at 07:00
  • @RohanKumar It's going to be tricky to provide a reproducible one. I can describe what the setup is. I'm having the issue will all maven java projects. The setup is Windows 10 RDS using a remote docker host. I'm able to download and start the images and connect to the container using `docker exec`. The issue is with the maven project talking to the containers. The setup is described above. The project works fine on Macs and Linux. Just issues in the Windows 10 box. I'm having to use Windows 10 RDS because I'm working from home. Just issues after issues with Windows 10 – breaktop Mar 20 '20 at 07:11
  • @RohanKumar It's strange that io.fabric8 can start the images but not communicate with it. It just doesn't make sense what I'm missing – breaktop Mar 20 '20 at 07:28
  • I think it is supported. Let me try pinging core maintainer about this. – Rohan Kumar Mar 20 '20 at 14:17
  • @RohanKumar Any look? – breaktop Mar 23 '20 at 07:58
  • I tried pinging maintainer but he said that it doesn't look like a windows specific error, but more a failing wait check (waiting for rabbitmq to be up). – Rohan Kumar Mar 23 '20 at 08:52
  • It just doesn't make sense. I've made sure Rabbit and the other docker container dependencies are up and running. I've started the container first and then ran the IT test through IntelliJ. The same issue whether I run it is run through IntelliJ or windows GitBash terminal. – breaktop Mar 23 '20 at 09:02
  • Hmm, He didn't look closely so he might have predicted incorrectly. Unfortunately, I don't have access to a windows machine to reproduce your issue :-( – Rohan Kumar Mar 23 '20 at 09:44
  • It seems to me that you are using docker client on windows machine to connect to docker daemon hosted on some remote cloud server (I think that because of setting the `DOCKER_HOST` env). If that is the case then I'm not sure why the maven goal is trying to connect to a port on your local machine since the container is running on the remote cloud server and not locally. Also I couldn't find a single clue on what port number `65474` is for since it is not mentioned in the output of `docker ps` – ahasbini Mar 25 '20 at 01:37
  • Regarding the different IP addresses u mentioned, that's fine since you saw the virtual IP address of the container, but what `docker ps` is saying that it exposed ports `5672` and `15672` on all network interfaces (or IP addresses) in your remote cloud server (not your local windows machine) and is forwarding connections on these ports to the container's internal network interfaces or virtual IP. – ahasbini Mar 25 '20 at 01:40
  • @ahasbini Ive also tried running with `mvn install -Ddocker.hosttcp://username-remotelinux.somecloudprovider.co.uk:2375` with no luck. There must be something I'm missing. How to get maven to table to remote docker – breaktop Mar 25 '20 at 09:27
  • @breaktop just a side question, is there anything about port `65474` in your pom file(s)? – ahasbini Mar 25 '20 at 20:07
  • @ahasbini Nothing special about that port – breaktop Mar 26 '20 at 11:54
  • I'm having the same issue trying to run integration tests on WSL2, the rabbit container is started but then fails due to timeout. Were you able to find a solution for this? – GACy20 Jul 12 '21 at 14:52

0 Answers0