{"record":{"id":"e5825f97710c6b3d","repo":"quarkusio/quarkus","slug":"can-t-read-jandex-index-from-tree","errorCode":null,"errorMessage":"Can't read Jandex index from ${tree}","messagePattern":"Can't read Jandex index from (.+?)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/index/IndexingUtil.java","lineNumber":77,"sourceCode":"                    try (InputStream in = Files.newInputStream(visit.getPath())) {\n                        IndexReader reader = new IndexReader(in);\n                        try {\n                            int indexVersion = reader.getIndexVersion();\n                            if (indexVersion < REQUIRED_INDEX_VERSION) {\n                                log.warnf(\"Reindexing %s, at least Jandex 3.0 must be used\"\n                                        + \" to index an application dependency (index version is %s)\",\n                                        tree.toString(), indexVersion);\n                                return null;\n                            }\n                            return reader.read();\n                        } catch (UnsupportedVersion e) {\n                            log.warnf(\"Reindexing %s, the index format is too new for the Jandex version\"\n                                    + \" used by your application. Please report it to the author of this JAR (%s)\",\n                                    tree.toString(), e.getMessage());\n                            return null;\n                        }\n                    } catch (IOException e) {\n                        throw new UncheckedIOException(\"Can't read Jandex index from \" + tree, e);\n                    }\n                }\n            });\n            if (index != null) {\n                return index;\n            }\n        }\n\n        List<Path> classFilesToIndex = new ArrayList<>();\n        tree.walk(new PathVisitor() {\n            @Override\n            public void visitPath(PathVisit visit) {\n                Path fileName = visit.getPath().getFileName();\n                if (fileName == null\n                        || !fileName.toString().endsWith(\".class\")\n                        || Files.isDirectory(visit.getPath())\n                        || removed != null && removed.contains(visit.getRelativePath(\"/\"))) {\n                    return;","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/index/IndexingUtil.java#L59-L95","documentation":"IndexingUtil's archive indexer attempts to read a pre-built Jandex index (META-INF/jandex.idx) from a JAR; an IOException reading it is thrown as UncheckedIOException \"Can't read Jandex index from <tree>\". Quarkus consumes index files produced by the jandex-maven-plugin to speed up augmentation; a broken read aborts indexing of that archive.","triggerScenarios":"apply() visiting an archive containing META-INF/jandex.idx where the idx stream cannot be read (corrupt/empty/truncated index, unreadable archive entry).","commonSituations":"Jandex index produced by an incompatible or buggy jandex-maven-plugin version; truncated JAR from interrupted download; damaged index inside a shaded/processed JAR.","solutions":["Rebuild the offending library with a current jandex-maven-plugin (or remove the plugin to let Quarkus index normally)","Delete and re-download the corrupt JAR from the local repository","Check the JAR contents: unzip -l lib.jar META-INF/jandex.idx; regenerate if missing/broken","Upgrade Quarkus/Jandex if the index format is newer than the runtime Jandex (older Jandex warns and reindexes instead)"],"exampleFix":"// before: library jar shipped stale/corrupt idx\n// after: regenerate index in the library build\nmvn org.jboss.jandex:jandex-maven-plugin:jandex -f library-pom.xml","handlingStrategy":"validation","validationCode":"try (ZipFile zf = new ZipFile(jar.toFile())) {\n    ZipEntry idx = zf.getEntry(\"META-INF/jandex.idx\");\n    if (idx != null && idx.getSize() == 0) {\n        throw new IllegalStateException(\"Empty Jandex index in \" + jar + \" — regenerate with jandex-maven-plugin\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    indexArchive(tree);\n} catch (UncheckedIOException e) {\n    if (e.getMessage().startsWith(\"Can't read Jandex index from \")) {\n        // fall back: strip META-INF/jandex.idx and let Quarkus index the archive itself\n    }\n    throw e;\n}","preventionTips":["Keep jandex-maven-plugin updated to the Jandex version Quarkus uses","Re-download any JAR flagged as unreadable instead of retrying the same bytes","Don't post-process/shade JARs in ways that corrupt META-INF entries"],"tags":["jandex","indexing","io"],"backgroundTag":"corrupt-jandex-index","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"}