{"record":{"id":"8131ec9ee1489841","repo":"quarkusio/quarkus","slug":"failed-to-open-path-tree-with-root-s","errorCode":null,"errorMessage":"Failed to open path tree with root %s","messagePattern":"Failed to open path tree with root (.+?)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/ApplicationArchiveImpl.java","lineNumber":68,"sourceCode":"    public ResolvedDependency getResolvedDependency() {\n        return resolvedDependency;\n    }\n\n    @Override\n    public <T> T apply(Function<OpenPathTree, T> func) {\n        if (openTree.isOpen()) {\n            try {\n                return func.apply(openTree);\n            } catch (Exception e) {\n                if (openTree.isOpen()) {\n                    throw e;\n                }\n            }\n        }\n        try (OpenPathTree openTree = this.openTree.getOriginalTree().open()) {\n            return func.apply(openTree);\n        } catch (IOException e) {\n            throw new UncheckedIOException(\"Failed to open path tree with root \" + openTree.getOriginalTree().getRoots(), e);\n        }\n    }\n\n    @Override\n    public void accept(Consumer<OpenPathTree> func) {\n        if (openTree.isOpen()) {\n            try {\n                func.accept(openTree);\n                return;\n            } catch (Exception e) {\n                if (openTree.isOpen()) {\n                    throw e;\n                }\n            }\n        }\n        try (OpenPathTree openTree = this.openTree.getOriginalTree().open()) {\n            func.accept(openTree);\n        } catch (IOException e) {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/ApplicationArchiveImpl.java#L50-L86","documentation":"ApplicationArchiveImpl.apply(Consumer/OpenPathTree function) lazily opens the archive's PathTree to apply the given function. If opening the underlying path tree throws an IOException, it is wrapped in an UncheckedIOException with this message including the archive roots. It typically indicates the archive's root paths (directories/jars) could not be opened — e.g. deleted or unreadable files — while scanning application archives during build.","triggerScenarios":"Calling apply(...) on an ApplicationArchiveImpl whose backing PathTree.open() fails with IOException because the root directory/JAR no longer exists, was deleted during the build, or is unreadable due to file permissions.","commonSituations":"Incremental builds where a target/classes directory or dependency JAR was removed mid-build; read-only or permission-restricted filesystems (containers running as non-root); antivirus or sync tools (Dropbox/OneDrive) locking files; full disks preventing file access.","solutions":["Check the wrapped IOException cause and the printed roots; verify each root path still exists and is readable.","Run a clean build (mvn clean) to remove stale references to deleted output directories or JARs.","Fix filesystem permissions or free disk space so the paths can be opened.","Exclude the workspace directory from file-sync/antivirus tools that delete or lock files during builds."],"exampleFix":"// diagnostic\ntry {\n    archive.apply(tree -> process(tree));\n} catch (UncheckedIOException e) {\n    // e.getMessage() lists roots; inspect them\n    e.getCause().printStackTrace();\n}\n// fix: restore/remove the missing root, e.g.\n// mvn clean install -DskipTests","handlingStrategy":"try-catch","validationCode":"// verify archive roots are readable before applying\nboolean rootsAccessible(ApplicationArchive archive) {\n    try {\n        archive.apply(tree -> {\n            tree.getRoots().forEach(root -> {\n                if (!java.nio.file.Files.isReadable(root)) {\n                    throw new IllegalStateException(\"Unreadable archive root: \" + root);\n                }\n            });\n            return null;\n        });\n        return true;\n    } catch (UncheckedIOException e) {\n        return false;\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    archive.apply(tree -> process(tree));\n} catch (UncheckedIOException e) {\n    LOG.errorf(e.getCause(), \"Archive roots unavailable: %s\", e.getMessage());\n    // fail the build or skip the archive explicitly\n    throw new IllegalStateException(\"Fix missing/unreadable roots listed in the message, then rebuild\", e);\n}","preventionTips":["Avoid deleting target/ or dependency JARs while a build is running","Ensure build runs with read access to all workspace and repository paths","Exclude project directories from antivirus/sync tools","Run mvn clean to purge stale archive references after moving files"],"tags":["quarkus","io","path-tree","build-time"],"backgroundTag":"path-tree-open-ioexception","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}