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

Sometimes kafka container is not starting properly #625

Open
fmachi opened this issue Oct 28, 2020 · 4 comments
Open

Sometimes kafka container is not starting properly #625

fmachi opened this issue Oct 28, 2020 · 4 comments

Comments

@fmachi
Copy link

fmachi commented Oct 28, 2020

I have a very strange issue using the last version of this docker image. Given the following docker-compose:

version: '3'
services:
  kafka:
    image: wurstmeister/kafka:latest
    ports:
      - "9092:9092"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=kafka
      - KAFKA_ADVERTISED_PORT=9092
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
      - KAFKA_CREATE_TOPICS=(my topic list)
    depends_on:
      - zookeeper
  zookeeper:
    image: wurstmeister/zookeeper
    ports:
      - "2181:2181"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=zookeeper

sometimes (on travis) it fails with the following error. The strange thing is that doesn't fail all the times.
Locally I was never able to reproduce it

kafka_1 | waiting for kafka to be ready
kafka_1 | [Configuring] 'advertised.port' in '/opt/kafka/config/server.properties'
kafka_1 | Excluding KAFKA_HOME from broker config
kafka_1 | [Configuring] 'advertised.host.name' in '/opt/kafka/config/server.properties'
kafka_1 | [Configuring] 'port' in '/opt/kafka/config/server.properties'
kafka_1 | [Configuring] 'broker.id' in '/opt/kafka/config/server.properties'
kafka_1 | Excluding KAFKA_VERSION from broker config
kafka_1 | [Configuring] 'zookeeper.connect' in '/opt/kafka/config/server.properties'
kafka_1 | [Configuring] 'log.dirs' in '/opt/kafka/config/server.properties'
kafka_1 | Error occurred during initialization of VM
kafka_1 | The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0

Thanks a lot!

@ynleborg
Copy link

ynleborg commented Dec 1, 2021

Since today, I have exactly the same problem. But in my case it fails every time on one machine.

@slobberbone
Copy link

In case of ... I've got this error too on a LXC running on Proxmox.
Thanks to itzg/docker-minecraft-server#466 giving something to test :

Adding this to the proxmox lxc configuration file:

lxc.cgroup.devices.allow: c 195:* rwm
lxc.cgroup.devices.allow: c 235:* rwm

And it start now !

@ynleborg
Copy link

ynleborg commented Dec 6, 2021

@slobberbone thank you for the hint. It turned out that it was also something to do with virtualization, which led to ParallelGCThreads=0. I fixed it by setting KAFKA_HEAP_OPTS: "-XX:ParallelGCThreads=1" in docker-compose.yml

@anabeto93
Copy link

I noticed it sometimes occurs when I have corrupted data. I simply down all the containers docker-compose down and then prune the volumes docker volume prune and then docker-compose up --build and that fixes it.

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

4 participants