{"record":{"id":"1512d095188f62d9","repo":"apache/iceberg","slug":"cannot-retrieve-members-for-consumer-group-cons","errorCode":null,"errorMessage":"Cannot retrieve members for consumer group: ${consumerGroupId}","messagePattern":"Cannot retrieve members for consumer group: (.+?)","errorType":"exception","errorClass":"ConnectException","httpStatus":null,"severity":"error","filePath":"kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/channel/KafkaUtils.java","lineNumber":51,"sourceCode":"import org.apache.kafka.connect.sink.SinkTaskContext;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nclass KafkaUtils {\n\n  private static final Logger LOG = LoggerFactory.getLogger(KafkaUtils.class);\n\n  private static final String CONTEXT_CLASS_NAME =\n      \"org.apache.kafka.connect.runtime.WorkerSinkTaskContext\";\n\n  static ConsumerGroupDescription consumerGroupDescription(String consumerGroupId, Admin admin) {\n    try {\n      DescribeConsumerGroupsResult result =\n          admin.describeConsumerGroups(ImmutableList.of(consumerGroupId));\n      return result.describedGroups().get(consumerGroupId).get();\n\n    } catch (InterruptedException | ExecutionException e) {\n      throw new ConnectException(\n          \"Cannot retrieve members for consumer group: \" + consumerGroupId, e);\n    }\n  }\n\n  static ConsumerGroupMetadata consumerGroupMetadata(SinkTaskContext context) {\n    return kafkaConsumer(context).groupMetadata();\n  }\n\n  static void seekToLastCommittedOffsets(SinkTaskContext context) {\n    Consumer<byte[], byte[]> consumer = kafkaConsumer(context);\n    if (consumer == null) {\n      return;\n    }\n\n    Map<TopicPartition, OffsetAndMetadata> committedOffsets =\n        consumer.committed(consumer.assignment());\n    if (committedOffsets == null || committedOffsets.isEmpty()) {\n      return;","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/channel/KafkaUtils.java#L33-L69","documentation":"KafkaUtils.consumerGroupDescription wraps failures from the AdminClient describeConsumerGroups call into a ConnectException. The sink needs the consumer group's members to map topic partitions to committer tasks; if the describe call is interrupted or fails asynchronously, this error reports it.","triggerScenarios":"admin.describeConsumerGroups(consumerGroupId).describedGroups().get(...).get() throws InterruptedException or ExecutionException — group does not exist, insufficient ACLs, broker unreachable, or the future was interrupted.","commonSituations":"Wrong consumer.group.id or group deleted/recreated between task start; Connect worker lacking DESCRIBE ACL on the group; network/firewall issue to the Kafka brokers; group metadata not yet propagated at startup.","solutions":["Verify the consumer group exists: kafka-consumer-groups --bootstrap-server ... --describe --group <groupId>.","Check worker ACLs — the principal needs DESCRIBE on the consumer group resource.","Verify bootstrap servers and network connectivity from the Connect worker to the brokers.","If the group was recently recreated, restart the connector after group metadata is stable."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before starting the connector, verify group access\nkafka-consumer-groups --bootstrap-server broker:9092 --describe --group <consumer.group.id>","typeGuard":null,"tryCatchPattern":"try {\n  ConsumerGroupDescription desc = KafkaUtils.consumerGroupDescription(admin, groupId);\n} catch (ConnectException e) {\n  LOG.error(\"Failed to describe consumer group {} — check existence, ACLs (DESCRIBE), broker connectivity\", groupId, e);\n  throw e;\n}","preventionTips":["Verify the consumer group exists and is stable before connector start","Grant DESCRIBE ACL on the group to the Connect worker principal","Validate broker connectivity from the worker with a smoke test","Avoid deleting/recreating the group while the connector is running"],"tags":["kafka-connect","consumer-group","admin-client","network"],"backgroundTag":"record-not-found","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}