{"record":{"id":"9cb82779dbc6c870","repo":"apache/flink","slug":"the-directory-s-dose-not-exist","errorCode":null,"errorMessage":"The directory %s dose not exist.","messagePattern":"The directory (.+?) dose not exist\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/util/FileUtils.java","lineNumber":572,"sourceCode":"    }\n\n    /**\n     * List the {@code directory} recursively and return the files that satisfy the {@code\n     * fileFilter}.\n     *\n     * @param directory the directory to be listed\n     * @param fileFilter a file filter\n     * @return a collection of {@code File}s\n     * @throws IOException if an I/O error occurs while listing the files in the given directory\n     */\n    public static Collection<java.nio.file.Path> listFilesInDirectory(\n            final java.nio.file.Path directory, final Predicate<java.nio.file.Path> fileFilter)\n            throws IOException {\n        checkNotNull(directory, \"directory\");\n        checkNotNull(fileFilter, \"fileFilter\");\n\n        if (!Files.exists(directory)) {\n            throw new IllegalArgumentException(\n                    String.format(\"The directory %s dose not exist.\", directory));\n        }\n        if (!Files.isDirectory(directory)) {\n            throw new IllegalArgumentException(\n                    String.format(\"The %s is not a directory.\", directory));\n        }\n\n        final FilterFileVisitor filterFileVisitor = new FilterFileVisitor(fileFilter);\n\n        Files.walkFileTree(\n                directory,\n                EnumSet.of(FileVisitOption.FOLLOW_LINKS),\n                Integer.MAX_VALUE,\n                filterFileVisitor);\n\n        return filterFileVisitor.getFiles();\n    }\n","sourceCodeStart":554,"sourceCodeEnd":590,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/util/FileUtils.java#L554-L590","documentation":"listFilesInDirectory(Path, Predicate) validates its input before walking the file tree: if Files.exists(directory) is false it throws IllegalArgumentException(\"The directory %s dose not exist.\") (note the 'dose' typo in the message). It is a caller-contract error, not an I/O failure — the method refuses to walk a non-existent directory.","triggerScenarios":"Calling FileUtils.listFilesInDirectory(dir, filter) where dir points to a path that is absent: not yet created, already deleted, wrong spelling, or on an unmounted volume.","commonSituations":"Scanning plugin/connectors directories configured via flink-conf (e.g. a directory that the deployment never created); scanning a job's local output dir before the first run; environments where a mount/volume is missing.","solutions":["Create the directory first (Files.createDirectories(dir)) if it is expected to exist","Guard with Files.exists(dir) before calling if absence is a normal condition","Fix the configured path so it names a real directory"],"exampleFix":"// before\nCollection<Path> jars = FileUtils.listFilesInDirectory(pluginDir, JAR_FILTER);\n\n// after\nFiles.createDirectories(pluginDir);\nCollection<Path> jars = FileUtils.listFilesInDirectory(pluginDir, JAR_FILTER);","handlingStrategy":"validation","validationCode":"if (!Files.exists(dir)) throw new IllegalStateException(\"Configured dir missing: \" + dir);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create expected directories at startup with Files.createDirectories","Validate directory-related config keys during deployment smoke checks"],"tags":["filesystem","validation","configuration"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}