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

Failing to start kafka container with an error 'org.testcontainers.containers.ContainerLaunchException: Container startup failed' #1621

Closed
rajeshhereforyou opened this issue Jul 17, 2019 · 4 comments
Labels

Comments

@rajeshhereforyou
Copy link

rajeshhereforyou commented Jul 17, 2019

Hi,

We are using 1.11.2 version of testcontainers to spin up a kafka broker, zookeeper and schema registry using docker compose yml and we are getting below error. We are getting this error intermittently and not showing the actual reason behind the failure. Can someone guide on this?

The docker compose yml is working fine, I've tested this without test containers.

"Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:277)
at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:212)
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76)
... 39 more
Caused by: java.lang.IllegalStateException: Container did not start correctly.
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:255)"

@rajeshhereforyou
Copy link
Author

rajeshhereforyou commented Jul 17, 2019

Here is the docker compose file that we are using

version: '2'
services:
  zookeeper:
    image: confluentinc/cp-zookeeper:4.0.0
    hostname: zookeeper
    ports:
      - "2181:2181"
      - "9996:9996"
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: 2000
      KAFKA_JMX_PORT: 9996

  broker0:
    image: confluentinc/cp-enterprise-kafka:4.0.0
    hostname: broker0
    depends_on:
      - zookeeper
    ports:
      - "39092:39092"
      - "29092:29092"
      - "9997:9997"
    environment:
      KAFKA_BROKER_ID: 0
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker0:29092,PLAINTEXT_HOST://localhost:39092
      KAFKA_LOG_CLEANUP_POLICY: compact
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_DEFAULT_REPLICATION_FACTOR: 1
      KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
      KAFKA_AUTO_LEADER_REBALANCE_ENABLE: 'true'
      KAFKA_MIN_INSYNC_REPLICAS: 1
      KAFKA_JMX_PORT: 9997
      KAFKA_JMX_OPTS: '-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.rmi.port=9997'

  schema-registry:
    image: confluentinc/cp-schema-registry:4.0.0
    hostname: schema-registry
    depends_on:
      - zookeeper
      - broker0
    ports:
      - "48081:48081"
    environment:
      SCHEMA_REGISTRY_HOST_NAME: schema-registry
      SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181'
      SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:48081
      SCHEMA_REGISTRY_AVRO_COMPATIBILITY_LEVEL: none" 

@stale
Copy link

stale bot commented Oct 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

@stale stale bot added the stale label Oct 17, 2019
@stale
Copy link

stale bot commented Oct 31, 2019

This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case.

@stale stale bot closed this as completed Oct 31, 2019
@nataliaoliveira
Copy link

@rajeshhereforyou did you find a solution? I am having the same with Github Actions build.

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

No branches or pull requests

2 participants