{"record":{"id":"931c4e4d7f17e900","repo":"apache/druid","slug":"cannot-set-kafka-property-enable-auto-commit-pr","errorCode":null,"errorMessage":"Cannot set kafka property [enable.auto.commit]. Property will be forced to [false]. Found [%s]","messagePattern":"Cannot set kafka property \\[enable\\.auto\\.commit\\]\\. Property will be forced to \\[false\\]\\. Found \\[(.+?)\\]","errorType":"validation","errorClass":"org.apache.druid.java.util.common.IAE","httpStatus":null,"severity":"error","filePath":"extensions-core/kafka-extraction-namespace/src/main/java/org/apache/druid/query/lookup/KafkaLookupExtractorFactory.java","lineNumber":407,"sourceCode":"   * Otherwise, lookup data may not be loaded completely.\n   */\n  private void verifyKafkaProperties()\n  {\n    if (kafkaProperties.containsKey(ConsumerConfig.GROUP_ID_CONFIG)) {\n      throw new IAE(\n              \"Cannot set kafka property [group.id]. Property is randomly generated for you. Found [%s]\",\n              kafkaProperties.get(ConsumerConfig.GROUP_ID_CONFIG)\n      );\n    }\n    if (kafkaProperties.containsKey(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG)) {\n      throw new IAE(\n              \"Cannot set kafka property [auto.offset.reset]. Property will be forced to [earliest]. Found [%s]\",\n              kafkaProperties.get(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG)\n      );\n    }\n    if (kafkaProperties.containsKey(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG) &&\n          !kafkaProperties.get(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG).equals(\"false\")) {\n      throw new IAE(\n          \"Cannot set kafka property [enable.auto.commit]. Property will be forced to [false]. Found [%s]\",\n          kafkaProperties.get(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG)\n      );\n    }\n    Preconditions.checkNotNull(\n            kafkaProperties.get(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG),\n            \"bootstrap.servers required property\"\n    );\n  }\n\n  // Overridden in tests\n  Consumer<String, String> getConsumer()\n  {\n    // Workaround for Kafka String Serializer could not be found\n    // Adopted from org.apache.druid.indexing.kafka.KafkaRecordSupplier#getKafkaConsumer\n    ClassLoader currCtxCl = Thread.currentThread().getContextClassLoader();\n    final Properties properties = getConsumerProperties();\n    try {","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/kafka-extraction-namespace/src/main/java/org/apache/druid/query/lookup/KafkaLookupExtractorFactory.java#L389-L425","documentation":"Configuration guard in KafkaLookupExtractorFactory.verifyKafkaProperties (called from start()): the user supplied enable.auto.commit in kafkaProperties, but the factory manages offsets itself and forcibly sets this property to false; supplying it is rejected at startup to prevent silently differing behavior.","triggerScenarios":"Calling start() when kafkaProperties contains 'enable.auto.commit' set to anything other than 'false' (e.g. 'true').","commonSituations":"Copying default Kafka consumer settings (auto-commit defaults to true) into a Druid lookup spec.","solutions":["Remove enable.auto.commit from kafkaProperties","Or explicitly set it to \"false\""],"exampleFix":"// before\n\"enable.auto.commit\": \"true\"\n// after\n\"enable.auto.commit\": \"false\"  // or remove the property","handlingStrategy":"validation","validationCode":"if (kafkaProperties.containsKey(\"enable.auto.commit\") && !\"false\".equals(kafkaProperties.get(\"enable.auto.commit\"))) {\n  kafkaProperties.put(\"enable.auto.commit\", \"false\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set enable.auto.commit=false for lookups","Normalize consumer props before start()","Validate specs in CI with a property whitelist"],"tags":["kafka","config","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}