{"record":{"id":"90bc98a5f99ada49","repo":"quarkusio/quarkus","slug":"value-serviceurl","errorCode":null,"errorMessage":"Value: '${serviceUrl}","messagePattern":"Value: '(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/eureka/EurekaClient.java","lineNumber":39,"sourceCode":"    private final Duration timeout;\n    private final EurekaResponseMapper eurekaResponseMapper;\n    private final RandomEurekaInstanceSelector randomEurekaInstanceSelector;\n\n    public EurekaClient(WebClient webClient, Duration timeout, EurekaResponseMapper eurekaResponseMapper,\n            RandomEurekaInstanceSelector randomEurekaInstanceSelector) {\n        this.webClient = webClient;\n        this.timeout = timeout;\n        this.eurekaResponseMapper = eurekaResponseMapper;\n        this.randomEurekaInstanceSelector = randomEurekaInstanceSelector;\n    }\n\n    public JsonObject fetchInstances(String eurekaUrl, String appId) {\n        String serviceUrl = UrlUtility.sanitize(eurekaUrl);\n        URI serviceURI;\n        try {\n            serviceURI = new URI(serviceUrl);\n        } catch (URISyntaxException e) {\n            throw new IllegalArgumentException(\"Value: '\" + serviceUrl, e);\n        }\n        log.debug(\"Attempting to discover Spring Cloud Config Server URL for service '\" + appId + \"' using URL '\" + eurekaUrl\n                + \"'\");\n        String requestURI = serviceURI.getPath() + \"/apps/\" + appId;\n        log.debug(\"Attempting to read configuration from '\" + requestURI + \"'.\");\n        Uni<JsonObject> uni = webClient\n                .get(UrlUtility.getPort(serviceURI), serviceURI.getHost(), requestURI)\n                .putHeader(\"Accept\", \"application/json\")\n                .send()\n                .map(r -> {\n                    if (r.statusCode() != 200) {\n                        throw new RuntimeException(\n                                \"Got unexpected HTTP response code \" + r.statusCode() + \" from \" + requestURI);\n                    }\n                    String bodyAsString = r.bodyAsString();\n                    log.debug(\"Received response from Spring Cloud Config Server: \"\n                            + new JsonObject(bodyAsString).encodePrettily());\n                    List<JsonObject> upInstances = eurekaResponseMapper.instances(r.bodyAsString())","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/eureka/EurekaClient.java#L21-L57","documentation":"EurekaClient.fetchInstances() sanitizes the configured Eureka URL and parses it as a URI. This IllegalArgumentException is thrown when the sanitized URL is not a valid URI; the offending value is included in the message (note the message string is left unclosed: \"Value: '<url>\").","triggerScenarios":"discover() passes quarkus.spring-cloud-config.discovery.eureka.service-url into fetchInstances; the URL lacks a scheme, contains illegal characters/spaces, or is malformed (e.g. 'localhost:8761/eureka' without http://).","commonSituations":"Forgot the http:// scheme; trailing spaces or quotes in application.properties; env var substitution produced a malformed URL; IPv6 or special characters not encoded.","solutions":["Fix the service-url to a full valid URI, e.g. http://eureka-host:8761/eureka","Check the sanitized value printed in the message for stray spaces/quotes characters","Ensure scheme and host are present; UrlUtility.sanitize only appends missing trailing slash, it does not add schemes"],"exampleFix":"# before\nquarkus.spring-cloud-config.discovery.eureka.service-url=localhost:8761/eureka\n# after\nquarkus.spring-cloud-config.discovery.eureka.service-url=http://localhost:8761/eureka","handlingStrategy":"validation","validationCode":"boolean validUrl;\ntry {\n    new URI(UrlUtility.sanitize(serviceUrl));\n    validUrl = serviceUrl.startsWith(\"http://\") || serviceUrl.startsWith(\"https://\");\n} catch (URISyntaxException e) { validUrl = false; }\n// fail fast with a clear message if !validUrl","typeGuard":null,"tryCatchPattern":"try {\n    eurekaClient.fetchInstances(eurekaUrl, appId);\n} catch (IllegalArgumentException e) {\n    log.error(\"Malformed Eureka URL: \" + e.getMessage());\n}","preventionTips":["Always include scheme http:// or https:// in service-url","Trim spaces/quotes around property values","Test the URL with new URI(...) or curl before shipping config"],"tags":["eureka","url-parsing","configuration","illegal-argument"],"backgroundTag":"invalid-url","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"}