2 Replies Latest reply on Jan 21, 2015 12:39 PM by Rafael Pestano

    Arquillian Cube - problem with autoStartContainers

    Rafael Pestano Novice

      Hi guys, i'm facing an issue with autoStartContainers config. I am using wildfly-remote adapter and trying to start a docker container which will be used in my integration test(testable=true).

       

      Here is my arquillian.xml:

       

       

      <arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns="http://jboss.org/schema/arquillian"
                  xsi:schemaLocation="
              http://jboss.org/schema/arquillian
              http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
      
      
          <!-- Force the use of the Servlet 3.0 protocol with all containers, as it
              is the most mature -->
      
      
          <defaultProtocol type="Servlet 3.0"/>
      
      
          <extension qualifier="docker">
              <property name="serverVersion">1.12</property>
              <property name="serverUri">http://localhost:2375</property>
              <property name="autoStartContainers">car_service</property>
              <property name="dockerContainers">
                  car_service:
                    buildImage:
                      dockerfileLocation: src/test/resources/wildfly
                      noCache: true
                      remove: true
                    exposedPorts: [8080/tcp, 9990/tcp]
                    await:
                      strategy: polling
                    portBindings: [8180->8080/tcp, 9991->9990/tcp]
              </property>
          </extension>
         
          <container qualifier="wildfly-remote">
              <configuration>
                  <property name="managementAddress">127.0.0.1</property>
                  <property name="managementPort">9990</property>
              </configuration>
          </container> 
          
      </arquillian>
      
      

       

      The car_service Dockerfile:

       

      from jboss/wildfly
      RUN /opt/jboss/wildfly/bin/add-user.sh -up mgmt-users.properties admin Admin#70365 --silent
      ADD car-service.war /opt/jboss/wildfly/standalone/deployments/
      CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
      
      

       

      and here is the test output and the stacktrace:

       

      Jan 21, 2015 11:49:24 AM org.glassfish.jersey.filter.LoggingFilter log
      INFO: 1 * Sending client request on thread main
      1 > GET http://localhost:2375/v1.12/_ping
      
      
      Jan 21, 2015 11:49:25 AM org.glassfish.jersey.filter.LoggingFilter log
      INFO: 2 * Client response received on thread main
      2 < 200
      2 < Content-Length: 2
      2 < Content-Type: application/json; charset=utf-8
      2 < Date: Wed, 21 Jan 2015 13:49:25 GMT
      OK
      
      
      Jan 21, 2015 11:49:44 AM org.glassfish.jersey.filter.LoggingFilter log
      INFO: 3 * Client response received on thread main
      3 < 200
      3 < Content-Type: application/json
      3 < Date: Wed, 21 Jan 2015 13:49:44 GMT
      3 < Transfer-Encoding: chunked
      {"stream":"Step 0 : FROM jboss/wildfly\n"}
      
      
      
      
      Jan 21, 2015 11:50:04 AM org.glassfish.jersey.filter.LoggingFilter log
      INFO: 4 * Sending client request on thread main
      4 > POST http://localhost:2375/v1.12/containers/create?name=car_service
      4 > Accept: application/json
      4 > Content-Type: application/json
      {"name":"car_service","dns":null,"capAdd":null,"capDrop":null,"Hostname":"","User":"","Memory":0,"MemorySwap":0,"CpuShares":0,"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"PortSpecs":null,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":null,"Image":"d57582a2aa94","Volumes":{},"VolumesFrom":[],"WorkingDir":"","DisableNetwork":false,"ExposedPorts":{"9990/tcp":{},"8080/tcp":{}},"HostConfig":{"Binds":null,"Links":null,"LxcConf":null,"PortBindings":null,"PublishAllPorts":false,"Privileged":false,"Dns":null,"DnsSearch":null,"VolumesFrom":null,"ContainerIDFile":null,"CapAdd":null,"CapDrop":null,"RestartPolicy":null,"NetworkMode":null,"Devices":null}}
      
      
      Jan 21, 2015 11:50:05 AM org.glassfish.jersey.filter.LoggingFilter log
      INFO: 5 * Client response received on thread main
      5 < 201
      5 < Content-Length: 90
      5 < Content-Type: application/json
      5 < Date: Wed, 21 Jan 2015 13:50:05 GMT
      {"Id":"12e8f6f9b2615d38b1eb16ce3b0802fcd1877f8d3c0b80443df42cdb673bc0fc","Warnings":null}
      
      
      
      
      Jan 21, 2015 11:50:05 AM org.glassfish.jersey.filter.LoggingFilter log
      INFO: 6 * Sending client request on thread main
      6 > POST http://localhost:2375/v1.12/containers/car_service/start
      6 > Accept: application/json
      6 > Content-Type: application/json
      {"containerId":"car_service","Binds":[],"Links":[],"LxcConf":null,"PortBindings":{"9990/tcp":[{"HostIp":"","HostPort":"9991"}],"8080/tcp":[{"HostIp":"","HostPort":"8180"}]},"PublishAllPorts":false,"Privileged":false,"Dns":null,"DnsSearch":null,"VolumesFrom":null,"NetworkMode":"bridge","Devices":null,"RestartPolicy":null,"CapAdd":null,"CapDrop":null}
      
      
      Jan 21, 2015 11:50:08 AM org.glassfish.jersey.filter.LoggingFilter log
      INFO: 7 * Client response received on thread main
      7 < 204
      7 < Date: Wed, 21 Jan 2015 13:50:08 GMT
      
      
      Jan 21, 2015 11:50:08 AM org.glassfish.jersey.filter.LoggingFilter log
      INFO: 8 * Sending client request on thread main
      8 > GET http://localhost:2375/v1.12/containers/car_service/json
      8 > Accept: application/json
      
      
      Jan 21, 2015 11:50:08 AM org.glassfish.jersey.filter.LoggingFilter log
      INFO: 9 * Client response received on thread main
      9 < 200
      9 < Content-Type: application/json
      9 < Date: Wed, 21 Jan 2015 13:50:08 GMT
      9 < Transfer-Encoding: chunked
      {"AppArmorProfile":"","Args":["-b","0.0.0.0","-bmanagement","0.0.0.0"],"Config":{"AttachStderr":false,"AttachStdin":false,"AttachStdout":false,"Cmd":["/opt/jboss/wildfly/bin/standalone.sh","-b","0.0.0.0","-bmanagement","0.0.0.0"],"CpuShares":0,"Cpuset":"","Domainname":"","Entrypoint":null,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","JAVA_HOME=/usr/lib/jvm/java","WILDFLY_VERSION=8.2.0.Final","JBOSS_HOME=/opt/jboss/wildfly"],"ExposedPorts":{"8080/tcp":{},"9990/tcp":{}},"Hostname":"12e8f6f9b261","Image":"d57582a2aa94","MacAddress":"","Memory":0,"MemorySwap":0,"NetworkDisabled":false,"OnBuild":null,"OpenStdin":false,"PortSpecs":null,"StdinOnce":false,"Tty":false,"User":"jboss","Volumes":null,"WorkingDir":"/opt/jboss"},"Created":"2015-01-21T13:50:05.023533014Z","Driver":"aufs","ExecDriver":"native-0.2","HostConfig":{"Binds":[],"CapAdd":null,"CapDrop":null,"ContainerIDFile":"","Devices":null,"Dns":null,"DnsSearch":null,"ExtraHosts":null,"IpcMode":"","Links":null,"LxcConf":null,"NetworkMode":"bridge","PortBindings":{"8080/tcp":[{"HostIp":"","HostPort":"8180"}],"9990/tcp":[{"HostIp":"","HostPort":"9991"}]},"Privileged":false,"PublishAllPorts":false,"RestartPolicy":{"MaximumRetryCount":0,"Name":""},"SecurityOpt":null,"VolumesFrom":null},"HostnamePath":"/var/lib/docker/containers/12e8f6f9b2615d38b1eb16ce3b0802fcd1877f8d3c0b80443df42cdb673bc0fc/hostname","HostsPath":"/var/lib/docker/containers/12e8f6f9b2615d38b1eb16ce3b0802fcd1877f8d3c0b80443df42cdb673bc0fc/hosts","Id":"12e8f6f9b2615d38b1eb16ce3b0802fcd1877f8d3c0b80443df42cdb673bc0fc","Image":"d57582a2aa9463208406744b03285eecff054ff3cadd1ddc0c86b91b0be43c5f","MountLabel":"","Name":"/car_service","NetworkSettings":{"Bridge":"docker0","Gateway":"172.17.42.1","IPAddress":"172.17.0.5","IPPrefixLen":16,"MacAddress":"02:42:ac:11:00:05","PortMapping":null,"Ports":{"8080/tcp":[{"HostIp":"0.0.0.0","HostPort":"8180"}],"9990/tcp":[{"HostIp":"0.0.0.0","HostPort":"9991"}]}},"Path":"/opt/jboss/wildfly/bin/standalone.sh","ProcessLabel":"","ResolvConfPath":"/var/lib/docker/containers/12e8f6f9b2615d38b1eb16ce3b0802fcd1877f8d3c0b80443df42cdb673bc0fc/resolv.conf","State":{"Error":"","ExitCode":0,"FinishedAt":"0001-01-01T00:00:00Z","OOMKilled":false,"Paused":false,"Pid":12048,"Restarting":false,"Running":true,"StartedAt":"2015-01-21T13:50:08.05962208Z"},"Volumes":{},"VolumesRW":{}}
      
      
      
      
      
      
      org.arquillian.cube.spi.CubeControlException: Could not start car_service
        at org.arquillian.cube.spi.CubeControlException.failedStart(CubeControlException.java:23)
        at org.arquillian.cube.impl.model.DockerCube.start(DockerCube.java:88)
        at org.arquillian.cube.impl.client.CubeLifecycleController.start(CubeLifecycleController.java:18)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
        at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
        at org.arquillian.cube.impl.client.CubeSuiteLifecycleController.startAutoContainers(CubeSuiteLifecycleController.java:35)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
        at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
        at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:68)
        at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:104)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
        at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
      Caused by: java.lang.IllegalArgumentException: Cannot connect to car_service container
        at org.arquillian.cube.impl.model.DockerCube.start(DockerCube.java:83)
        ... 34 more
      
      
      Disconnected from the target VM, address: '127.0.0.1:58977', transport: 'socket'
      
      
      Process finished with exit code 255
      
      
      
        • 1. Re: Arquillian Cube - problem with autoStartContainers
          Aslak Knutsen Master

          Could you try to use the following just to see it's not just a slow starting image?

           

                        await:

                          strategy: polling

                          iterations: 100

                          sleepPollingTime: 100

          • 2. Re: Re: Arquillian Cube - problem with autoStartContainers
            Rafael Pestano Novice

            Aslak Knutsen I got same error:

             

            Jan 21, 2015 1:26:35 PM org.glassfish.jersey.filter.LoggingFilter log
            INFO: 2 * Client response received on thread main
            2 < 200
            2 < Content-Length: 2
            2 < Content-Type: application/json; charset=utf-8
            2 < Date: Wed, 21 Jan 2015 15:26:34 GMT
            OK
            
            
            Jan 21, 2015 1:26:49 PM org.glassfish.jersey.filter.LoggingFilter log
            INFO: 3 * Client response received on thread main
            3 < 200
            3 < Content-Type: application/json
            3 < Date: Wed, 21 Jan 2015 15:26:49 GMT
            3 < Transfer-Encoding: chunked
            {"stream":"Step 0 : FROM jboss/wildfly\n"}
            
            
            
            
            Jan 21, 2015 1:26:52 PM org.glassfish.jersey.filter.LoggingFilter log
            INFO: 4 * Sending client request on thread main
            4 > POST http://localhost:2375/v1.12/containers/create?name=car_service
            4 > Accept: application/json
            4 > Content-Type: application/json
            {"name":"car_service","dns":null,"capAdd":null,"capDrop":null,"Hostname":"","User":"","Memory":0,"MemorySwap":0,"CpuShares":0,"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"PortSpecs":null,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":null,"Image":"ce03482d39de","Volumes":{},"VolumesFrom":[],"WorkingDir":"","DisableNetwork":false,"ExposedPorts":{"9990/tcp":{},"8080/tcp":{}},"HostConfig":{"Binds":null,"Links":null,"LxcConf":null,"PortBindings":null,"PublishAllPorts":false,"Privileged":false,"Dns":null,"DnsSearch":null,"VolumesFrom":null,"ContainerIDFile":null,"CapAdd":null,"CapDrop":null,"RestartPolicy":null,"NetworkMode":null,"Devices":null}}
            
            
            Jan 21, 2015 1:26:53 PM org.glassfish.jersey.filter.LoggingFilter log
            INFO: 5 * Client response received on thread main
            5 < 201
            5 < Content-Length: 90
            5 < Content-Type: application/json
            5 < Date: Wed, 21 Jan 2015 15:26:53 GMT
            {"Id":"246fababa65878d402d03123ac5ef41dc26c2b7b9fca05aa0eda36bf23de4120","Warnings":null}
            
            
            
            
            Jan 21, 2015 1:26:53 PM org.glassfish.jersey.filter.LoggingFilter log
            INFO: 6 * Sending client request on thread main
            6 > POST http://localhost:2375/v1.12/containers/car_service/start
            6 > Accept: application/json
            6 > Content-Type: application/json
            {"containerId":"car_service","Binds":[],"Links":[],"LxcConf":null,"PortBindings":{"9990/tcp":[{"HostIp":"","HostPort":"9991"}],"8080/tcp":[{"HostIp":"","HostPort":"8180"}]},"PublishAllPorts":false,"Privileged":false,"Dns":null,"DnsSearch":null,"VolumesFrom":null,"NetworkMode":"bridge","Devices":null,"RestartPolicy":null,"CapAdd":null,"CapDrop":null}
            
            
            Jan 21, 2015 1:26:53 PM org.glassfish.jersey.filter.LoggingFilter log
            INFO: 7 * Client response received on thread main
            7 < 204
            7 < Date: Wed, 21 Jan 2015 15:26:53 GMT
            
            
            Jan 21, 2015 1:26:53 PM org.glassfish.jersey.filter.LoggingFilter log
            INFO: 8 * Sending client request on thread main
            8 > GET http://localhost:2375/v1.12/containers/car_service/json
            8 > Accept: application/json
            
            
            Jan 21, 2015 1:26:53 PM org.glassfish.jersey.filter.LoggingFilter log
            INFO: 9 * Client response received on thread main
            9 < 200
            9 < Content-Type: application/json
            9 < Date: Wed, 21 Jan 2015 15:26:53 GMT
            9 < Transfer-Encoding: chunked
            {"AppArmorProfile":"","Args":["-b","0.0.0.0","-bmanagement","0.0.0.0"],"Config":{"AttachStderr":false,"AttachStdin":false,"AttachStdout":false,"Cmd":["/opt/jboss/wildfly/bin/standalone.sh","-b","0.0.0.0","-bmanagement","0.0.0.0"],"CpuShares":0,"Cpuset":"","Domainname":"","Entrypoint":null,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","JAVA_HOME=/usr/lib/jvm/java","WILDFLY_VERSION=8.2.0.Final","JBOSS_HOME=/opt/jboss/wildfly"],"ExposedPorts":{"8080/tcp":{},"9990/tcp":{}},"Hostname":"246fababa658","Image":"ce03482d39de","MacAddress":"","Memory":0,"MemorySwap":0,"NetworkDisabled":false,"OnBuild":null,"OpenStdin":false,"PortSpecs":null,"StdinOnce":false,"Tty":false,"User":"jboss","Volumes":null,"WorkingDir":"/opt/jboss"},"Created":"2015-01-21T15:26:53.02116044Z","Driver":"aufs","ExecDriver":"native-0.2","HostConfig":{"Binds":[],"CapAdd":null,"CapDrop":null,"ContainerIDFile":"","Devices":null,"Dns":null,"DnsSearch":null,"ExtraHosts":null,"IpcMode":"","Links":null,"LxcConf":null,"NetworkMode":"bridge","PortBindings":{"8080/tcp":[{"HostIp":"","HostPort":"8180"}],"9990/tcp":[{"HostIp":"","HostPort":"9991"}]},"Privileged":false,"PublishAllPorts":false,"RestartPolicy":{"MaximumRetryCount":0,"Name":""},"SecurityOpt":null,"VolumesFrom":null},"HostnamePath":"/var/lib/docker/containers/246fababa65878d402d03123ac5ef41dc26c2b7b9fca05aa0eda36bf23de4120/hostname","HostsPath":"/var/lib/docker/containers/246fababa65878d402d03123ac5ef41dc26c2b7b9fca05aa0eda36bf23de4120/hosts","Id":"246fababa65878d402d03123ac5ef41dc26c2b7b9fca05aa0eda36bf23de4120","Image":"ce03482d39ded05ed4566ac5fbcf666f21ce8bc4db5db3782e91efb7e8253b78","MountLabel":"","Name":"/car_service","NetworkSettings":{"Bridge":"docker0","Gateway":"172.17.42.1","IPAddress":"172.17.0.8","IPPrefixLen":16,"MacAddress":"02:42:ac:11:00:08","PortMapping":null,"Ports":{"8080/tcp":[{"HostIp":"0.0.0.0","HostPort":"8180"}],"9990/tcp":[{"HostIp":"0.0.0.0","HostPort":"9991"}]}},"Path":"/opt/jboss/wildfly/bin/standalone.sh","ProcessLabel":"","ResolvConfPath":"/var/lib/docker/containers/246fababa65878d402d03123ac5ef41dc26c2b7b9fca05aa0eda36bf23de4120/resolv.conf","State":{"Error":"","ExitCode":0,"FinishedAt":"0001-01-01T00:00:00Z","OOMKilled":false,"Paused":false,"Pid":32316,"Restarting":false,"Running":true,"StartedAt":"2015-01-21T15:26:53.399514891Z"},"Volumes":{},"VolumesRW":{}}
            
            
            
            
            
            
            org.arquillian.cube.spi.CubeControlException: Could not start car_service
              at org.arquillian.cube.spi.CubeControlException.failedStart(CubeControlException.java:23)
              at org.arquillian.cube.impl.model.DockerCube.start(DockerCube.java:88)
              at org.arquillian.cube.impl.client.CubeLifecycleController.start(CubeLifecycleController.java:18)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
              at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
              at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
              at org.arquillian.cube.impl.client.CubeSuiteLifecycleController.startAutoContainers(CubeSuiteLifecycleController.java:35)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
              at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
              at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:68)
              at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:104)
              at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
              at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
            Caused by: java.lang.IllegalArgumentException: Cannot connect to car_service container
              at org.arquillian.cube.impl.model.DockerCube.start(DockerCube.java:83)
              ... 34 more