{"record":{"id":"79fb0b586b0949d9","repo":"quarkusio/quarkus","slug":"invalid-proxy-setting-the-port-is-not-a-number-in","errorCode":null,"errorMessage":"Invalid proxy setting. The port is not a number in '${proxy}'","messagePattern":"Invalid proxy setting\\. The port is not a number in '(.+?)'","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":17,"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) {\n            this.host = host;\n            this.port = port;\n        }\n\n        public String host() {\n            return host;\n        }\n","sourceCodeStart":1,"sourceCodeEnd":35,"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-L35","documentation":"After finding the last ':' in the proxy string, parseAddress parses the remainder as an integer port. If that substring is not numeric, the NumberFormatException is wrapped in this RuntimeException. It means the proxy host part parsed fine but the port segment is not a number.","triggerScenarios":"Passing a proxy string whose port segment is non-numeric or contains extra characters, e.g. \"proxy:8080x\", \"proxy:http\", or an IPv6 string where the last colon splits on the wrong segment.","commonSituations":"Typo in the port in application.properties; pasting a full proxy URL with scheme/credentials (http://user:pass@proxy:8080) into a host:port property; using raw IPv6 addresses (2001:db8::1) which the host:port format does not support.","solutions":["Correct the port to a numeric value, e.g. proxy:8080","Strip scheme/credentials if a full URL was pasted, keeping only host:port","For IPv6, wrap the host in brackets first (e.g. [2001:db8::1]:8080) only if supported, otherwise use a hostname"],"exampleFix":"# before\nquarkus.rest-client.svc.proxy-address=proxy:http\n# after\nquarkus.rest-client.svc.proxy-address=proxy:8080","handlingStrategy":"validation","validationCode":"static boolean hasNumericPort(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}","typeGuard":"static boolean isParsablePort(String seg) {\n    try { int p = Integer.parseInt(seg); return p > 0 && p <= 65535; } catch (NumberFormatException e) { return false; }\n}","tryCatchPattern":"try {\n    ProxyAddressUtil.parseAddress(proxy);\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof NumberFormatException) {\n        throw new IllegalArgumentException(\"Proxy port segment is not numeric: \" + proxy, e);\n    }\n    throw e;\n}","preventionTips":["Verify the port segment after the last colon is digits only","Strip scheme and credentials before storing proxy config","Avoid raw IPv6 literals in host:port settings"],"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"}