{"record":{"id":"75789e68c10b80a7","repo":"quarkusio/quarkus","slug":"the-value-of-url-was-invalid-baseurl","errorCode":null,"errorMessage":"The value of URL was invalid ${baseUrl}","messagePattern":"The value of URL was invalid (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/RestClientBase.java","lineNumber":305,"sourceCode":"                    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(QUARKUS_CONFIG_REST_URL_FORMAT, propertyPrefix),\n                            String.format(QUARKUS_CONFIG_REST_URI_FORMAT, propertyPrefix)));\n        }\n        String baseUrl = baseUrlOptional.orElse(baseUriFromAnnotation);\n\n        try {\n            builder.baseUrl(new URL(baseUrl));\n        } catch (MalformedURLException e) {\n            if (e.getMessage().contains(\n                    \"It must be enabled by adding the --enable-url-protocols=https option to the native-image command\")) {\n                throw new IllegalArgumentException(baseUrl\n                        + \" requires SSL support but it is disabled. You probably have set quarkus.ssl.native to false.\");\n            }\n            throw new IllegalArgumentException(\"The value of URL was invalid \" + baseUrl, e);\n        }\n    }\n\n    @SafeVarargs\n    private static <T> Optional<T> oneOf(Optional<T>... optionals) {\n        for (Optional<T> o : optionals) {\n            if (o != null && o.isPresent()) {\n                return o;\n            }\n        }\n        return Optional.empty();\n    }\n\n    private static OptionalInt oneOf(OptionalInt... optionals) {\n        for (OptionalInt o : optionals) {\n            if (o != null && o.isPresent()) {\n                return o;\n            }","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/RestClientBase.java#L287-L323","documentation":"The fallback branch of configureBaseUrl(): the resolved base URL string could not be parsed by java.net.URL for any reason other than the native https case, so Quarkus wraps it in this IllegalArgumentException keeping the original MalformedURLException as cause.","triggerScenarios":"quarkus.rest-client.<key>.url/.uri or @RegisterRestClient(baseUri) contains a malformed value — missing protocol ('api.example.com'), illegal characters, spaces, an unsupported protocol, or a property that interpolated an unresolved placeholder like ${HOST}.","commonSituations":"Placeholder not expanded because the referenced property does not exist; URL copied with trailing whitespace or surrounding quotes; typo such as 'http:/host'; config value overridden by an env var containing an invalid string.","solutions":["Print/log the resolved property (quarkus.config or ConfigValue lookup) to see the actual runtime value","Fix the URL syntax — it must include the scheme, e.g. https://api.example.com","Check for unexpanded ${placeholders} in profiles and environment overrides","Trim quotes/whitespace, which .properties files may keep literally in some setups"],"exampleFix":"// before (application.properties)\nquarkus.rest-client.catalog.url=${CATALOG_HOST}/v2   # placeholder unresolved\n// after\n%prod.quarkus.rest-client.catalog.url=https://catalog.internal:8443/v2","handlingStrategy":"validation","validationCode":"// validate URL syntax before handing it to the builder\nString url = ConfigProvider.getConfig()\n    .getValue(\"quarkus.rest-client.my-client.url\", String.class).trim();\ntry {\n    new java.net.URL(url); // throws MalformedURLException early\n} catch (java.net.MalformedURLException e) {\n    throw new IllegalStateException(\"Invalid base URL for my-client: \" + url, e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include the scheme (http:// or https://) in configured URLs","Log the resolved value at startup to catch unexpanded ${placeholders}","Check profile and env-var overrides when a URL works locally but not in prod","Validate URLs in CI by rendering the effective config per profile"],"tags":["url","configuration","rest-client"],"backgroundTag":"invalid-url","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"}