Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to connect to payara without explicit portBindings #1206

Open
sschober opened this issue Nov 26, 2020 · 0 comments
Open

Not able to connect to payara without explicit portBindings #1206

sschober opened this issue Nov 26, 2020 · 0 comments

Comments

@sschober
Copy link

sschober commented Nov 26, 2020

Issue Overview

I am using arquillian cube 1.16.0 and I am trying to find a configuration that allows concurrent executions of tests on the same hosts.

Working Config (But not what I want)

So, the following config works, but binds two ports to the host (4848 and 8080) and thus will lead to collisions:

    <property name="dockerContainers">
          payara:
            image: payara/server-full:latest
            await:
              strategy: polling
            env: []
            portBindings: [4848,8080]
      </property>

docker ps shows me this:

0ec328f41601        payara/server-full:latest   "/tini -- /bin/sh -c??"   1 second ago        Up Less than a second   0.0.0.0:4848->4848/tcp, 8181/tcp, 0.0.0.0:8080->8080/tcp, 9009/tcp   payara

and ss -atn shows the ports are being used on the host:

LISTEN               0                 4096                                          *:4848                                             *:*                                  
LISTEN               0                 4096                                          *:8080                                             *:*                                  
Not working config (but what I want to do)

I've found the following issue: #66 and that suggested using publishAllPorts: true, which I tried with the following config:

payara:
            image: payara/server-full:latest
            await:
              strategy: polling
            env: []
            publishAllPorts: true

But that brings the following error (I've shortened the stacktrace somewhat):

org.arquillian.cube.spi.CubeControlException: Could not start payara
	at org.arquillian.cube.spi.CubeControlException.failedStart(CubeControlException.java:19)
	at org.arquillian.cube.docker.impl.model.DockerCube.start(DockerCube.java:141)
	at org.arquillian.cube.impl.client.CubeLifecycleController.start(CubeLifecycleController.java:19)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Caused by: java.lang.IllegalArgumentException: Cannot connect to payara container
	at org.arquillian.cube.docker.impl.model.DockerCube.start(DockerCube.java:136)
	... 87 more

docker ps shows, that the publishing to random ports works as expected:

ce46daa0a09d        payara/server-full:latest   "/tini -- /bin/sh -c??"   6 seconds ago       Up 5 seconds        0.0.0.0:32775->4848/tcp, 0.0.0.0:32774->8080/tcp, 0.0.0.0:32773->8181/tcp, 0.0.0.0:32772->9009/tcp   payara

But somehow, arquillian-cube is not picking up these ports.

Am I missing something here?

Additional Info

My complete config:

<?xml version="1.0"?>
<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">

  <engine>
    <property name="deploymentExportPath">target/arquillian</property>
  </engine>
  
  <extension qualifier="docker">
    <property name="serverVersion">1.12</property>
    <property name="serverUri">http://localhost:2375</property>
    <property name="definitionFormat">CUBE</property>
    <property name="dockerContainers">
          payara:
            image: payara/server-full:latest
            await:
              strategy: polling
            env: []
            publishAllPorts: true
      </property>
  </extension>

  <container qualifier="payara" default="true">
    <configuration>
      <property name="adminUser">admin</property>
      <property name="adminPassword">admin</property>
      <property name="adminHttps">true</property>
      <property name="authorisation">true</property>
    </configuration>
  </container>

</arquillian>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant