Skip to content

Conversation

Gezi-lzq
Copy link
Contributor

  • The error indicates the configuration value month(ts) is invalid because it is not recognized as a valid list string.
java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.InvalidConfigurationException: Invalid value month(ts) for configuration : Invalid list string month(ts)
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
	at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:180)
	at kafka.admin.ConfigCommand$.alterConfig(ConfigCommand.scala:382)
	at kafka.admin.ConfigCommand$.processCommand(ConfigCommand.scala:349)
	at kafka.admin.ConfigCommand$.main(ConfigCommand.scala:98)
	at kafka.admin.ConfigCommand.main(ConfigCommand.scala)
Caused by: org.apache.kafka.common.errors.InvalidConfigurationException: Invalid value month(ts) for configuration : Invalid list string month(ts)
  • The method ConfigCommand#parseConfigsToBeAdded parses user-supplied configurations from the command line into a Properties object.
  • It processes a comma-separated string of key=value pairs.
  • To handle values containing commas, the method treats commas inside square brackets [] as part of the value, not as separators.
  • It trims spaces around keys and values, removes the surrounding brackets from values, then stores the cleaned pairs in props.
  • Example: "k2=[v2_a,v2_b]" is stored as key k2 and value v2_a,v2_b without brackets.

if (opts.options.has(opts.addConfig)) {
// Split list by commas, but avoid those in [], then into KV pairs
// Each KV pair is of format key=value, split them into key and value, using -1 as the limit for split() to
// include trailing empty strings. This is to support empty value (e.g. 'ssl.endpoint.identification.algorithm=')
val pattern = "(?=[^\\]]*(?:\\[|$))"
val configsToBeAdded = opts.options.valueOf(opts.addConfig)
.split("," + pattern)
.map(_.split("""\s*=\s*""" + pattern, -1))
require(configsToBeAdded.forall(config => config.length == 2), "Invalid entity config: all configs to be added must be in the format \"key=val\".")
//Create properties, parsing square brackets from values if necessary
configsToBeAdded.foreach(pair => props.setProperty(pair(0).trim, pair(1).replaceAll("\\[?\\]?", "").trim))
}

The error likely arises because month(ts) was not enclosed in brackets, so the parser misinterprets it as an invalid list.

@Gezi-lzq Gezi-lzq merged commit 1bcc9c7 into main Sep 15, 2025
6 checks passed
@Gezi-lzq Gezi-lzq deleted the fix/updata-config branch September 15, 2025 03:04
Gezi-lzq added a commit that referenced this pull request Sep 15, 2025
superhx pushed a commit that referenced this pull request Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants