{"record":{"id":"5b26baf2fa074916","repo":"apache/flink","slug":"plugins-root-directory-s-does-not-exist","errorCode":null,"errorMessage":"Plugins root directory [%s] does not exist!","messagePattern":"Plugins root directory \\[(.+?)\\] does not exist!","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/core/plugin/DirectoryBasedPluginFinder.java","lineNumber":74,"sourceCode":"    /** Pattern to match jar files in a directory. */\n    private static final String JAR_MATCHER_PATTERN = \"glob:**.jar\";\n\n    /** Root directory to the plugin folders. */\n    private final Path pluginsRootDir;\n\n    /** Matcher for jar files in the filesystem of the root folder. */\n    private final PathMatcher jarFileMatcher;\n\n    public DirectoryBasedPluginFinder(Path pluginsRootDir) {\n        this.pluginsRootDir = pluginsRootDir;\n        this.jarFileMatcher = pluginsRootDir.getFileSystem().getPathMatcher(JAR_MATCHER_PATTERN);\n    }\n\n    @Override\n    public Collection<PluginDescriptor> findPlugins() throws IOException {\n\n        if (!Files.isDirectory(pluginsRootDir)) {\n            throw new IOException(\n                    \"Plugins root directory [\" + pluginsRootDir + \"] does not exist!\");\n        }\n        try (Stream<Path> stream = Files.list(pluginsRootDir)) {\n            return stream.filter((Path path) -> Files.isDirectory(path))\n                    .map(\n                            FunctionUtils.uncheckedFunction(\n                                    this::createPluginDescriptorForSubDirectory))\n                    .collect(Collectors.toList());\n        }\n    }\n\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]);","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/core/plugin/DirectoryBasedPluginFinder.java#L56-L92","documentation":"DirectoryBasedPluginFinder.findPlugins() scans a root directory for plugin subdirectories. If the configured root is not an existing directory (Files.isDirectory fails), it throws IOException('Plugins root directory [<path>] does not exist!'). The finder does not create the directory for you.","triggerScenarios":"Starting a process with plugin.dirs / env.plugins.dirs (or DefaultPluginManager setup) pointing at a path that does not exist or is a regular file rather than a directory.","commonSituations":"Custom deployment where the plugins/ folder was never created; typo'd or absolute-vs-relative path mismatch in configuration; container images that omit the plugins directory; path on a mount that is missing at startup.","solutions":["Create the plugins root directory (mkdir -p /opt/flink/plugins) — an empty directory is valid and loads zero plugins.","Fix the configured path: verify plugin.dirs / env.plugins.dirs points to the intended existing directory.","If plugins are not used at all, remove/leave unset the plugin directory configuration so PluginUtils skips the finder entirely."],"exampleFix":"# before\nplugin.dirs: /opt/flink/plugin   # typo, directory does not exist\n\n# after\nmkdir -p /opt/flink/plugins\nplugin.dirs: /opt/flink/plugins","handlingStrategy":"validation","validationCode":"Path pluginsRoot = Paths.get(configuredPluginsDir);\nif (!Files.isDirectory(pluginsRoot)) {\n    // create it or fail with a clear message before starting the cluster\n    Files.createDirectories(pluginsRoot);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Container/deployment scripts should mkdir -p the plugins directory as part of image build.","Prefer absolute paths for plugin directories to avoid cwd-relative surprises."],"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"}