Timed out waiting for Kafka to create /brokers/ids in Zookeeper

I am getting an io.confluent.admin.utils.cli.KafkaReadyCommand error,

stating that org.apache.kafka.common.errors.TimeoutException: Timed out waiting for Kafka to create /brokers/ids in Zookeeper. timeout (ms) = 40000

I can see bothe my kafka and zookeeper services to be up and running,
but schem-registry throws this error when it starts

Here is my docker-compose file, still new to kafka, much appretiaed with help and pointing out if i am mising something

version: "3.1"
services:
  zookeeper:
    image: confluentinc/cp-zookeeper:5.3.1
    hostname: zookeeper
    ports:
      - 2181:2181
    container_name: zookeeper
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: 2000

  kafka:
    container_name: dvs-kafka
    image: wurstmeister/kafka:2.12-2.4.0
    hostname: kafka
    depends_on:
      - zookeeper
    links:
      - zookeeper
    ports:
      - 29092:29092
    environment:
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092
      KAFKA_LISTENERS: PLAINTEXT://kafka:29092
      KAFKA_ADVERTISED_HOST_NAME: kafka:29092
      KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 30000
      KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"

  schema-registry:
    image: confluentinc/cp-schema-registry:5.3.1
    hostname: schema-registry
    depends_on:
      - zookeeper
      - kafka
    links:
      - zookeeper
      - kafka
    container_name: schema-registry
    ports:
      - "8081:8081"
    environment:
      SCHEMA_REGISTRY_HOST_NAME: schema-registry
      SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: "zookeeper:2181"

Read more here: Source link