{"record":{"id":"e7f01c2c83af363e","repo":"quarkusio/quarkus","slug":"invalid-rest-client-url-used-uri","errorCode":null,"errorMessage":"Invalid REST Client URL used: '<uri>'","messagePattern":"Invalid REST Client URL used: '<uri>'","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/StorkClientRequestFilter.java","lineNumber":48,"sourceCode":"            stork = Stork.getInstance();\n\n            if (stork == null) {\n                throw new IllegalStateException(\n                        \"Trying to use a StorkClientRequestFilter but the quarkus-smallrye-stork extension is missing, please add the extension.\");\n            }\n        } catch (Exception e) {\n            throw new IllegalStateException(\n                    \"Trying to use a StorkClientRequestFilter but the quarkus-smallrye-stork extension is missing, please add the extension.\");\n        }\n    }\n\n    @Override\n    public void filter(ResteasyReactiveClientRequestContext requestContext) {\n        URI uri = requestContext.getUri();\n        if (uri != null && uri.getScheme() != null && uri.getScheme().startsWith(Stork.STORK)) {\n            String serviceName = uri.getHost();\n            if (serviceName == null) { // invalid URI\n                throw new IllegalArgumentException(\"Invalid REST Client URL used: '\" + uri + \"'\");\n            }\n\n            requestContext.suspend();\n            boolean measureTime = shouldMeasureTime(requestContext.getResponseType());\n            try {\n                stork.getService(serviceName)\n                        .selectInstanceAndRecordStart(measureTime)\n                        .subscribe()\n                        .with(instance -> {\n                            boolean isHttps = instance.isSecure() || \"storks\".equals(uri.getScheme());\n                            String scheme = isHttps ? \"https\" : \"http\";\n                            try {\n                                // In the case the service instance does not set the host and/or port\n                                String host = instance.getHost() == null ? \"localhost\" : instance.getHost();\n                                int port = instance.getPort();\n                                if (instance.getPort() == 0) {\n                                    if (isHttps) {\n                                        port = 433;","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/StorkClientRequestFilter.java#L30-L66","documentation":"StorkClientRequestFilter.filter resolves the service name from the host of a stork:// URI and throws this IllegalArgumentException when the URI has the stork scheme but no host, i.e. it is malformed and no service name can be extracted.","triggerScenarios":"Configuring a client URI like stork:// (empty host), stork:///service (empty host per URI parsing), a typo such as 'stork:/svc', or building a stork URI programmatically with URI.create where the authority was dropped.","commonSituations":"Property typos in quarkus.rest-client.<key>.uri; double slashes lost when templating; URI produced by string concatenation where the service name variable was empty.","solutions":["Set the URI to the full form stork://<service-name> with a non-empty host","Log/print requestContext.getUri() to see the parsed URI and fix the authority portion","Validate the configured URI at startup (assert URI.create(uri).getHost() != null for stork scheme)"],"exampleFix":"// before\nquarkus.rest-client.my-client.uri=stork://\n// after\nquarkus.rest-client.my-client.uri=stork://my-service","handlingStrategy":"validation","validationCode":"URI uri = URI.create(clientUri);\nif (uri.getScheme() != null && uri.getScheme().startsWith(\"stork\")\n        && uri.getHost() == null) {\n    throw new IllegalArgumentException(\"stork URI must include a service name host, e.g. stork://my-service (got: \" + clientUri + \")\");\n}","typeGuard":"boolean isValidStorkUri(String uri) {\n    URI u = URI.create(uri);\n    return u.getScheme() != null && u.getScheme().startsWith(\"stork\") && u.getHost() != null && !u.getHost().isBlank();\n}","tryCatchPattern":"try {\n    webTarget = client.target(clientUri);\n    response = webTarget.request().get();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Invalid REST Client URL used\")) {\n        log.error(\"Fix the stork:// URI to include a service name\");\n    } else throw e;\n}","preventionTips":["Validate stork:// configuration URIs at startup (host must be non-empty)","Use the form stork://<service-name> exactly; avoid trailing slashes or empty authorities","Log the parsed URI when debugging service discovery"],"tags":["stork","rest-client-reactive","illegal-argument","uri","configuration"],"backgroundTag":"invalid-service-uri","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"}