{"record":{"id":"4ea7e3609db5c506","repo":"quarkusio/quarkus","slug":"failed-to-list-matching-files-in-importpath","errorCode":null,"errorMessage":"Failed to list matching files in ${importPath}","messagePattern":"Failed to list matching files in (.+?)","errorType":"exception","errorClass":"CodeGenException","httpStatus":null,"severity":"error","filePath":"extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroCodeGenProviderBase.java","lineNumber":94,"sourceCode":"        }\n\n        return filesGenerated;\n    }\n\n    abstract void init();\n\n    private Collection<Path> gatherAllFiles(Path importPath) throws CodeGenException {\n        if (!Files.exists(importPath)) {\n            return Collections.emptySet();\n        }\n        try {\n            return Files.find(importPath, 20,\n                    (path, ignored) -> Files.isRegularFile(path)\n                            && Arrays.stream(inputExtensions()).anyMatch(ext -> path.toString().endsWith(\".\" + ext)))\n                    .map(Path::toAbsolutePath)\n                    .collect(Collectors.toList());\n        } catch (IOException e) {\n            throw new CodeGenException(\"Failed to list matching files in \" + importPath, e);\n        }\n    }\n\n    abstract void compileSingleFile(Path importPath, Path outputDir, AvroOptions options) throws CodeGenException;\n\n    public class AvroOptions {\n\n        private final Config config;\n\n        /**\n         * A list of files or directories that should be compiled first thus making them\n         * importable by subsequently compiled schemas. Note that imported files should\n         * not reference each other.\n         * <p>\n         * All paths should be relative to the src/[main|test]/avro directory\n         * <p>\n         * Passed as a comma-separated list.\n         */","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroCodeGenProviderBase.java#L76-L112","documentation":"AvroCodeGenProviderBase.gatherAllFiles walks the import path with Files.find to collect Avro input files; if the filesystem walk throws IOException the method wraps it in a CodeGenException with this message. This occurs during Quarkus code generation when the .avsc/.avdl/.avpr source directory cannot be scanned.","triggerScenarios":"Code generation triggering over an importPath that is unreadable — nonexistent directory, permission problem, or I/O error while traversing (e.g. broken symlink, stale path during incremental builds).","commonSituations":"Configured avro codegen import directory missing or renamed; running build in a container without read permissions on the source dir; generated/symlinked directories removed between build phases.","solutions":["Verify the Avro source directory exists and is readable relative to the module (e.g. src/main/avro)","Fix filesystem permissions or remove broken symlinks under the import path","Clean the build and regenerate so stale paths are refreshed","Check quarkus avro codegen configuration for a wrong import path value"],"exampleFix":"// before\nquarkus.generate.codegen.avro.import-path=src/main/schema // dir does not exist\n// after\nmkdir -p src/main/avro && put *.avsc there\nquarkus.generate.codegen.avro.import-path=src/main/avro","handlingStrategy":"try-catch","validationCode":"Path importPath = Paths.get(\"src/main/avro\");\nif (!Files.isDirectory(importPath) || !Files.isReadable(importPath)) {\n    throw new IllegalStateException(\"Avro import path missing or unreadable: \" + importPath);\n}","typeGuard":null,"tryCatchPattern":"try {\n    List<Path> files = provider.trigger(context);\n} catch (CodeGenException e) {\n    logger.error(\"Check the Avro import directory exists and is readable\", e);\n}","preventionTips":["Commit the Avro source directory with at least a placeholder so paths always exist","Avoid symlinks to ephemeral locations in codegen source dirs","Verify directory permissions in CI containers","Keep codegen import-path configuration in sync with actual project layout"],"tags":["quarkus","avro","codegen","io","filesystem"],"backgroundTag":"io-exception-during-codegen","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"}