Search code examples
dockerapache-kafkaconfluent-platform

Command [../kafka.properties.template ../kafka.properties] FAILED ! Kafka fails to start as a container


Im using docker swarm to set up a kafka-queue container

for some reason since 3 days ago, the kafka-queue fails to start with this error

 dub template "/etc/confluent/docker/${COMPONENT}.properties.template" "/etc/${COMPONENT}/${COMPONENT}.properties"
swarm_stack_kafka-queue.1.xbe7lg7ecc62@xdrdev4    | + dub template /etc/confluent/docker/kafka.properties.template /etc/kafka/kafka.properties
swarm_stack_kafka-queue.1.xbe7lg7ecc62@xdrdev4    | 'ascii' codec can't decode byte 0xe2 in position 8: ordinal not in range(128)
swarm_stack_kafka-queue.1.xbe7lg7ecc62@xdrdev4    | Command [/usr/local/bin/dub template /etc/confluent/docker/kafka.properties.template /etc/kafka/kafka.properties] FAILED !

i run the swarm with this compose

zookeeper:
    container_name: zookeeper
    image: confluentinc/cp-zookeeper:4.0.0
    volumes:
        - "/data/xdr/zookeeper:/var/zookeeper"
    ports:
        - "2181:2181"
    environment:
        ZOOKEEPER_SERVER_ID: 2
        ZOOKEEPER_CLIENT_PORT: 2181
        ZOOKEEPER_TICK_TIME: 2000
        ZOOKEEPER_INIT_LIMIT: 5
        ZOOKEEPER_SYNC_LIMIT: 2
        ZOOKEEPER_SERVERS: "zookeeper:2222:3333"
    networks:
        - integ_net2
    deploy:
      mode: replicated
      replicas: 1

kafka-queue:
    container_name: kafka-queue
    image: confluentinc/cp-kafka:latest
    ports:
        - "9092:9092"
    volumes:
        - "/data/xdr/kafka/data:/var/lib/kafka/data"
    depends_on:
        - zookeeper
    environment:
        KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
        KAFKA_HEAP_OPTS: "-Xmx13G –Xms13G"
        KAFKA_BROKER_ID: 3
        KAFKA_NUM_PARTITIONS: 20
        KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-queue:9092
        KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
        ZOOKEEPER_CHROOT: /broker
    networks:
        - integ_net2
    deploy:
      mode: replicated
      replicas: 1

The strange this about it is the same compose worked a week ago, what i did few days ago is just remove the swarm and setting it up again... I originally worked with the docker image : confluentinc/cp-kafka:4.0.0

but even after moving it to latest still the same problem occurs...

The image is from confluent itself, i see no reason why it should fail or for me to change anything.

Anyone got this problem as well?


Solution

  • You have some weird things going on in the dashes "-Xmx13G –Xms13G"

    Looks like a copy/paste Unicode thing. I'd suggest dropping that heap setting altogether because 13G for a Kafka broker is unlikely necessary (you'd probably rather have that memory in the page cache). If you've found it necessary, try fixing your dashes to be the standard '-' dash.