title: Error while executing Kafka topic command: Timed out waiting for a node assignment. Mac OS M1
body: <p>After reading these threads</p>
  <p>. <a href="https://stackoverflow.com/questions/53586130/kafka-topic-creation-timed-out-waiting-for-a-node-assignment">Kafka topic creation: Timed out waiting for a node assignment</a>
  . <a href="https://stackoverflow.com/questions/58376644/error-while-executing-kafka-topic-command-timed-out-waiting-for-a-node-assignme">Error while executing Kafka topic command: Timed out waiting for a node assignment. OS Win 10</a>
  . <a href="https://stackoverflow.com/questions/67181738/docker-kafka-on-macos-m1-issues-stuck-on-configuring">Docker kafka on MacOS M1 Issues stuck on configuring</a></p>
  <p>I decided to go with @igor-fedorov guideline at the last thread</p>
  <p>I've just followed it at my brand new MacBook Air M1 ...
  But I am still getting the damn [2021-10-22 22:37:07,031] ERROR java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.</p>
  <p>So, my data:</p>
  <ol>
  <li>I cloned Apache/Kafka and checked out it to 2.4 branch (it's a project requirement)</li>
  <li>I successfully built it with ./gradlew</li>
  <li>I create the folder structure as you commented</li>
  <li>Docker file (yours but only exposing 9092 port)</li>
  <li>Server.properties</li>
  </ol>
  <pre><code>broker.id=0
  listeners=PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092
  advertised.listeners=PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092
  zookeeper.connect=zookeeper:2181
  zookeeper.connection.timeout.ms=6000
  </code></pre>
  <ol start="6">
  <li>docker-compose.yml. As you can see I aggregated schema-registry docker image too and using a common network definition. And I also didn't get if the server.properties conf prevail or do not prevail over docker-compose properties</li>
  </ol>
  <pre><code>version: '2'
  services:
    zookeeper:
      #image: confluentinc/cp-zookeeper:5.4.2
      image: zookeeper:3.7.0
      hostname: zookeeper
      container_name: zookeeper
      ports:
        - &quot;2181:2181&quot;
      environment:
        ZOOKEEPER_CLIENT_PORT: 2181
        ZOOKEEPER_TICK_TIME: 2000
      volumes:
        - ~/Codigo/ECC/kafka-build-local/volumes/zookeper/data:/data
        - ~/Codigo/ECC/kafka-build-local/volumes/zookeper/datalog:/datalog
      networks:
        - firefly
  
    kafka1:
      #image: confluentinc/cp-enterprise-kafka:5.4.2
      #image: fogsyio/kafka:arm64v8-2.2.0
      hostname: kafka1
      container_name: kafka1
      build: ./kafka_m1
      depends_on:
        - zookeeper
      ports:
        - &quot;9092:9092&quot;
        #- &quot;127.0.0.1:9092:9092&quot;
      environment:
        #OJO: CON build PUEDE QUE EL FICHERO DE CONFIGURACIÓN PREVALEZCA SOBRE ESTA CONFIGURACIÓN?
        # kafka/config/server.properties
        KAFKA_BROKER_ID: 1
        KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
        KAFKA_AUTO_CREATE_TOPICS_ENABLE: &quot;true&quot;
        KAFKA_DELETE_TOPIC_ENABLE: &quot;true&quot;
        KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
        KAFKA_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092
        KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092
        # Para local no es necesario métricas
        #KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
        KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
        KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
        KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: &quot;false&quot;
        CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: kafka1:29092
        CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT: zookeeper:2181
        CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
        #CONFLUENT_METRICS_ENABLE: 'true'
        CONFLUENT_METRICS_ENABLE: &quot;false&quot;
        CONFLUENT_SUPPORT_CUSTOMER_ID: 'anonymous'
      volumes:
        - ~/Codigo/ECC/kafka-build-local/volumes/kafka1:/var/lib/kafka/data
      networks:
        - firefly
  
    schema-registry:
      #image: confluentinc/cp-schema-registry:5.4.2
      image: eugenetea/schema-registry-arm64:latest
      hostname: schema-registry
      container_name: schema-registry
      depends_on:
        - zookeeper
        - kafka1
      ports:
        - &quot;8081:8081&quot;
      environment:
        SCHEMA_REGISTRY_HOST_NAME: schema-registry
        SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181'
      volumes:
        - ~/Codigo/ECC/kafka-build-local/volumes/schema-registry:/data
      networks:
        - firefly
  
  
  networks:
    firefly:
      driver: bridge
  </code></pre>
  <ol start="7">
  <li>ZooKeeper start up logs</li>
  </ol>
  <pre><code>2021-10-23 09:35:19,584 [myid:1] - INFO  [main:NIOServerCnxnFactory@660] - binding to port /0.0.0.0:2181
  2021-10-23 09:35:19,597 [myid:1] - INFO  [main:WatchManagerFactory@42] - Using org.apache.zookeeper.server.watch.WatchManager as watch manager
  2021-10-23 09:35:19,597 [myid:1] - INFO  [main:WatchManagerFactory@42] - Using org.apache.zookeeper.server.watch.WatchManager as watch manager
  2021-10-23 09:35:19,598 [myid:1] - INFO  [main:ZKDatabase@133] - zookeeper.snapshotSizeFactor = 0.33
  2021-10-23 09:35:19,598 [myid:1] - INFO  [main:ZKDatabase@153] - zookeeper.commitLogCount=500
  2021-10-23 09:35:19,601 [myid:1] - INFO  [main:SnapStream@61] - zookeeper.snapshot.compression.method = CHECKED
  2021-10-23 09:35:19,633 [myid:1] - INFO  [main:FileSnap@85] - Reading snapshot /data/version-2/snapshot.17e
  2021-10-23 09:35:19,640 [myid:1] - INFO  [main:DataTree@1709] - The digest in the snapshot has digest version of 2, , with zxid as 0x17e, and digest value as 93697964796
  2021-10-23 09:35:19,670 [myid:1] - INFO  [main:ZKAuditProvider@42] - ZooKeeper audit is disabled.
  2021-10-23 09:35:19,671 [myid:1] - INFO  [main:FileTxnSnapLog@372] - 55 txns loaded in 16 ms
  2021-10-23 09:35:19,671 [myid:1] - INFO  [main:ZKDatabase@290] - Snapshot loaded in 73 ms, highest zxid is 0x1b5, digest is 88637075219
  2021-10-23 09:35:19,677 [myid:1] - INFO  [main:FileTxnSnapLog@479] - Snapshotting: 0x1b5 to /data/version-2/snapshot.1b5
  2021-10-23 09:35:19,683 [myid:1] - INFO  [main:ZooKeeperServer@543] - Snapshot taken in 6 ms
  2021-10-23 09:35:19,693 [myid:1] - INFO  [main:RequestThrottler@75] - zookeeper.request_throttler.shutdownTimeout = 10000
  2021-10-23 09:35:19,693 [myid:1] - INFO  [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@137] - PrepRequestProcessor (sid:0) started, reconfigEnabled=false
  2021-10-23 09:35:19,711 [myid:1] - INFO  [main:ContainerManager@84] - Using checkIntervalMs=60000 maxPerMinute=10000 maxNeverUsedIntervalMs=0
  2021-10-23 09:35:19,924 [myid:1] - INFO  [SyncThread:0:FileTxnLog@284] - Creating new log file: log.1b6
  </code></pre>
  <ol start="8">
  <li>Kafka start up logs</li>
  </ol>
  <pre><code>kafka1             | [2021-10-23 09:35:20,425] INFO Creating /brokers/ids/0 (is it secure? false) (kafka.zk.KafkaZkClient)
  kafka1             | [2021-10-23 09:35:20,438] INFO Stat of the created znode at /brokers/ids/0 is: 452,452,1634981720431,1634981720431,1,0,0,72057717675327488,247,0,452
  kafka1             |  (kafka.zk.KafkaZkClient)
  kafka1             | [2021-10-23 09:35:20,438] INFO Registered broker 0 at path /brokers/ids/0 with addresses: ArrayBuffer(EndPoint(kafka1,29092,ListenerName(PLAINTEXT),PLAINTEXT), EndPoint(localhost,9092,ListenerName(PLAINTEXT_HOST),PLAINTEXT)), czxid (broker epoch): 452 (kafka.zk.KafkaZkClient)
  kafka1             | [2021-10-23 09:35:20,473] INFO [ExpirationReaper-0-topic]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
  kafka1             | [2021-10-23 09:35:20,474] INFO [ExpirationReaper-0-Heartbeat]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
  kafka1             | [2021-10-23 09:35:20,480] INFO [ExpirationReaper-0-Rebalance]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
  kafka1             | [2021-10-23 09:35:20,497] INFO [GroupCoordinator 0]: Starting up. (kafka.coordinator.group.GroupCoordinator)
  kafka1             | [2021-10-23 09:35:20,498] INFO [GroupCoordinator 0]: Startup complete. (kafka.coordinator.group.GroupCoordinator)
  kafka1             | [2021-10-23 09:35:20,501] INFO [GroupMetadataManager brokerId=0] Removed 0 expired offsets in 3 milliseconds. (kafka.coordinator.group.GroupMetadataManager)
  kafka1             | [2021-10-23 09:35:20,525] INFO [ProducerId Manager 0]: Acquired new producerId block (brokerId:0,blockStartProducerId:10000,blockEndProducerId:10999) by writing to Zk with path version 11 (kafka.coordinator.transaction.ProducerIdManager)
  kafka1             | [2021-10-23 09:35:20,542] INFO [TransactionCoordinator id=0] Starting up. (kafka.coordinator.transaction.TransactionCoordinator)
  kafka1             | [2021-10-23 09:35:20,547] INFO [Transaction Marker Channel Manager 0]: Starting (kafka.coordinator.transaction.TransactionMarkerChannelManager)
  kafka1             | [2021-10-23 09:35:20,548] INFO [TransactionCoordinator id=0] Startup complete. (kafka.coordinator.transaction.TransactionCoordinator)
  kafka1             | [2021-10-23 09:35:20,580] INFO [ExpirationReaper-0-AlterAcls]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
  kafka1             | [2021-10-23 09:35:20,605] INFO [/config/changes-event-process-thread]: Starting (kafka.common.ZkNodeChangeNotificationListener$ChangeEventProcessThread)
  kafka1             | [2021-10-23 09:35:20,632] INFO [SocketServer brokerId=0] Started data-plane processors for 2 acceptors (kafka.network.SocketServer)
  kafka1             | [2021-10-23 09:35:20,636] INFO Kafka version: 2.4.2-SNAPSHOT (org.apache.kafka.common.utils.AppInfoParser)
  kafka1             | [2021-10-23 09:35:20,636] INFO Kafka commitId: d0488d9a80ec55c4 (org.apache.kafka.common.utils.AppInfoParser)
  kafka1             | [2021-10-23 09:35:20,636] INFO Kafka startTimeMs: 1634981720632 (org.apache.kafka.common.utils.AppInfoParser)
  kafka1             | [2021-10-23 09:35:20,637] INFO [KafkaServer id=0] started (kafka.server.KafkaServer)
  kafka1             | [2021-10-23 09:35:20,663] INFO [ReplicaFetcherManager on broker 0] Removed fetcher for partitions Set(test-ton-build2-1, test-ton-build2-0, test-ton-build-0, _schemas-0, test-ton-build-1, test-ton-build-2, test-ton-build2-2) (kafka.server.ReplicaFetcherManager)
  kafka1             | [2021-10-23 09:35:20,704] INFO [Log partition=test-ton-build-2, dir=/tmp/kafka-logs] Loading producer state till offset 0 with message format version 2 (kafka.log.Log)
  kafka1             | [2021-10-23 09:35:20,707] INFO [Log partition=test-ton-build-2, dir=/tmp/kafka-logs] Completed load of log with 1 segments, log start offset 0 and log end offset 0 in 21 ms (kafka.log.Log)
  kafka1             | [2021-10-23 09:35:20,710] INFO Created log for partition test-ton-build-2 in /tmp/kafka-logs/test-ton-build-2 with properties {compression.type -&gt; producer, min.insync.replicas -&gt; 1, message.downconversion.enable -&gt; true, segment.jitter.ms -&gt; 0, cleanup.policy -&gt; [delete], flush.ms -&gt; 9223372036854775807, retention.ms -&gt; 604800000, segment.bytes -&gt; 1073741824, flush.messages -&gt; 9223372036854775807, message.format.version -&gt; 2.4-IV1, max.compaction.lag.ms -&gt; 9223372036854775807, file.delete.delay.ms -&gt; 60000, max.message.bytes -&gt; 1000012, min.compaction.lag.ms -&gt; 0, message.timestamp.type -&gt; CreateTime, preallocate -&gt; false, index.interval.bytes -&gt; 4096, min.cleanable.dirty.ratio -&gt; 0.5, unclean.leader.election.enable -&gt; false, retention.bytes -&gt; -1, delete.retention.ms -&gt; 86400000, segment.ms -&gt; 604800000, message.timestamp.difference.max.ms -&gt; 9223372036854775807, segment.index.bytes -&gt; 10485760}. (kafka.log.LogManager)
  </code></pre>
  <p>And It continues checking just-created topics and ends with these lines</p>
  <pre><code>[2021-10-23 09:35:20,759] INFO [Partition test-ton-build2-1 broker=0] No checkpointed highwatermark is found for partition test-ton-build2-1 (kafka.cluster.Partition)
  [2021-10-23 09:35:20,759] INFO [Partition test-ton-build2-1 broker=0] Log loaded for partition test-ton-build2-1 with initial high watermark 0 (kafka.cluster.Partition)
  [2021-10-23 09:35:20,759] INFO [Partition test-ton-build2-1 broker=0] test-ton-build2-1 starts at leader epoch 5 from offset 0 with high watermark 0. Previous leader epoch was -1. (kafka.cluster.Partition)
  </code></pre>
  <p>So, When I log into Kafka docker and I perform the create topic command</p>
  <pre><code>sh-4.4# kafka/bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test-ton-build4
  </code></pre>
  <p>The topic is created</p>
  <pre><code>sh-4.4# kafka/bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test-ton-build4
  sh-4.4# kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --list
  _schemas
  test-ton-build
  test-ton-build2
  test-ton-build4
  sh-4.4#
  </code></pre>
  <p>but when I perform the same command from my Mac, there is the <code>Timed out waiting for a node assignment</code>. error</p>
  <pre><code>agil.coto in ECC kafka-build-local&gt; kafka_m1/kafka/bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test-ton-build5
  Error while executing topic command : org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.
  [2021-10-23 13:00:36,215] ERROR java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.
      at org.apache.kafka.common.internals.KafkaFutureImpl.wrapAndThrow(KafkaFutureImpl.java:45)
      at org.apache.kafka.common.internals.KafkaFutureImpl.access$000(KafkaFutureImpl.java:32)
      at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:89)
      at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:260)
      at kafka.admin.TopicCommand$AdminClientTopicService.createTopic(TopicCommand.scala:225)
      at kafka.admin.TopicCommand$TopicService.createTopic(TopicCommand.scala:194)
      at kafka.admin.TopicCommand$TopicService.createTopic$(TopicCommand.scala:189)
      at kafka.admin.TopicCommand$AdminClientTopicService.createTopic(TopicCommand.scala:217)
      at kafka.admin.TopicCommand$.main(TopicCommand.scala:61)
      at kafka.admin.TopicCommand.main(TopicCommand.scala)
  Caused by: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.
   (kafka.admin.TopicCommand$)
  </code></pre>
  <p>any one could help me?</p>