provectus/kafka-ui · error · ValidationException
Multiple serdes with same name
Error message
Multiple serdes with same name: ${serdeConfig.getName()} What it means
SerdesInitializer registers serdes into a name-keyed map and rejects duplicates. Two serde entries with the same name within one cluster are ambiguous (name is the lookup key), so the second occurrence throws ValidationException('Multiple serdes with same name: <name>').
Solutions
- Rename one of the duplicate serde entries to a unique name
- Remove the redundant duplicate entry from the config
- Check for duplicated blocks introduced by config merge/override
Example fix
// before
serde:
- name: my-serde
className: com.example.MySerde
- name: my-serde
className: com.example.OtherSerde
// after
serde:
- name: my-serde
className: com.example.MySerde
- name: other-serde
className: com.example.OtherSerde Defensive patterns
Strategy: validation
Validate before calling
Set<String> seen = new HashSet<>();
for (SerdeConfig s : clusterProperties.getSerde()) {
if (!seen.add(s.getName()))
throw new IllegalArgumentException("Duplicate serde name: " + s.getName());
} Try / catch
try {
serdes = initializer.init(...);
} catch (ValidationException e) {
log.error("Duplicate serde names: {}", e.getMessage());
throw e;
} Prevention
- Enforce unique serde names per cluster
- Review duplicated YAML blocks after merges
- Generate serde entries from templates that inject unique names
When it happens
Trigger: Two entries under kafka.clusters.<n>.serde share the same 'name' value; init fails when the second one is processed.
Common situations: Copy-pasting a serde block and forgetting to change the name; YAML list accidentally containing the same entry twice after a merge conflict resolution.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- 'name' property not set for serde
- className can't be set for built-in serde
- filePath can't be set for built-in serde types
- serde is not configured
- filePath can't be set for built-in serde type
AI-assisted analysis of provectus/kafka-ui@83b5a60cc0 (2026-09-08).
Data as JSON: /api/errors/c6fb7f065d866ee6.
Report an issue: GitHub.
Appendix: source
Thrown at kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/SerdesInitializer.java:104
public ClusterSerdes init(Environment env,
ClustersProperties clustersProperties,
int clusterIndex) {
ClustersProperties.Cluster clusterProperties = clustersProperties.getClusters().get(clusterIndex);
log.debug("Configuring serdes for cluster {}", clusterProperties.getName());
var globalPropertiesResolver = new PropertyResolverImpl(env);
var clusterPropertiesResolver = new PropertyResolverImpl(env, "kafka.clusters." + clusterIndex);
Map<String, SerdeInstance> registeredSerdes = new LinkedHashMap<>();
// initializing serdes from config
if (clusterProperties.getSerde() != null) {
for (int i = 0; i < clusterProperties.getSerde().size(); i++) {
SerdeConfig serdeConfig = clusterProperties.getSerde().get(i);
if (Strings.isNullOrEmpty(serdeConfig.getName())) {
throw new ValidationException("'name' property not set for serde: " + serdeConfig);
}
if (registeredSerdes.containsKey(serdeConfig.getName())) {
throw new ValidationException("Multiple serdes with same name: " + serdeConfig.getName());
}
var instance = createSerdeFromConfig(
serdeConfig,
new PropertyResolverImpl(env, "kafka.clusters." + clusterIndex + ".serde." + i + ".properties"),
clusterPropertiesResolver,
globalPropertiesResolver
);
registeredSerdes.put(serdeConfig.getName(), instance);
}
}
// initializing remaining built-in serdes with empty selection patters
builtInSerdeClasses.forEach((name, clazz) -> {
if (!registeredSerdes.containsKey(name)) {
BuiltInSerde serde = createSerdeInstance(clazz);
if (autoConfigureSerde(serde, clusterPropertiesResolver, globalPropertiesResolver)) {
registeredSerdes.put(name, new SerdeInstance(name, serde, null, null, null));
}View on GitHub (pinned to 83b5a60cc0)