{"record":{"id":"8f1ab9d25f89865c","repo":"provectus/kafka-ui","slug":"location-does-not-exist","errorCode":null,"errorMessage":"Location does not exist","messagePattern":"Location does not exist","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/CustomSerdeLoader.java","lineNumber":82,"sourceCode":"    if (isArchive(location)) {\n      return List.of(location.toUri().toURL());\n    }\n    if (Files.isDirectory(location)) {\n      List<URL> archiveFiles = new ArrayList<>();\n      try (var files = Files.walk(location)) {\n        var paths = files.filter(CustomSerdeLoader::isArchive).collect(Collectors.toList());\n        for (Path path : paths) {\n          archiveFiles.add(path.toUri().toURL());\n        }\n      }\n      return archiveFiles;\n    }\n    return List.of();\n  }\n\n  private ClassLoader createClassloader(Path location) {\n    if (!Files.exists(location)) {\n      throw new IllegalStateException(\"Location does not exist\");\n    }\n    var archives = findArchiveFiles(location);\n    if (archives.isEmpty()) {\n      throw new IllegalStateException(\"No archive files were found\");\n    }\n    // we assume that location's content does not change during serdes creation\n    // so, we can reuse already created classloaders\n    return classloaders.computeIfAbsent(location, l ->\n        AccessController.doPrivileged(\n            (PrivilegedAction<URLClassLoader>) () ->\n                new ChildFirstClassloader(\n                    archives.toArray(URL[]::new),\n                    CustomSerdeLoader.class.getClassLoader())));\n  }\n\n  //---------------------------------------------------------------------------------\n\n  // This Classloader first tries to load classes by itself. If class not fount","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/provectus/kafka-ui/blob/83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/CustomSerdeLoader.java#L64-L100","documentation":"CustomSerdeLoader.createClassloader builds a URLClassLoader from a configured serde file location. Before scanning for archives it checks that the path exists; if the configured filePath directory/jar is absent on disk it throws IllegalStateException('Location does not exist') to fail fast at serde startup rather than at first use.","triggerScenarios":"Configuring a custom serde whose filePath points to a directory or archive that does not exist on the kafka-ui host (typo, wrong volume mount, file deleted).","commonSituations":"Docker/Kubernetes deployments where the serde jar is not mounted into the container; config written for another machine; relative paths resolved against a different working directory.","solutions":["Verify the configured filePath exists on the host running kafka-ui (ls the path in the container)","Fix the kafka.clusters.<cluster>.serde.filePath value to an existing directory/jar","Mount the serde archive into the container volume and align the configured path","Use an absolute path to avoid working-directory ambiguity"],"exampleFix":"// before\nserde:\n  - name: avro-custom\n    filePath: /opt/serdes/custom-serde.jar   # not mounted in container\n// after (jar mounted at /custom-serdes/)\nserde:\n  - name: avro-custom\n    filePath: /custom-serdes/custom-serde.jar","handlingStrategy":"validation","validationCode":"Path loc = Path.of(cfg.getFilePath());\nif (!Files.exists(loc)) throw new IllegalStateException(\"Serde location missing: \" + loc);","typeGuard":null,"tryCatchPattern":"try {\n  serdeRegistry = initializer.init(...);\n} catch (IllegalStateException e) {\n  log.error(\"Custom serde load failed: {}\", e.getMessage());\n  throw e;\n}","preventionTips":["Mount serde jars into containers and verify with a startup check","Use absolute paths","Validate all serde filePaths exist before starting the app"],"tags":["serde","classpath","filesystem","config"],"backgroundTag":"file-not-found","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"}