{"record":{"id":"f469672e65fbf217","repo":"junit-team/junit5","slug":"failed-to-create-file-system-for-s","errorCode":null,"errorMessage":"Failed to create file system for %s","messagePattern":"Failed to create file system for (.+?)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"junit-platform-commons/src/main/java/org/junit/platform/commons/util/CloseablePath.java","lineNumber":109,"sourceCode":"\tpublic void close() throws IOException {\n\t\tif (closed.compareAndSet(false, true)) {\n\t\t\tdelegate.close();\n\t\t}\n\t}\n\n\tprivate static class ManagedFileSystem {\n\n\t\tprivate final AtomicInteger referenceCount = new AtomicInteger(1);\n\t\tprivate final FileSystem fileSystem;\n\t\tprivate final URI jarUri;\n\n\t\tManagedFileSystem(URI jarUri, FileSystemProvider fileSystemProvider) {\n\t\t\tthis.jarUri = jarUri;\n\t\t\ttry {\n\t\t\t\tfileSystem = fileSystemProvider.newFileSystem(jarUri);\n\t\t\t}\n\t\t\tcatch (IOException e) {\n\t\t\t\tthrow new UncheckedIOException(\"Failed to create file system for \" + jarUri, e);\n\t\t\t}\n\t\t}\n\n\t\tprivate ManagedFileSystem retain() {\n\t\t\treferenceCount.incrementAndGet();\n\t\t\treturn this;\n\t\t}\n\n\t\tprivate @Nullable ManagedFileSystem release() {\n\t\t\tif (referenceCount.decrementAndGet() == 0) {\n\t\t\t\tclose();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tprivate void close() {\n\t\t\ttry {","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/junit-team/junit5/blob/f070c699a08b5d8393df9afd147af5c5e90bb21b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CloseablePath.java#L91-L127","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    // classpath scanning that opens jar filesystems\n} catch (UncheckedIOException e) {\n    IOException cause = e.getCause();\n    // inspect cause, repair the classpath / jar\n}","preventionTips":["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"],"tags":["classpath-scanning","jar","io","filesystem"],"backgroundTag":null,"analyzedSha":"f070c699a08b5d8393df9afd147af5c5e90bb21b","analyzedAt":"2026-08-11T20:31:00.530Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}