{"record":{"id":"3b7b7ba46c1d0a37","repo":"quarkusio/quarkus","slug":"if-prefix-host-is-not-set-then-all-of-badva","errorCode":null,"errorMessage":"If ${prefix}.host is not set, then all of [${badValues}] must not be set either","messagePattern":"If (.+?)\\.host is not set, then all of \\[(.+?)\\] must not be set either","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/proxy-registry/runtime/src/main/java/io/quarkus/proxy/runtime/ProxyConfigurationRecorder.java","lineNumber":78,"sourceCode":"                badValues.add(\"port\");\n            }\n            if (config.credentialsProvider().name().isPresent()) {\n                badValues.add(\"credentials-provider\");\n            }\n            if (config.username().isPresent()) {\n                badValues.add(\"username\");\n            }\n            if (config.password().isPresent()) {\n                badValues.add(\"password\");\n            }\n            if (config.nonProxyHosts().isPresent()) {\n                badValues.add(\"non-proxy-hosts\");\n            }\n            if (config.proxyConnectTimeout().isPresent()) {\n                badValues.add(\"proxy-connect-timeout\");\n            }\n            if (badValues.length() > 0) {\n                throw new IllegalStateException(\n                        \"If \" + prefix + \".host is not set, then all of \" + badValues + \" must not be set either\");\n            }\n            return Optional.empty();\n        }\n\n        if (config.port().isEmpty()) {\n            throw new IllegalStateException(\"If \" + prefix + \".host is set, \" + prefix + \".port must also be set\");\n        }\n\n        if (config.username().isPresent() != config.password().isPresent()) {\n            throw new IllegalStateException(prefix + \".username and \" + prefix + \".password must be both set or both unset\");\n        }\n\n        Optional<String> username;\n        Optional<String> password;\n        if (config.username().isPresent() && config.password().isPresent()) {\n            username = config.username();\n            password = config.password();","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/proxy-registry/runtime/src/main/java/io/quarkus/proxy/runtime/ProxyConfigurationRecorder.java#L60-L96","documentation":"When a quarkus.proxy.* configuration block does not set host, all other proxy settings (port, username, password, non-proxy-hosts, proxy-connect-timeout) are meaningless. ProxyConfigurationRecorder.build() throws IllegalStateException listing the offending keys instead of silently ignoring them.","triggerScenarios":"Setting e.g. quarkus.proxy.\"x\".port=8080 or quarkus.proxy.\"x\".non-proxy-hosts=... without setting quarkus.proxy.\"x\".host, for the default or any named proxy config.","commonSituations":"Removing/commenting the host line while leaving the rest of the block; typos like hosts= instead of host=; leftover properties from a renamed proxy block.","solutions":["Set quarkus.proxy.\"<name>\".host to the proxy hostname","Or delete the orphaned sibling keys (port, username, password, non-proxy-hosts, proxy-connect-timeout) so the block is empty and skipped","Check for typos in the host property name"],"exampleFix":"// before\nquarkus.proxy.\"x\".port=8080\nquarkus.proxy.\"x\".non-proxy-hosts=localhost\n// after\nquarkus.proxy.\"x\".host=proxy.example.com\nquarkus.proxy.\"x\".port=8080\nquarkus.proxy.\"x\".non-proxy-hosts=localhost","handlingStrategy":"validation","validationCode":"boolean hostSet = config.getOptionalValue(\"quarkus.proxy.\\\"x\\\".host\", String.class).isPresent();\nboolean orphan = config.getOptionalValue(\"quarkus.proxy.\\\"x\\\".port\", Integer.class).isPresent()\n    || config.getOptionalValue(\"quarkus.proxy.\\\"x\\\".non-proxy-hosts\", String.class).isPresent();\nif (!hostSet && orphan) {\n    throw new IllegalArgumentException(\"quarkus.proxy.\\\"x\\\".host missing but sibling keys are set\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    application.start();\n} catch (IllegalStateException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\".host is not set\")) {\n        throw new IllegalStateException(\"Set the proxy host or remove the orphaned sibling properties\", e);\n    }\n    throw e;\n}","preventionTips":["Always keep host and sibling keys together in config blocks","Check env-var configs (CI containers) for missing host vars","Beware typos like hosts= vs host=","Validate proxy blocks in a startup smoke test"],"tags":["proxy","configuration","startup","validation"],"backgroundTag":"incomplete-proxy-configuration","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"}