{"record":{"id":"c169d84bda73be9b","repo":"provectus/kafka-ui","slug":"name-property-not-set-for-serde-serdeconfig","errorCode":null,"errorMessage":"'name' property not set for serde: ${serdeConfig}","messagePattern":"'name' property not set for serde: (.+?)","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/SerdesInitializer.java","lineNumber":101,"sourceCode":"   * trying to auto-configure them and  registering with empty patterns - they will be present\n   * in Serde selection in UI, but not assigned to any topic k/v.\n   */\n  public ClusterSerdes init(Environment env,\n                            ClustersProperties clustersProperties,\n                            int clusterIndex) {\n    ClustersProperties.Cluster clusterProperties = clustersProperties.getClusters().get(clusterIndex);\n    log.debug(\"Configuring serdes for cluster {}\", clusterProperties.getName());\n\n    var globalPropertiesResolver = new PropertyResolverImpl(env);\n    var clusterPropertiesResolver = new PropertyResolverImpl(env, \"kafka.clusters.\" + clusterIndex);\n\n    Map<String, SerdeInstance> registeredSerdes = new LinkedHashMap<>();\n    // initializing serdes from config\n    if (clusterProperties.getSerde() != null) {\n      for (int i = 0; i < clusterProperties.getSerde().size(); i++) {\n        SerdeConfig serdeConfig = clusterProperties.getSerde().get(i);\n        if (Strings.isNullOrEmpty(serdeConfig.getName())) {\n          throw new ValidationException(\"'name' property not set for serde: \" + serdeConfig);\n        }\n        if (registeredSerdes.containsKey(serdeConfig.getName())) {\n          throw new ValidationException(\"Multiple serdes with same name: \" + serdeConfig.getName());\n        }\n        var instance = createSerdeFromConfig(\n            serdeConfig,\n            new PropertyResolverImpl(env, \"kafka.clusters.\" + clusterIndex + \".serde.\" + i + \".properties\"),\n            clusterPropertiesResolver,\n            globalPropertiesResolver\n        );\n        registeredSerdes.put(serdeConfig.getName(), instance);\n      }\n    }\n\n    // initializing remaining built-in serdes with empty selection patters\n    builtInSerdeClasses.forEach((name, clazz) -> {\n      if (!registeredSerdes.containsKey(name)) {\n        BuiltInSerde serde = createSerdeInstance(clazz);","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/provectus/kafka-ui/blob/83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/SerdesInitializer.java#L83-L119","documentation":"SerdesInitializer.init validates each serde entry from kafka.clusters.<n>.serde configuration. Every serde must have a non-empty name; if the name is null/empty the initializer throws ValidationException so the application fails at startup with a clear config error.","triggerScenarios":"A serde entry in application.yaml/properties omits the 'name' field (or sets it to an empty string) while other fields like className/filePath are present.","commonSituations":"YAML indentation mistakes that drop the name key; copy-pasted serde blocks with the name accidentally deleted; programmatic SerdeConfig construction without setName.","solutions":["Add a unique 'name' to the serde entry in the cluster config","Check YAML indentation so the name key is nested under the correct serde item","If constructing SerdeConfig in code, call setName(...) before registration"],"exampleFix":"// before (application.yaml)\nserde:\n  - className: com.example.MySerde\n    filePath: /opt/serdes/my-serde.jar\n// after\nserde:\n  - name: my-serde\n    className: com.example.MySerde\n    filePath: /opt/serdes/my-serde.jar","handlingStrategy":"validation","validationCode":"clusterProperties.getSerde().forEach(s -> {\n  if (Strings.isNullOrEmpty(s.getName()))\n    throw new IllegalArgumentException(\"serde entry missing name: \" + s);\n});","typeGuard":null,"tryCatchPattern":"try {\n  serdes = initializer.init(...);\n} catch (ValidationException e) {\n  log.error(\"Invalid serde config: {}\", e.getMessage());\n  throw e;\n}","preventionTips":["Always set name first in serde entries","Validate YAML indentation for list-of-maps config","Lint application.yaml for required serde keys at deploy time"],"tags":["serde","config","validation","yaml"],"backgroundTag":"missing-required-config-field","analyzedSha":"83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7","analyzedAt":"2026-09-08T04:35:39.002Z","contentChangedAt":"2026-09-08T04:35:39.002Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}