{"record":{"id":"e8c8f0e582f508dd","repo":"quarkusio/quarkus","slug":"failed-to-read-e8c8f0","errorCode":null,"errorMessage":"Failed to read ","messagePattern":"Failed to read ","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/SharedArchivePathTree.java","lineNumber":67,"sourceCode":"    private volatile SharedOpenArchivePathTree lastOpen;\n\n    SharedArchivePathTree(Path archive) {\n        super(archive);\n    }\n\n    @Override\n    public OpenPathTree open() {\n        var lastOpen = this.lastOpen;\n        if (lastOpen != null) {\n            var acquired = lastOpen.acquire();\n            if (acquired != null) {\n                return acquired;\n            }\n        }\n        try {\n            lastOpen = this.lastOpen = new SharedOpenArchivePathTree(openFs());\n        } catch (Exception e) {\n            throw new RuntimeException(\"Failed to read \" + archive, e);\n        }\n        return new CallerOpenPathTree(lastOpen);\n    }\n\n    private class SharedOpenArchivePathTree extends OpenArchivePathTree {\n\n        private final AtomicInteger users = new AtomicInteger(1);\n\n        protected SharedOpenArchivePathTree(ReadOnlyZipFileSystem fs) {\n            super(fs);\n            openCount.incrementAndGet();\n        }\n\n        /**\n         * Returns a new handle for this open archive tree to the caller\n         * as long as this open archive tree is still open and is still\n         * the last one that was open for this archive. Otherwise, the method\n         * will return null.","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/SharedArchivePathTree.java#L49-L85","documentation":"SharedArchivePathTree.open() opens the archive filesystem (e.g. zip/jar via openFs()) and wraps any exception in a RuntimeException 'Failed to read <archive>'. It means the jar/zip backing the path tree could not be opened, typically because the file is missing, corrupt, or not a valid archive.","triggerScenarios":"Calling open() on a SharedArchivePathTree for an archive whose file does not exist, is corrupt/truncated, lacks read permission, or is a multi-release/zip structure the FS provider rejects.","commonSituations":"Corrupted jar in local Maven repo after interrupted download; partially-written application jar during hot deployment; classpath entry pointing at a deleted or locked file (Windows file locking).","solutions":["Verify the archive exists and is a valid zip: unzip -t archive.jar; re-download/rebuild it (mvn -U, mvn clean install)","Check file read permissions and that no other process holds it locked","Rebuild the application so the jar is regenerated","Look at the cause (e) for the precise zip error"],"exampleFix":"// before\nmvn package\n// after\nmvn clean package -U   # rebuild and force re-download of possibly corrupt deps","handlingStrategy":"validation","validationCode":"Path jar = Path.of(archive);\nif (!Files.isRegularFile(jar) || !Files.isReadable(jar)) throw new IllegalStateException(\"Missing archive: \" + jar);\ntry (ZipFile zf = new ZipFile(jar.toFile())) { } catch (IOException e) { throw new IllegalStateException(\"Corrupt archive: \" + jar, e); }","typeGuard":"boolean isOpenableArchive(Path p) { try { return Files.isRegularFile(p) && new ZipFile(p.toFile()).size() > 0; } catch (IOException e) { return false; } }","tryCatchPattern":"try { tree = sharedTree.open(); } catch (RuntimeException e) { log.error(\"Archive unreadable: \" + e.getCause()); rebuildOrReDownloadArchive(); }","preventionTips":["Verify archives with unzip -t after downloads","Use -U/clean builds to fix corrupt repo jars","Check file locks/permissions especially on Windows"],"tags":["jar","zip","classpath","io"],"backgroundTag":"archive-open-failed","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"}