testcontainers / testcontainers/testcontainers-java
DockerComposeContainer integration with Testcontainer throws Container startup failed error
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
I have code setup for launching Selenium GRID with the help of Testcontainer. When I run it on local system it works fine but when I do the same on bitbucket pipeline it failed to start container.
Here I used the code to launch Selenium GRID setup:
DockerComposeContainer environment = new DockerComposeContainer(new File("docker-compose-v3-scale-chrome-no-port.yml"))
.withExposedService("hub", 4444, Wait.forListeningPort());
environment.start();
Here is my bitbucket pipeline file:
image: maven:3.6.3
pipelines:
default:
- step:
size: 2x # Double resources available for this step.
caches:
- maven
name: Build and Test
#runs-on:
#- 'self.hosted'
#- 'apirunner1'
script:
- export TESTCONTAINERS_RYUK_DISABLED=true
- mvn clean test -DClassesToRun="LoginSanitySuite_New~LoginSanitySuite" -DCountriesValue="US~CA" -DBROWSER="CHR_GRID" -DThreadCount="5" -DEnvironment="PROD"
#- mvn clean test
services:
- docker
artifacts:
- ExtentReports/index.html
- process-logs.txt
- memory-logs.txt
- docker-event-logs.txt
definitions:
services:
docker:
memory: 3072
=====================================
Here is my docker compose file
version: "2"
services:
hub:
image: selenium/hub:3.141.59
ports:
- "4443:4444"
environment:
GRID_MAX_SESSION: 28
GRID_BROWSER_TIMEOUT: 3000
GRID_TIMEOUT: 3000
chrome1:
image: selenium/node-chrome-debug:3.141.59
volumes:
- /dev/shm:/dev/shm
depends_on:
- hub
environment:
HUB_PORT_4444_TCP_ADDR: hub
HUB_PORT_4444_TCP_PORT: 4444
NODE_MAX_SESSION: 3
NODE_MAX_INSTANCES: 3
links:
- hub
chrome2:
image: selenium/node-chrome-debug:3.141.59
volumes:
- /dev/shm:/dev/shm
depends_on:
- hub
environment:
HUB_PORT_4444_TCP_ADDR: hub
HUB_PORT_4444_TCP_PORT: 4444
NODE_MAX_SESSION: 3
NODE_MAX_INSTANCES: 3
links:
- hub
===================== Adding docker error log for reference ===================
[WARN tini (8)] Tini is not running as PID 1 and isn't registered as a child subreaper.
Zombie processes will not be re-parented to Tini, so zombie reaping won't work.
To fix the problem, use the -s option or set the environment variable TINI_SUBREAPER to register Tini as a child subreaper, or run Tini as PID 1.
time="2022-06-07T13:01:15.955207346Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
time="2022-06-07T13:01:15.955824052Z" level=warning msg="Binding to IP address without --tlsverify is insecure and gives root access on this machine to everyone who has access to your network." host="tcp://0.0.0.0:2375"
time="2022-06-07T13:01:15.955854686Z" level=warning msg="Binding to an IP address, even on localhost, can also give access to scripts run in a browser. Be safe out there!" host="tcp://0.0.0.0:2375"
time="2022-06-07T13:01:16.956791997Z" level=warning msg="Binding to an IP address without --tlsverify is deprecated. Startup is intentionally being slowed down to show this message" host="tcp://0.0.0.0:2375"
time="2022-06-07T13:01:16.956837066Z" level=warning msg="Please consider generating tls certificates with client validation to prevent exposing unauthenticated root access to your network" host="tcp://0.0.0.0:2375"
time="2022-06-07T13:01:16.956851394Z" level=warning msg="You can override this by explicitly specifying '--tls=false' or '--tlsverify=false'" host="tcp://0.0.0.0:2375"
time="2022-06-07T13:01:16.956860569Z" level=warning msg="Support for listening on TCP without authentication or explicit intent to run without authentication will be removed in the next release" host="tcp://0.0.0.0:2375"
time="2022-06-07T13:01:32Z" level=warning msg="deprecated version : `1`, please switch to version `2`"
time="2022-06-07T13:01:32.087434258Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured"
time="2022-06-07T13:01:32.088168834Z" level=warning msg="could not use snapshotter devmapper in metadata plugin" error="devmapper not configured"
time="2022-06-07T13:01:32.092830542Z" level=warning msg="failed to load plugin io.containerd.internal.v1.opt" error="mkdir /opt/containerd: read-only file system"
time="2022-06-07T13:01:32.092941675Z" level=error msg="failed to initialize a tracing processor \"otlp\"" error="no OpenTelemetry endpoint: skip plugin"
time="2022-06-07T13:01:32.186431041Z" level=warning msg="Your kernel does not support CPU realtime scheduler"
time="2022-06-07T13:01:32.186477358Z" level=warning msg="Your kernel does not support cgroup blkio weight"
time="2022-06-07T13:01:32.186485322Z" level=warning msg="Your kernel does not support cgroup blkio weight_device"
time="2022-06-07T13:02:28Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/info
time="2022-06-07T13:02:29Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/version
time="2022-06-07T13:02:29Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/images/json
time="2022-06-07T13:02:29Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/images/selenium%2Fhub:3.141.59/json"
time="2022-06-07T13:02:29.233108463Z" level=error msg="Handler for GET /v1.32/images/selenium%2Fhub:3.141.59/json returned error: no such image: selenium/hub:3.141.59: No such image: selenium/hub:3.141.59"
time="2022-06-07T13:02:29Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.32/images/create?fromImage=selenium%2Fhub&tag=3.141.59"
time="2022-06-07T13:02:47Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/images/selenium%2Fhub:3.141.59/json"
time="2022-06-07T13:02:47Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/images/selenium%2Fnode-chrome-debug:3.141.59/json"
time="2022-06-07T13:02:47.282486064Z" level=error msg="Handler for GET /v1.32/images/selenium%2Fnode-chrome-debug:3.141.59/json returned error: no such image: selenium/node-chrome-debug:3.141.59: No such image: selenium/node-chrome-debug:3.141.59"
time="2022-06-07T13:02:47Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.32/images/create?fromImage=selenium%2Fnode-chrome-debug&tag=3.141.59"
time="2022-06-07T13:03:31Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/images/selenium%2Fnode-chrome-debug:3.141.59/json"
time="2022-06-07T13:03:31Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/images/docker%2Fcompose:1.29.2/json"
time="2022-06-07T13:03:31.170263975Z" level=error msg="Handler for GET /v1.32/images/docker%2Fcompose:1.29.2/json returned error: no such image: docker/compose:1.29.2: No such image: docker/compose:1.29.2"
time="2022-06-07T13:03:31Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.32/images/create?fromImage=docker%2Fcompose&tag=1.29.2"
time="2022-06-07T13:03:36Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/images/docker%2Fcompose:1.29.2/json"
time="2022-06-07T13:03:36Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/images/alpine:3.14/json"
time="2022-06-07T13:03:36.861680333Z" level=error msg="Handler for GET /v1.32/images/alpine:3.14/json returned error: no such image: alpine:3.14: No such image: alpine:3.14"
time="2022-06-07T13:03:36Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.32/images/create?fromImage=alpine&tag=3.14"
time="2022-06-07T13:03:38Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/images/alpine:3.14/json"
time="2022-06-07T13:03:38Z" level=info msg="Container create request." ArgsEscaped=false AttachStderr=false AttachStdin=false AttachStdout=false ExposedPorts="map[]" Healthcheck="<nil>" Labels="map[org.testcontainers:true org.testcontainers.sessionId:04dbde20-21a0-48c2-aed5-7cb3b50092ad]" MacAddress= NetworkDisabled=false OnBuild="[]" OpenStdin=false StdinOnce=false StopSignal= StopTimeout="<nil>" Tty=false plugin=pipelines
time="2022-06-07T13:03:38Z" level=info msg="Container create request." AutoRemove=false BlkioDeviceReadBps="[]" BlkioDeviceReadIOps="[]" BlkioDeviceWriteBps="[]" BlkioDeviceWriteIOps="[]" BlkioWeight=0 BlkioWeightDevice="[]" CPUCount=0 CPUPercent=0 CPUPeriod=0 CPUQuota=0 CPURealtimePeriod=0 CPURealtimeRuntime=0 CPUShares=0 CapAdd="[]" CapDrop="[]" Cgroup= CgroupParent= ConsoleSize="[0 0]" ContainerIDFile= CpusetCpus= CpusetMems= DNS="[]" DNSOptions="[]" DNSSearch="[]" DeviceCgroupRules="[]" Devices="[]" ExtraHosts="[]" GroupAdd="[]" IOMaximumBandwidth=0 IOMaximumIOps=0 Init="<nil>" IpcMode= Isolations= KernelMemory=0 Links="[]" LogConfig="{ map[]}" MaskedPaths="[]" Memory=0 MemoryReservation=0 MemorySwap=0 MemorySwappiness="<nil>" Mounts="[]" NanoCPUs=0 NetworkMode=default OomKillDisable="<nil>" OomScoreAdj=0 PidMode= PidsLimit="<nil>" PortBindings="map[]" Privileged=false PublishAllPorts=false ReadOnlyPaths="[]" RestartPolicy="{ 0}" Runtime= SecurityOpt="[]" ShmSize=0 StorageOpt="map[]" Sysctls="map[]" Ulimits="[]" UsernsMode= VolumeDriver= VolumesFrom="[]" plugin=pipelines
time="2022-06-07T13:03:38Z" level=info msg="Pipelines plugin request authorization." allowed=false method=POST plugin=pipelines uri=/v1.32/containers/create
time="2022-06-07T13:03:38.403293133Z" level=error msg="AuthZRequest for POST /v1.32/containers/create returned error: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories"
time="2022-06-07T13:03:38Z" level=info msg="Container create request." ArgsEscaped=false AttachStderr=false AttachStdin=false AttachStdout=false ExposedPorts="map[]" Healthcheck="<nil>" Labels="map[org.testcontainers:true org.testcontainers.sessionId:04dbde20-21a0-48c2-aed5-7cb3b50092ad]" MacAddress= NetworkDisabled=false OnBuild="[]" OpenStdin=false StdinOnce=false StopSignal= StopTimeout="<nil>" Tty=false plugin=pipelines
time="2022-06-07T13:03:38Z" level=info msg="Container create request." AutoRemove=false BlkioDeviceReadBps="[]" BlkioDeviceReadIOps="[]" BlkioDeviceWriteBps="[]" BlkioDeviceWriteIOps="[]" BlkioWeight=0 BlkioWeightDevice="[]" CPUCount=0 CPUPercent=0 CPUPeriod=0 CPUQuota=0 CPURealtimePeriod=0 CPURealtimeRuntime=0 CPUShares=0 CapAdd="[]" CapDrop="[]" Cgroup= CgroupParent= ConsoleSize="[0 0]" ContainerIDFile= CpusetCpus= CpusetMems= DNS="[]" DNSOptions="[]" DNSSearch="[]" DeviceCgroupRules="[]" Devices="[]" ExtraHosts="[]" GroupAdd="[]" IOMaximumBandwidth=0 IOMaximumIOps=0 Init="<nil>" IpcMode= Isolations= KernelMemory=0 Links="[]" LogConfig="{ map[]}" MaskedPaths="[]" Memory=0 MemoryReservation=0 MemorySwap=0 MemorySwappiness="<nil>" Mounts="[]" NanoCPUs=0 NetworkMode=default OomKillDisable="<nil>" OomScoreAdj=0 PidMode= PidsLimit="<nil>" PortBindings="map[]" Privileged=false PublishAllPorts=false ReadOnlyPaths="[]" RestartPolicy="{ 0}" Runtime= SecurityOpt="[]" ShmSize=0 StorageOpt="map[]" Sysctls="map[]" Ulimits="[]" UsernsMode= VolumeDriver= VolumesFrom="[]" plugin=pipelines
time="2022-06-07T13:03:38Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri=/v1.32/containers/create
time="2022-06-07T13:03:38Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/start
time="2022-06-07T13:03:38.741176721Z" level=info msg="loading plugin \"io.containerd.event.v1.publisher\"..." runtime=io.containerd.runc.v2 type=io.containerd.event.v1
time="2022-06-07T13:03:38.741273225Z" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
time="2022-06-07T13:03:38.741291791Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
time="2022-06-07T13:03:38.753802513Z" level=info msg="starting signal loop" namespace=moby path=/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346 pid=643 runtime=io.containerd.runc.v2
time="2022-06-07T13:03:39Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:40Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:40Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:40Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:40Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:40Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:40Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:40Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:40Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:41Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:41Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:41Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:41Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:41Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:41Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:41Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:41.865694516Z" level=warning msg="cleaning up after shim disconnected" id=cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346 namespace=moby
time="2022-06-07T13:03:41.941645427Z" level=warning msg="cleanup warnings time=\"2022-06-07T13:03:41Z\" level=info msg=\"starting signal loop\" namespace=moby pid=705 runtime=io.containerd.runc.v2\n"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/json
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/logs?stdout=true&stderr=true&since=0"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346/logs?stdout=true&stderr=true&since=0"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/containers/json?all=true&filters=%7B%22label%22%3A%5B%22org.testcontainers%3Dtrue%22%2C%22org.testcontainers.sessionId%3D04dbde20-21a0-48c2-aed5-7cb3b50092ad%22%5D%7D"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=DELETE plugin=pipelines uri="/v1.32/containers/cb244da326dccd9402ed0c409be08b97f5f3b3e337b01cc194f5ae96216fb346?v=true&force=true"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/v1.32/containers/json?all=true&filters=%7B%22label%22%3A%5B%22com.docker.compose.project%3Dnx57zmchnxzx%22%5D%7D"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.32/networks/prune?filters=%7B%22label%22%3A%5B%22org.testcontainers%3Dtrue%22%2C%22org.testcontainers.sessionId%3D04dbde20-21a0-48c2-aed5-7cb3b50092ad%22%5D%7D"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.32/networks/prune?filters=%7B%22label%22%3A%5B%22com.docker.compose.project%3Dnx57zmchnxzx%22%5D%7D"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.32/volumes/prune?filters=%7B%22label%22%3A%5B%22org.testcontainers%3Dtrue%22%2C%22org.testcontainers.sessionId%3D04dbde20-21a0-48c2-aed5-7cb3b50092ad%22%5D%7D"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.32/volumes/prune?filters=%7B%22label%22%3A%5B%22com.docker.compose.project%3Dnx57zmchnxzx%22%5D%7D"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.32/images/prune?filters=%7B%22label%22%3A%5B%22org.testcontainers%3Dtrue%22%2C%22org.testcontainers.sessionId%3D04dbde20-21a0-48c2-aed5-7cb3b50092ad%22%5D%7D"
time="2022-06-07T13:03:42Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.32/images/prune?filters=%7B%22label%22%3A%5B%22com.docker.compose.project%3Dnx57zmchnxzx%22%5D%7D"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DockerComposeContainer usage and the supplied docker-compose-v3-scale-chrome-no-port.yml, then reproduce it with the Bitbucket pipeline configuration and Maven command. Review the startup logs around container creation and service readiness. Done means the Selenium Grid compose environment starts successfully in the pipeline and the exposed hub service becomes available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, java
- Domain
- ci-cd, devops, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100