quarkusio/quarkus · error · IllegalStateException
If ${prefix}.host is not set, then all of [${badValues}] mus
Error message
If ${prefix}.host is not set, then all of [${badValues}] must not be set either What it means
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.
Source
Thrown at extensions/proxy-registry/runtime/src/main/java/io/quarkus/proxy/runtime/ProxyConfigurationRecorder.java:78
badValues.add("port");
}
if (config.credentialsProvider().name().isPresent()) {
badValues.add("credentials-provider");
}
if (config.username().isPresent()) {
badValues.add("username");
}
if (config.password().isPresent()) {
badValues.add("password");
}
if (config.nonProxyHosts().isPresent()) {
badValues.add("non-proxy-hosts");
}
if (config.proxyConnectTimeout().isPresent()) {
badValues.add("proxy-connect-timeout");
}
if (badValues.length() > 0) {
throw new IllegalStateException(
"If " + prefix + ".host is not set, then all of " + badValues + " must not be set either");
}
return Optional.empty();
}
if (config.port().isEmpty()) {
throw new IllegalStateException("If " + prefix + ".host is set, " + prefix + ".port must also be set");
}
if (config.username().isPresent() != config.password().isPresent()) {
throw new IllegalStateException(prefix + ".username and " + prefix + ".password must be both set or both unset");
}
Optional<String> username;
Optional<String> password;
if (config.username().isPresent() && config.password().isPresent()) {
username = config.username();
password = config.password();View on GitHub (pinned to e1c734241f)
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
Example fix
// before quarkus.proxy."x".port=8080 quarkus.proxy."x".non-proxy-hosts=localhost // after quarkus.proxy."x".host=proxy.example.com quarkus.proxy."x".port=8080 quarkus.proxy."x".non-proxy-hosts=localhost
Defensive patterns
Strategy: validation
Validate before calling
boolean hostSet = config.getOptionalValue("quarkus.proxy.\"x\".host", String.class).isPresent();
boolean orphan = config.getOptionalValue("quarkus.proxy.\"x\".port", Integer.class).isPresent()
|| config.getOptionalValue("quarkus.proxy.\"x\".non-proxy-hosts", String.class).isPresent();
if (!hostSet && orphan) {
throw new IllegalArgumentException("quarkus.proxy.\"x\".host missing but sibling keys are set");
} Try / catch
try {
application.start();
} catch (IllegalStateException e) {
if (e.getMessage() != null && e.getMessage().contains(".host is not set")) {
throw new IllegalStateException("Set the proxy host or remove the orphaned sibling properties", e);
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- If ${prefix}.host is set, ${prefix}.port must also be set
- Proxy configuration name `none` has a special meaning and co
- Unrecognized dependency flag '<trimmed>'. Supported flags: O
- Parameter 'mode' was set to '<mode>' while expected one of '
- Parameter 'mode' was set to '<mode>' while expected one of '
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/3b7b7ba46c1d0a37.
Report an issue: GitHub.