{"record":{"id":"de4be6cd54969115","repo":"quarkusio/quarkus","slug":"proxyhost-must-not-be-null","errorCode":null,"errorMessage":"proxyHost must not be null","messagePattern":"proxyHost must not be null","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/QuarkusRestClientBuilder.java","lineNumber":178,"sourceCode":"    }\n\n    @Override\n    public RestClientBuilder queryParamStyle(QueryParamStyle queryParamStyle) {\n        this.queryParamStyle = queryParamStyle;\n        return this;\n    }\n\n    @Override\n    public RestClientBuilder header(final String name, final Object value) {\n        headers.add(Objects.requireNonNull(name, \"A header name is required.\"),\n                Objects.requireNonNull(value, \"Value for header is required.\"));\n        return this;\n    }\n\n    @Override\n    public RestClientBuilder proxyAddress(String host, int port) {\n        if (host == null) {\n            throw new IllegalArgumentException(\"proxyHost must not be null\");\n        }\n        if (port <= 0 || port > 65535) {\n            throw new IllegalArgumentException(\"Invalid port number\");\n        }\n        this.proxyHost = host;\n        this.proxyPort = port;\n        return this;\n    }\n\n    @Override\n    public RestClientBuilder baseUrl(URL url) {\n        try {\n            baseURI = url.toURI();\n            return this;\n        } catch (URISyntaxException e) {\n            throw new RuntimeException(e.getMessage());\n        }\n    }","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/QuarkusRestClientBuilder.java#L160-L196","documentation":"Thrown by QuarkusRestClientBuilder.proxyAddress when the host argument is null. The MicroProfile REST client builder API requires a non-null host to configure an HTTP proxy, so a null is rejected immediately with IllegalArgumentException.","triggerScenarios":"Calling builder.proxyAddress(null, port) directly; calling configureProxy programmatically from config where quarkus.rest-client.<key>.proxy-address host part is missing or parsed to null.","commonSituations":"Reading proxy host from an environment variable that is unset; misconfigured quarkus.rest-client proxy properties where only the port was given; placeholder not resolved in properties files.","solutions":["Pass a valid non-null hostname string to proxyAddress","Verify the proxy host config property (quarkus.rest-client.<config-key>.proxy-address=\"host:port\") is set and well-formed","Ensure the environment variable or system property supplying the proxy host is actually defined in the deployment environment"],"exampleFix":"// before\nString host = System.getenv(\"PROXY_HOST\");\nbuilder.proxyAddress(host, 8080); // NPE-ish: IllegalArgumentException proxyHost must not be null\n// after\nString host = System.getenv(\"PROXY_HOST\");\nif (host != null) {\n    builder.proxyAddress(host, 8080);\n}","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(proxyHost, \"proxyHost must not be null\");\nif (proxyPort <= 0 || proxyPort > 65535) throw new IllegalArgumentException(\"Invalid port number\");","typeGuard":null,"tryCatchPattern":"try {\n    builder.proxyAddress(host, port);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"proxyHost must not be null\")) {\n        log.warn(\"Proxy host not configured; skipping proxy setup\");\n    } else {\n        throw e;\n    }\n}","preventionTips":["Validate proxy host/port before calling proxyAddress","Keep quarkus.rest-client.<key>.proxy-address set to a complete host:port value","Check environment variables for the proxy host in every target environment"],"tags":["rest-client","proxy","configuration","illegal-argument"],"backgroundTag":"invalid-proxy-configuration","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}