Kafka SASL step not working as expected on Windows: Timeout expired while fetching topic metadata
search cancel

Kafka SASL step not working as expected on Windows: Timeout expired while fetching topic metadata

book

Article ID: 270048

calendar_today

Updated On: 03-13-2025

Products

Service Virtualization

Issue/Introduction

Getting this error when staging Kafka test case.
 
Adjusting Runtime Scopes
Creating SSL Context with protocol: TLS
Opening producer on myexample.com:9093
Sending message to topic Kafka_Test
Creating SSL Context with protocol: TLS
Error: Error waiting for acknowledgement after sending message to topic Kafka_Test: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
============================================================================
| Exception:
============================================================================
| Message:     Error waiting for acknowledgement after sending message to topic Kafka_Test: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
----------------------------------------------------------------------------
| Trapped Exception: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
| Trapped Message:   java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
----------------------------------------------------------------------------
STACK TRACE
java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
                at org.apache.kafka.clients.producer.KafkaProducer$FutureFailure.<init>(KafkaProducer.java:1150)
                at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:846)
                at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:784)
                at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:671)
                at com.itko.lisa.messaging.providers.kafka.asset.KafkaUtils.sendSingleMessage(KafkaUtils.java:349)
                at com.itko.lisa.messaging.providers.kafka.operation.KafkaSendOperation.doExecute2(KafkaSendOperation.java:308)
                at com.itko.lisa.messaging.providers.kafka.operation.KafkaSendOperation.doExecute2(KafkaSendOperation.java:48)
                at com.itko.lisa.asset.operation.AbstractRetryableRuntimeOperation.doExecute(AbstractRetryableRuntimeOperation.java:30)
                at com.itko.lisa.asset.operation.AbstractRuntimeOperation.execute(AbstractRuntimeOperation.java:168)
                at com.itko.lisa.messaging.builder.AbstractSendReceiveOperation.doExecute(AbstractSendReceiveOperation.java:156)
                at com.itko.lisa.asset.operation.AbstractRuntimeOperation.execute(AbstractRuntimeOperation.java:168)
                at com.itko.lisa.asset.operation.AbstractOperationStep.execute(AbstractOperationStep.java:176)
                at com.itko.lisa.asset.operation.AbstractOperationStep.execute(AbstractOperationStep.java:125)
                at com.itko.lisa.asset.operation.AbstractOperationStepEditor$ExecuteTask.run(AbstractOperationStepEditor.java:577)
                at com.itko.lisa.asset.ui.ProgressLog$Worker.doInBackground(ProgressLog.java:143)
                at com.itko.lisa.asset.ui.ProgressLog$Worker.doInBackground(ProgressLog.java:101)
                at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at javax.swing.SwingWorker.run(SwingWorker.java:334)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
============================================================================
                at com.itko.lisa.messaging.providers.kafka.asset.KafkaUtils.sendSingleMessage(KafkaUtils.java:378)
                at com.itko.lisa.messaging.providers.kafka.operation.KafkaSendOperation.doExecute2(KafkaSendOperation.java:308)
                at com.itko.lisa.messaging.providers.kafka.operation.KafkaSendOperation.doExecute2(KafkaSendOperation.java:48)
                at com.itko.lisa.asset.operation.AbstractRetryableRuntimeOperation.doExecute(AbstractRetryableRuntimeOperation.java:30)
                at com.itko.lisa.asset.operation.AbstractRuntimeOperation.execute(AbstractRuntimeOperation.java:168)
                at com.itko.lisa.messaging.builder.AbstractSendReceiveOperation.doExecute(AbstractSendReceiveOperation.java:156)
                at com.itko.lisa.asset.operation.AbstractRuntimeOperation.execute(AbstractRuntimeOperation.java:168)
                at com.itko.lisa.asset.operation.AbstractOperationStep.execute(AbstractOperationStep.java:176)
                at com.itko.lisa.asset.operation.AbstractOperationStep.execute(AbstractOperationStep.java:125)
                at com.itko.lisa.asset.operation.AbstractOperationStepEditor$ExecuteTask.run(AbstractOperationStepEditor.java:577)
                at com.itko.lisa.asset.ui.ProgressLog$Worker.doInBackground(ProgressLog.java:143)
                at com.itko.lisa.asset.ui.ProgressLog$Worker.doInBackground(ProgressLog.java:101)
                at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at javax.swing.SwingWorker.run(SwingWorker.java:334)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at java.lang.Thread.run(Thread.java:748)
 

Environment

All supported DevTest releases.

Cause

This typically indicates that there is a communication issue or Kafka configuration problem. The error occurs when Devtest tries to connect to Kafka but cannot read the Topic response before the timeout period.

Resolution

The below steps resolved the issue:

  • Review the network connection or firewalls or IP/DNS resolution to ensure that DevTest can communicate properly with Kafka.  May also need to check the Kafka configuration to make sure the Topic specified is properly configured.
  • Start the Coordinator and Simulator as server components specifying the Coordinator and Simulator names on the command line as well as the Registry. 
For example:
C:\CA\DevTest\bin\Coordinator.exe -n ssl://<IP address>:2011/Coordinator -m ssl://<IP address>:2010/Registry
C:\CA\DevTest\\bin\Simulator.exe -n ssl://<IP address>:2014/Simulator -m ssl://<IP address>:2010/Registry

 

Able to successfully stage the Kafka test case

 

 

Additional Information