{"record":{"id":"13432b04b3e515a6","repo":"provectus/kafka-ui","slug":"filepath-can-t-be-set-for-built-in-serde-types","errorCode":null,"errorMessage":"filePath can't be set for built-in serde types","messagePattern":"filePath can't be set for built-in serde types","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/SerdesInitializer.java","lineNumber":199,"sourceCode":"      // built-in serde type with custom name\n      if (builtInSerdeClass.isPresent()) {\n        return createSerdeWithBuiltInClass(builtInSerdeClass.get(), serdeConfig, serdeProps, clusterProps, globalProps);\n      }\n    }\n    log.info(\"Loading custom serde {}\", serdeConfig.getName());\n    return loadAndInitCustomSerde(serdeConfig, serdeProps, clusterProps, globalProps);\n  }\n\n  private SerdeInstance createSerdeWithBuiltInSerdeName(SerdeConfig serdeConfig,\n                                                        PropertyResolver serdeProps,\n                                                        PropertyResolver clusterProps,\n                                                        PropertyResolver globalProps) {\n    String name = serdeConfig.getName();\n    if (serdeConfig.getClassName() != null) {\n      throw new ValidationException(\"className can't be set for built-in serde\");\n    }\n    if (serdeConfig.getFilePath() != null) {\n      throw new ValidationException(\"filePath can't be set for built-in serde types\");\n    }\n    var clazz = builtInSerdeClasses.get(name);\n    BuiltInSerde serde = createSerdeInstance(clazz);\n    if (serdeConfig.getProperties() == null || serdeConfig.getProperties().isEmpty()) {\n      if (!autoConfigureSerde(serde, clusterProps, globalProps)) {\n        // no properties provided and serde does not support auto-configuration\n        throw new ValidationException(name + \" serde is not configured\");\n      }\n    } else {\n      // configuring serde with explicitly set properties\n      serde.configure(serdeProps, clusterProps, globalProps);\n    }\n    return new SerdeInstance(\n        name,\n        serde,\n        nullablePattern(serdeConfig.getTopicKeysPattern()),\n        nullablePattern(serdeConfig.getTopicValuesPattern()),\n        null","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/provectus/kafka-ui/blob/83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/SerdesInitializer.java#L181-L217","documentation":"Built-in serdes are compiled into kafka-ui and loaded from the application classpath; a filePath (external jar/directory) is meaningless for them, so createSerdeWithBuiltInSerdeName throws ValidationException when filePath is set alongside a built-in serde name.","triggerScenarios":"Config entry whose name matches a built-in serde and also sets filePath to a jar or directory.","commonSituations":"Applying the custom-serde config template (which includes filePath) to a built-in serde; misunderstanding that filePath is only for custom, external serdes.","solutions":["Remove the filePath field from the built-in serde entry","If an external jar is truly needed, rename the serde so it is not treated as built-in"],"exampleFix":"// before\nserde:\n  - name: avro-schema-registry\n    filePath: /opt/serdes/extra.jar\n// after\nserde:\n  - name: avro-schema-registry","handlingStrategy":"validation","validationCode":"if (isBuiltInSerdeName(cfg.getName()) && cfg.getFilePath() != null)\n  throw new IllegalArgumentException(\"filePath not allowed for built-in serde \" + cfg.getName());","typeGuard":null,"tryCatchPattern":"try {\n  serde = createSerdeFromConfig(cfg, ...);\n} catch (ValidationException e) {\n  log.error(\"Bad serde config for {}: {}\", cfg.getName(), e.getMessage());\n  throw e;\n}","preventionTips":["Never copy filePath from custom-serde templates onto built-in entries","Reserve filePath for external jars only","Validate serde config before deployment"],"tags":["serde","config","validation","built-in"],"backgroundTag":"mutually-exclusive-options","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"}