{"record":{"id":"b676c074088a5bf2","repo":"quarkusio/quarkus","slug":"unable-to-get-listed-resource-i-from-directory","errorCode":null,"errorMessage":"Unable to get listed resource ${i} from directory ${path} for path ${slashPath} from underlying manager ${underlying}","messagePattern":"Unable to get listed resource (.+?) from directory (.+?) for path (.+?) from underlying manager (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/undertow/runtime/src/main/java/io/quarkus/undertow/runtime/KnownPathResourceManager.java","lineNumber":149,"sourceCode":"            SortedSet<String> fileSet = files.tailSet(slashPath);\n            SortedSet<String> dirSet = directories.tailSet(slashPath);\n\n            for (var s : List.of(fileSet, dirSet)) {\n                for (String file : s) {\n                    var i = file;\n                    if (i.equals(slashPath)) {\n                        continue;\n                    }\n                    if (i.startsWith(slashPath)) {\n                        i = evaluatePath(i);\n                        if (!i.substring(slashPath.length()).contains(\"/\")) {\n                            try {\n                                Resource resource = underlying.getResource(i);\n                                if (resource == null && directories.contains(file)) {\n                                    resource = new DirectoryResource(file);\n                                }\n                                if (resource == null) {\n                                    throw new RuntimeException(\"Unable to get listed resource \" + i + \" from directory \" + path\n                                            + \" for path \" + slashPath + \" from underlying manager \" + underlying);\n                                }\n                                ret.add(resource);\n                            } catch (IOException e) {\n                                throw new UncheckedIOException(e);\n                            }\n                        }\n                    } else {\n                        break;\n                    }\n                }\n            }\n\n            return ret;\n        }\n\n        @Override\n        public String getContentType(MimeMappings mimeMappings) {","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/undertow/runtime/src/main/java/io/quarkus/undertow/runtime/KnownPathResourceManager.java#L131-L167","documentation":"KnownPathResourceManager only serves a pre-computed list of known resources, but during directory listing the underlying resource manager returned null for an entry that is not a known directory. This is an internal consistency failure: the underlying manager advertised a path in a listing it cannot resolve back to a Resource.","triggerScenarios":"Calling getResource on a path returned by the underlying manager's list() that the manager cannot resolve; races where files are deleted between list and getResource; mismatched underlying manager behavior inside a Quarkus static-resource setup.","commonSituations":"Static resources removed/renamed while the app runs (dev-mode hot reload); custom resource managers layered with KnownPathResourceManager; filesystem case-sensitivity differences (macOS vs Linux containers).","solutions":["Rebuild/restart the application so the known-path index matches the filesystem","Ensure all static resources still exist at build-time paths in the deployed artifact","If layering custom ResourceManagers, make sure getResource resolves every path your list() returns","Report upstream if reproducible on a plain Quarkus app — this should not happen normally"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check the static resources referenced actually exist in the artifact\nassertTrue(Paths.get(\"target/classes/META-INF/resources\").toFile().list().length > 0);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't delete static files at runtime in dev mode","Test static-resource routes after hot reloads","Avoid custom ResourceManager layers unless getResource covers all listed paths"],"tags":["quarkus","static-resources","filesystem","undertow"],"backgroundTag":"resource-not-resolvable","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"}