{"record":{"id":"e8d19d7949fcfadc","repo":"quarkusio/quarkus","slug":"the-value-of-url-was-invalid-baseurl-e8d19d","errorCode":null,"errorMessage":"The value of URL was invalid \" + baseUrl","messagePattern":"The value of URL was invalid \" \\+ baseUrl","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/RestClientCDIDelegateBuilder.java","lineNumber":431,"sourceCode":"    private void configureBaseUrl(QuarkusRestClientBuilder builder) {\n        Optional<String> propertyOptional = oneOf(restClientConfig.uriReload(), restClientConfig.urlReload());\n        if (((baseUriFromAnnotation == null) || baseUriFromAnnotation.isEmpty())\n                && propertyOptional.isEmpty()) {\n            String propertyPrefix = configKey != null ? configKey : \"\\\"\" + jaxrsInterface.getName() + \"\\\"\";\n            throw new IllegalArgumentException(\n                    String.format(\n                            \"Unable to determine the proper baseUrl/baseUri. \" +\n                                    \"Consider registering using @RegisterRestClient(baseUri=\\\"someuri\\\"), @RegisterRestClient(configKey=\\\"orkey\\\"), \"\n                                    +\n                                    \"or by adding '%s' or '%s' to your Quarkus configuration\",\n                            String.format(REST_URL_FORMAT, propertyPrefix), String.format(REST_URI_FORMAT, propertyPrefix)));\n        }\n        String baseUrl = propertyOptional.orElse(baseUriFromAnnotation);\n\n        try {\n            builder.baseUri(new URI(baseUrl));\n        } catch (URISyntaxException e) {\n            throw new IllegalArgumentException(\"The value of URL was invalid \" + baseUrl, e);\n        }\n    }\n\n    private void configureDomainSocket(QuarkusRestClientBuilder builder) {\n        restClientConfig.domainSocket().ifPresent(builder::domainSocket);\n    }\n\n    private void configureClientOptionsCustomizer(QuarkusRestClientBuilder builder) {\n        builder.httpClientOptionsCustomizer(new Consumer<>() {\n            @Override\n            public void accept(HttpClientOptions httpClientOptions) {\n                String metricsName = httpClientOptions.getMetricsName();\n                if (metricsName == null || metricsName.isEmpty()) {\n                    httpClientOptions.setMetricsName(\"rest-client|\" + configKey);\n                }\n            }\n        });\n    }","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/RestClientCDIDelegateBuilder.java#L413-L449","documentation":"Thrown by RestClientCDIDelegateBuilder.configureBaseUrl when the resolved base URL (from configuration or the annotation) is not a syntactically valid URI: new URI(baseUrl) throws URISyntaxException, which Quarkus wraps in an IllegalArgumentException including the offending value. The client cannot be constructed with an unparseable base URI.","triggerScenarios":"quarkus.rest-client.<key>.url or .uri (or @RegisterRestClient(baseUri=...)) contains a value that fails URI parsing — e.g. missing scheme, illegal characters (unescaped spaces, '{', '|', non-ASCII), or a malformed string like 'http:/host' or leftover property placeholder '${HOST}' that was not resolved.","commonSituations":"SmallRye config property substitution failed and the literal '${services.host}' was passed through; URL copied with a trailing space or contains unescaped space in path; scheme typo like 'htp://'; IPv6 host without brackets; environment-specific value empty after expansion leaving 'http://:8080'.","solutions":["Print/inspect the resolved value (quarkus rest-client config at startup or dev mode config editor) and fix the syntax: ensure scheme://host[:port][/path] with proper encoding","Encode or escape special characters (spaces -> %20), wrap IPv6 hosts in brackets, or URL-encode path segments","Fix unresolved property placeholders — verify the referenced config property actually exists and is expanded at runtime","Validate locally with new URI(value) in a test or jshell to pinpoint the offending character","If the value comes from an env var, check it is actually set and correctly formatted in the deployment environment"],"exampleFix":"// before (application.properties)\nquarkus.rest-client.myservice.url=http://${unresolved.host}:8080/api v1\n// after\nquarkus.rest-client.myservice.url=http://services.internal:8080/api%20v1","handlingStrategy":"validation","validationCode":"String url = org.eclipse.microprofile.config.ConfigProvider.getConfig()\n    .getValue(\"quarkus.rest-client.myservice.url\", String.class);\ntry {\n    new java.net.URI(url);\n} catch (java.net.URISyntaxException e) {\n    throw new IllegalStateException(\"Configured rest-client URL is not a valid URI: \" + url, e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    MyClient client = Arc.container().instance(MyClient.class).get();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"The value of URL was invalid\")) {\n        throw new ConfigurationException(\"Fix the base URL syntax: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Validate URL config values with new URI(...) in a startup test","Avoid unencoded spaces/special characters in configured URLs; URL-encode paths","Ensure config placeholders (${...}) reference existing properties so they resolve before use","Standardize on scheme://host:port/path format in all environments"],"tags":["rest-client","uri","configuration","url-validation","microprofile"],"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-12T22:17:10.623Z"}