quarkusio/quarkus · error · UncheckedIOException
Failed to open path tree with root %s
Error message
Failed to open path tree with root %s
What it means
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.
Source
Thrown at core/deployment/src/main/java/io/quarkus/deployment/ApplicationArchiveImpl.java:68
public ResolvedDependency getResolvedDependency() {
return resolvedDependency;
}
@Override
public <T> T apply(Function<OpenPathTree, T> func) {
if (openTree.isOpen()) {
try {
return func.apply(openTree);
} catch (Exception e) {
if (openTree.isOpen()) {
throw e;
}
}
}
try (OpenPathTree openTree = this.openTree.getOriginalTree().open()) {
return func.apply(openTree);
} catch (IOException e) {
throw new UncheckedIOException("Failed to open path tree with root " + openTree.getOriginalTree().getRoots(), e);
}
}
@Override
public void accept(Consumer<OpenPathTree> func) {
if (openTree.isOpen()) {
try {
func.accept(openTree);
return;
} catch (Exception e) {
if (openTree.isOpen()) {
throw e;
}
}
}
try (OpenPathTree openTree = this.openTree.getOriginalTree().open()) {
func.accept(openTree);
} catch (IOException e) {View on GitHub (pinned to e1c734241f)
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.
Example fix
// diagnostic
try {
archive.apply(tree -> process(tree));
} catch (UncheckedIOException e) {
// e.getMessage() lists roots; inspect them
e.getCause().printStackTrace();
}
// fix: restore/remove the missing root, e.g.
// mvn clean install -DskipTests Defensive patterns
Strategy: try-catch
Validate before calling
// verify archive roots are readable before applying
boolean rootsAccessible(ApplicationArchive archive) {
try {
archive.apply(tree -> {
tree.getRoots().forEach(root -> {
if (!java.nio.file.Files.isReadable(root)) {
throw new IllegalStateException("Unreadable archive root: " + root);
}
});
return null;
});
return true;
} catch (UncheckedIOException e) {
return false;
}
} Try / catch
try {
archive.apply(tree -> process(tree));
} catch (UncheckedIOException e) {
LOG.errorf(e.getCause(), "Archive roots unavailable: %s", e.getMessage());
// fail the build or skip the archive explicitly
throw new IllegalStateException("Fix missing/unreadable roots listed in the message, then rebuild", e);
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- class reading failed
- Failed to read %s
- Failed to read resources from classpath
- Failed to create output directory for generated sources: %s
- Dev services for ${request.getName()} requires a startable s
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/8131ec9ee1489841.
Report an issue: GitHub.