{"record":{"id":"8ad837e0feeaba41","repo":"quarkusio/quarkus","slug":"invalid-proxy-string-expected-hostname-port","errorCode":null,"errorMessage":"Invalid proxy string. Expected <hostname>:<port>, found '${proxy}'","messagePattern":"Invalid proxy string\\. Expected <hostname>:<port>, found '(.+?)'","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/ProxyAddressUtil.java","lineNumber":9,"sourceCode":"package io.quarkus.rest.client.reactive.runtime;\n\npublic class ProxyAddressUtil {\n\n    public static HostAndPort parseAddress(String proxyString) {\n        int lastColonIndex = proxyString.lastIndexOf(':');\n\n        if (lastColonIndex <= 0 || lastColonIndex == proxyString.length() - 1) {\n            throw new RuntimeException(\"Invalid proxy string. Expected <hostname>:<port>, found '\" + proxyString + \"'\");\n        }\n\n        String host = proxyString.substring(0, lastColonIndex);\n        int port;\n        try {\n            port = Integer.parseInt(proxyString.substring(lastColonIndex + 1));\n        } catch (NumberFormatException e) {\n            throw new RuntimeException(\"Invalid proxy setting. The port is not a number in '\" + proxyString + \"'\", e);\n        }\n        return new HostAndPort(host, port);\n    }\n\n    @SuppressWarnings(\"ClassCanBeRecord\") // don't convert to record because we have code that accesses the public field\n    public static class HostAndPort {\n        public final String host;\n        public final int port;\n\n        public HostAndPort(String host, int port) {","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/ProxyAddressUtil.java#L1-L27","documentation":"ProxyAddressUtil.parseAddress splits a proxy string on the last ':' expecting the format <hostname>:<port>. This error is thrown when there is no colon (or the colon is the first/last character), so no valid host and port can be extracted. The library throws RuntimeException because the proxy address comes from user configuration and is unusable.","triggerScenarios":"Calling QuarkusRestClientBuilder.proxyAddress(String, int) alternatives / config properties (quarkus.rest-client.<name>.proxy-address-mapping or proxy-address) with a string lacking a colon, e.g. \"localhost\", \":8080\", or \"localhost:\".","commonSituations":"Configured only the host without the port; copied a proxy URL including scheme (http://proxy:8080 handled differently) or trailing colon; env-based proxy value empty or malformed.","solutions":["Provide the proxy as host:port, e.g. proxy.corp.com:8080","Remove the trailing colon or add the missing port","Validate the string before assigning it to the config property"],"exampleFix":"# before\nquarkus.rest-client.svc.proxy-address=proxy.corp.com\n# after\nquarkus.rest-client.svc.proxy-address=proxy.corp.com:8080","handlingStrategy":"validation","validationCode":"static boolean isValidProxyString(String s) {\n    if (s == null) return false;\n    int i = s.lastIndexOf(':');\n    return i > 0 && i < s.length() - 1;\n}","typeGuard":"static boolean isHostPort(String s) {\n    int i = s == null ? -1 : s.lastIndexOf(':');\n    if (i <= 0 || i == s.length() - 1) return false;\n    try { Integer.parseInt(s.substring(i + 1)); return true; } catch (NumberFormatException e) { return false; }\n}","tryCatchPattern":"try {\n    ProxyAddressUtil.parseAddress(proxy);\n} catch (RuntimeException e) {\n    throw new IllegalArgumentException(\"Proxy must be host:port, got: \" + proxy, e);\n}","preventionTips":["Always specify proxy as host:port in config","Never paste full proxy URLs (with scheme/credentials) into host:port properties","Add a startup check that parses proxy config once and fails fast"],"tags":["rest-client","proxy","configuration"],"backgroundTag":"invalid-proxy-address","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"}