{"record":{"id":"8f906fd20b2eeb56","repo":"quarkusio/quarkus","slug":"failed-to-walk-directory","errorCode":null,"errorMessage":"Failed to walk directory ","messagePattern":"Failed to walk directory ","errorType":"exception","errorClass":"java.io.UncheckedIOException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/PathTreeVisit.java","lineNumber":69,"sourceCode":"        return fs.getSeparator().equals(\"/\") ? resourceName : resourceName.replace(\"/\", fs.getSeparator());\n    }\n\n    static void walk(Path root, Path rootDir, Path walkDir, PathFilter pathFilter, Map<String, String> multiReleaseMapping,\n            PathVisitor visitor) {\n        final PathTreeVisit visit = new PathTreeVisit(root, rootDir, pathFilter, multiReleaseMapping);\n        try (Stream<Path> files = Files.walk(walkDir)) {\n            final Iterator<Path> i = files.iterator();\n            while (i.hasNext()) {\n                if (!visit.setCurrent(i.next())) {\n                    continue;\n                }\n                visitor.visitPath(visit);\n                if (visit.isStopWalking()) {\n                    break;\n                }\n            }\n        } catch (IOException e) {\n            throw new UncheckedIOException(\"Failed to walk directory \" + root, e);\n        }\n        visit.visitMultiReleasePaths(visitor);\n    }\n\n    static <T> T process(Path root, Path rootDir, Path path, PathFilter pathFilter, Function<PathVisit, T> func) {\n        final PathTreeVisit visit = new PathTreeVisit(root, rootDir, pathFilter, Map.of());\n        if (visit.setCurrent(path)) {\n            return func.apply(visit);\n        }\n        return func.apply(null);\n    }\n\n    static void consume(Path root, Path rootDir, Path path, PathFilter pathFilter, Consumer<PathVisit> func) {\n        final PathTreeVisit visit = new PathTreeVisit(root, rootDir, pathFilter, Map.of());\n        if (visit.setCurrent(path)) {\n            func.accept(visit);\n        } else {\n            func.accept(null);","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/PathTreeVisit.java#L51-L87","documentation":"walkInformationForPath wraps IOExceptions from Files.walkFileTree (directory traversal) into an UncheckedIOException. It means the underlying directory could not be read while walking a filesystem-backed path tree, e.g. permissions or the directory disappearing mid-scan.","triggerScenarios":"Calling walk/visit on a directory-backed PathTree (e.g. classes directory) when Files.walkFileTree throws IOException: unreadable subdirectory (permissions), deleted/renamed directory during build, symlink loops, or I/O errors.","commonSituations":"Running in containers where the classes dir is mounted read-only or removed; IDE/build tool deleting output directory during a live-reload scan; OS-level permission issues after extraction.","solutions":["Check the directory exists and is readable (ls/permissions) and recreate it (e.g. re-run build)","Re-run the application build so the classes directory is regenerated","Check for concurrent processes (IDE, another build) mutating the directory; avoid scanning while builds run","Inspect the cause chain (getCause) for the underlying IOException message"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Path dir = Path.of(root);\nif (!Files.isDirectory(dir) || !Files.isReadable(dir)) { throw new IllegalStateException(\"Cannot walk: \" + dir); }","typeGuard":"boolean isWalkableDir(Path p) { return Files.isDirectory(p) && Files.isReadable(p); }","tryCatchPattern":"try { walkInformationForPath(...); } catch (UncheckedIOException e) { log.error(\"Directory walk failed: \" + e.getCause()); throw e; }","preventionTips":["Ensure class/output directories exist and are readable before scanning","Avoid scanning directories while builds/IDEs are mutating them","Run containers with correct volume permissions"],"tags":["io","filesystem","classpath"],"backgroundTag":"ioexception-directory-walk","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}