junit-team/junit5 · error · UncheckedIOException
Failed to create file system for %s
Error message
Failed to create file system for %s
What it means
UncheckedIOException thrown by CloseablePath.ManagedFileSystem when the configured FileSystemProvider.newFileSystem(jarUri) raises IOException while opening a jar filesystem. The jarUri and the original IOException are preserved. This happens during classpath scanning of jar entries (jar:...!/ URIs or file:.../*.jar paths).
Source
Thrown at junit-platform-commons/src/main/java/org/junit/platform/commons/util/CloseablePath.java:109
public void close() throws IOException {
if (closed.compareAndSet(false, true)) {
delegate.close();
}
}
private static class ManagedFileSystem {
private final AtomicInteger referenceCount = new AtomicInteger(1);
private final FileSystem fileSystem;
private final URI jarUri;
ManagedFileSystem(URI jarUri, FileSystemProvider fileSystemProvider) {
this.jarUri = jarUri;
try {
fileSystem = fileSystemProvider.newFileSystem(jarUri);
}
catch (IOException e) {
throw new UncheckedIOException("Failed to create file system for " + jarUri, e);
}
}
private ManagedFileSystem retain() {
referenceCount.incrementAndGet();
return this;
}
private @Nullable ManagedFileSystem release() {
if (referenceCount.decrementAndGet() == 0) {
close();
return null;
}
return this;
}
private void close() {
try {View on GitHub (pinned to f070c699a0)
Solutions
- Verify the reported jarUri is a valid zip: run `jar tf <file>` or `unzip -l <file>`
- Re-download or rebuild the corrupt jar
- Check filesystem permissions on the jar and its parent directories
- Remove non-jar files with .jar extension from the classpath
Defensive patterns
Strategy: try-catch
Try / catch
try {
// classpath scanning that opens jar filesystems
} catch (UncheckedIOException e) {
IOException cause = e.getCause();
// inspect cause, repair the classpath / jar
} Prevention
- Validate jar integrity in CI before running tests
- Keep test classpaths on local, reliable storage
- Audit classpath entries for non-jar files with a .jar extension
When it happens
Trigger: Scanning a jar URI (jar:file:/x.jar!/) where FileSystems.newFileSystem throws IOException - corrupt or truncated jar, unsupported env, missing permissions, or a path that ends in .jar but is not a valid zip.
Common situations: Corrupt or truncated JAR on the test classpath; scanning a jar over an unreliable network mount; permission-denied on the jar file; a non-jar file masquerading with a .jar extension.
Related errors
- Failed to close file system for ${jarUri}
- Failed to copy files to the output directory
- Failed to publish path
- Failed to create output directory
- Failed to create default temp directory
AI-assisted analysis of junit-team/junit5@f070c699a0 (2026-08-11).
Data as JSON: /api/errors/f469672e65fbf217.
Report an issue: GitHub.