{"record":{"id":"006a0470d79503fe","repo":"quarkusio/quarkus","slug":"invalid-configuration-quarkus-http-static-dir-pat","errorCode":null,"errorMessage":"Invalid configuration: quarkus.http.static-dir.path must point to an existing directory, but was: <root>","messagePattern":"Invalid configuration: quarkus\\.http\\.static-dir\\.path must point to an existing directory, but was: <root>","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/VertxHttpProcessor.java","lineNumber":261,"sourceCode":"            return;\n        }\n\n        HttpStaticDirConfig localStatic = httpStaticDirConfig.get();\n\n        if (!localStatic.enabled()) {\n            return;\n        }\n\n        final String basePath = localStatic.normalizedEndpoint();\n        String dir = localStatic.normalizedPath();\n\n        if (dir == null) {\n            return;\n        }\n\n        Path root = Path.of(dir).normalize().toAbsolutePath();\n        if (!Files.isDirectory(root)) {\n            throw new IllegalStateException(\n                    \"Invalid configuration: quarkus.http.static-dir.path must point to an existing directory, but was: \"\n                            + root);\n        }\n\n        try (Stream<Path> paths = Files.walk(root)) {\n\n            paths.filter(Files::isRegularFile).forEach(file -> {\n\n                Path relative = root.relativize(file).normalize();\n                String relativeUnix = relative.toString().replace('\\\\', '/');\n                if (relativeUnix.contains(\"..\")) {\n                    throw new IllegalStateException(\"Invalid static resource path '\" + relativeUnix\n                            + \"'. Paths must not contain '..' when registering static resources.\");\n                }\n                String endpoint = basePath + \"/\" + relativeUnix;\n                generatedStaticResources.produce(\n                        new GeneratedStaticResourceBuildItem(endpoint, file));\n","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/VertxHttpProcessor.java#L243-L279","documentation":"VertxHttpProcessor.registerHttpStaticDir runs when quarkus.http.static-dir.path is set, serving files from the local filesystem as generated static resources at build time. Before walking the directory it verifies the configured value is an actual directory; if not it fails the build with IllegalStateException. This guards against typos or wrong working directories producing an empty/broken resource set.","triggerScenarios":"Setting quarkus.http.static-dir.path to a non-existent path, a file (not directory), or a path relative to a working directory different from the one the build runs in.","commonSituations":"Relative path configured that resolves differently on CI vs local; path points at a file like public/index.html instead of the directory public; path created after the build step runs (e.g. generated by another plugin).","solutions":["Fix quarkus.http.static-dir.path to point to an existing directory (the message shows the resolved absolute path 'root' — verify it matches intent)","Use an absolute path or one correct relative to the build's working directory","If the directory is generated, ensure the generating step/ordering runs before this build step or pre-create it"],"exampleFix":"// application.properties\n// before\nquarkus.http.static-dir.path=src/main/resources/static-files  # does not exist in build cwd\n// after\nquarkus.http.static-dir.path=src/main/resources/META-INF/resources/static-files","handlingStrategy":"validation","validationCode":"String dir = ConfigProvider.getConfig()\n    .getValue(\"quarkus.http.static-dir.path\", String.class);\nPath root = Path.of(dir).normalize().toAbsolutePath();\nif (!Files.isDirectory(root)) {\n    throw new IllegalStateException(\"static-dir must be an existing directory: \" + root);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify quarkus.http.static-dir.path resolves to a directory from the build's working directory, not the app runtime cwd","Use absolute paths or paths relative to src/main/resources consistently in CI and local builds","Print/inspect the resolved absolute path in the error message ('but was: ...') and compare with intent"],"tags":["quarkus","vertx-http","static-resources","configuration","build-time"],"backgroundTag":"invalid-config-path","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"}