{"record":{"id":"81acd9995e28bf60","repo":"quarkusio/quarkus","slug":"unable-to-read-the-template-content-from-path-pa","errorCode":null,"errorMessage":"Unable to read the template content from path: <path>","messagePattern":"Unable to read the template content from path: <path>","errorType":"exception","errorClass":"java.io.UncheckedIOException","httpStatus":null,"severity":"error","filePath":"extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java","lineNumber":3867,"sourceCode":"        return templatePaths;\n    }\n\n    private IllegalStateException newDuplicateError(Map<String, List<TemplatePathBuildItem>> groupedByPath) {\n        StringBuilder builder = new StringBuilder(\"Duplicate templates found:\");\n        for (Entry<String, List<TemplatePathBuildItem>> e : groupedByPath.entrySet()) {\n            builder.append(\"\\n\\t- \")\n                    .append(e.getKey())\n                    .append(\": \")\n                    .append(e.getValue().stream().map(TemplatePathBuildItem::getSourceInfo).collect(Collectors.toList()));\n        }\n        return new IllegalStateException(builder.toString());\n    }\n\n    static String readTemplateContent(Path path, Charset defaultCharset) {\n        try {\n            return Files.readString(path, defaultCharset);\n        } catch (IOException e) {\n            throw new UncheckedIOException(\"Unable to read the template content from path: \" + path, e);\n        }\n    }\n\n    /**\n     * Java members lookup config.\n     *\n     * @see QuteProcessor#findProperty(String, ClassInfo, JavaMemberLookupConfig)\n     * @see QuteProcessor#findMethod(VirtualMethodPart, ClassInfo, Expression, IndexView, Function, Map, JavaMemberLookupConfig)\n     */\n    interface JavaMemberLookupConfig {\n\n        IndexView index();\n\n        Predicate<AnnotationTarget> filter();\n\n        boolean declaredMembersOnly();\n\n        default void nextPart() {","sourceCodeStart":3849,"sourceCodeEnd":3885,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java#L3849-L3885","documentation":"Wrapped as UncheckedIOException when Qute cannot read the template file at the given path via Files.readString. The path exists logically in the build (e.g. referenced by @TemplateContents from path or a template file discovered during the build) but cannot be opened/read with the configured charset, typically because it does not exist on disk or an I/O error occurs.","triggerScenarios":"A template path referenced from an annotation or config does not exist under src/main/resources; wrong defaultCharset causing read failure is unlikely — the usual cause is IOException: missing file, unreadable file permissions, or a path with wrong casing on case-sensitive filesystems.","commonSituations":"Typo in the template path or extension (.html vs .txt); file deleted or renamed while still referenced; CI checkout case sensitivity differences (Windows-authored path casing); resource filtering/exclusion removing templates from the build.","solutions":["Verify the file exists at the exact path (case-sensitive) under src/main/resources and fix the path/reference","Check file permissions and that the file is included by the build (not excluded by resource filters or .gitignore)","Rebuild/clean the project if the resources were not copied to target/classes","Ensure the configured charset (quarkus.qute.default-charset) matches the file encoding"],"exampleFix":"// before\n@Location(\"emails/welcom.html\") // typo: file is welcome.html\nTemplate welcome;\n\n// after\n@Location(\"emails/welcome.html\")\nTemplate welcome;","handlingStrategy":"validation","validationCode":"// Verify the template path exists before referencing it\nPath p = Path.of(\"src/main/resources\", \"templates/emails/welcome.html\");\nif (!Files.isRegularFile(p)) {\n    throw new IllegalStateException(\"Template missing: \" + p);\n}","typeGuard":null,"tryCatchPattern":"try {\n    String content = Files.readString(path, charset);\n} catch (IOException e) {\n    throw new UncheckedIOException(\"Unable to read template at \" + path, e);\n}","preventionTips":["Keep @Location paths in sync with the actual resource tree","Watch file-name casing (case-sensitive Linux CI vs Windows dev)","Ensure templates are under src/main/resources and not excluded by build filters","Run a clean build if resources appear stale in target/classes"],"tags":["quarkus","qute","io","missing-file","template-path"],"backgroundTag":"file-not-found","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"}