{"record":{"id":"f470579aace9cf66","repo":"quarkusio/quarkus","slug":"specified-path-is-an-invalid-uri-path-was","errorCode":null,"errorMessage":"Specified path is an invalid URI. Path was ","messagePattern":"Specified path is an invalid URI\\. Path was ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/util/UriNormalizationUtil.java","lineNumber":52,"sourceCode":"            // replace inbound // with /\n            path = path.replaceAll(\"//\", \"/\");\n            // remove trailing slash if result shouldn't have one\n            if (!trailingSlash && path.endsWith(\"/\")) {\n                path = path.substring(0, path.length() - 1);\n            }\n\n            if (path.contains(\"..\") || path.contains(\"%\")) {\n                throw new IllegalArgumentException(\"Specified path can not contain '..' or '%'. Path was \" + path);\n            }\n            URI uri = new URI(path).normalize();\n            if (uri.getPath().equals(\"\")) {\n                return trailingSlash ? new URI(\"/\") : new URI(\"\");\n            } else if (trailingSlash && !path.endsWith(\"/\")) {\n                uri = new URI(uri.getPath() + \"/\");\n            }\n            return uri;\n        } catch (URISyntaxException e) {\n            throw new IllegalArgumentException(\"Specified path is an invalid URI. Path was \" + path, e);\n        }\n    }\n\n    /**\n     * Resolve a string path against a URI base. The specified path can not contain\n     * relative {@literal ..} segments or {@literal %} characters.\n     *\n     * Relative paths will be resolved against the specified base URI.\n     * Absolute paths will be normalized and returned.\n     * <p>\n     * Examples:\n     * <ul>\n     * <li>{@code normalizeWithBase(new URI(\"/\"), \"example\", true)}\n     * will return a URI with path {@literal /example/}</li>\n     * <li>{@code normalizeWithBase(new URI(\"/\"), \"example\", false)}\n     * will return a URI with an empty path {@literal /example}</li>\n     * <li>{@code normalizeWithBase(new URI(\"/\"), \"/example\", true)}\n     * will return a URI with path {@literal /example/}</li>","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/util/UriNormalizationUtil.java#L34-L70","documentation":"After sanitization, toURI constructs a java.net.URI from the path; if the string is not a syntactically valid URI (illegal characters such as spaces, braces, or other reserved chars), the URISyntaxException is rethrown as this IllegalArgumentException with the offending path. It guards route-root configuration from malformed values.","triggerScenarios":"Setting quarkus.http.root-path / non-application-root-path or calling UriNormalizationUtil.normalizeWithBase/segmentUri with a path containing characters illegal in a URI (space, '{', '}', '|', non-ASCII chars, etc.).","commonSituations":"Paths with spaces (\"/my app\"), unencoded special characters pasted from documentation, template placeholders or env interpolation leaving ${...} remnants in config values.","solutions":["Percent-encode or remove illegal characters, or quote the value properly: use /my-app instead of /my app.","Inspect the full error message for the exact path and fix the offending characters.","Check config sources (env vars, profiles) for unresolved placeholders like ${VAR}.","Normalize the string yourself (URI encode) before passing it to Quarkus configuration."],"exampleFix":"# before\nquarkus.http.root-path=/my app\n# after\nquarkus.http.root-path=/my-app","handlingStrategy":"validation","validationCode":"static boolean isValidUriPath(String path) {\n    try { new java.net.URI(path); return true; } catch (java.net.URISyntaxException e) { return false; }\n}","typeGuard":null,"tryCatchPattern":"try { startApp(); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Specified path is an invalid URI\")) { /* fix or percent-encode the path config */ } else throw e; }","preventionTips":["Percent-encode spaces and special characters in configured paths","Check config sources for unresolved ${...} placeholders","Prefer ASCII, hyphen-separated path segments"],"tags":["configuration","uri","malformed-input"],"backgroundTag":"invalid-uri-syntax","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"}