{"record":{"id":"2bdf39763d40b8b9","repo":"apache/flink","slug":"cannot-find-any-jar-files-for-plugin-in-directory","errorCode":null,"errorMessage":"Cannot find any jar files for plugin in directory [%s]. Please provide the jar files for the plugin or delete the directory.","messagePattern":"Cannot find any jar files for plugin in directory \\[(.+?)\\]\\. Please provide the jar files for the plugin or delete the directory\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/core/plugin/DirectoryBasedPluginFinder.java","lineNumber":103,"sourceCode":"\n    private PluginDescriptor createPluginDescriptorForSubDirectory(Path subDirectory)\n            throws IOException {\n        URL[] urls = createJarURLsFromDirectory(subDirectory);\n        Arrays.sort(urls, Comparator.comparing(URL::toString));\n        // TODO: This class could be extended to parse exclude-pattern from a optional text files in\n        // the plugin directories.\n        return new PluginDescriptor(subDirectory.getFileName().toString(), urls, new String[0]);\n    }\n\n    private URL[] createJarURLsFromDirectory(Path subDirectory) throws IOException {\n        try (Stream<Path> stream = Files.list(subDirectory)) {\n            URL[] urls =\n                    stream.filter((Path p) -> Files.isRegularFile(p) && jarFileMatcher.matches(p))\n                            .map(FunctionUtils.uncheckedFunction((Path p) -> p.toUri().toURL()))\n                            .toArray(URL[]::new);\n\n            if (urls.length < 1) {\n                throw new IOException(\n                        \"Cannot find any jar files for plugin in directory [\"\n                                + subDirectory\n                                + \"].\"\n                                + \" Please provide the jar files for the plugin or delete the directory.\");\n            }\n\n            return urls;\n        }\n    }\n}\n","sourceCodeStart":85,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/core/plugin/DirectoryBasedPluginFinder.java#L85-L114","documentation":"For each subdirectory of the plugins root, DirectoryBasedPluginFinder.createJarURLsFromDirectory collects files matching the '*.jar' glob. If the subdirectory contains no regular jar files it throws IOException('Cannot find any jar files for plugin in directory [<dir>]. Please provide the jar files for the plugin or delete the directory.'). Every directory under the plugins root is treated as a plugin and must contain at least one jar.","triggerScenarios":"An empty subdirectory under the plugins root, or one containing only non-jar files (docs, poms, extracted classes, hidden files) — the finder lists it as a plugin but finds zero matching jars.","commonSituations":"Leftover empty directories from a failed plugin install; users extracting a plugin jar instead of copying the jar; README/temp files dropped into a plugin folder; directory created as a placeholder for a future plugin.","solutions":["Put the plugin jar(s) directly inside the subdirectory: plugins/<name>/<name>-<version>.jar.","If the directory is not meant to be a plugin, delete it entirely — an empty subdirectory is an error by design.","Check for nested layout mistakes: jars must be at the top level of the subdirectory, not in nested folders, and must match the *.jar filename pattern."],"exampleFix":"# before\nplugins/\n  my-plugin/            # empty -> IOException\n\n# after\nplugins/\n  my-plugin/my-plugin-1.0.jar","handlingStrategy":"validation","validationCode":"try (Stream<Path> s = Files.list(pluginsRoot)) {\n    for (Path dir : (Iterable<Path>) s.filter(Files::isDirectory)::iterator) {\n        boolean hasJar = Files.list(dir).anyMatch(p -> p.toString().endsWith(\".jar\"));\n        if (!hasJar) {\n            throw new IOException(\"plugin dir without jars: \" + dir + \" — remove it or add jars\");\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Every directory under the plugins root is a plugin — do not leave empty or non-jar folders there.","Place jars at the top level of each plugin folder, never nested."],"tags":["plugins","configuration","flink-core","filesystem"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}