quarkusio/quarkus · error · IllegalArgumentException

Unable to resolve "${value}"

Error message

Unable to resolve "${value}"

What it means

InetAddressConverter.convert() parses a config value as a literal IP first, then falls back to InetAddress.getByName(value). If the name cannot be resolved (UnknownHostException), it throws IllegalArgumentException("Unable to resolve \"<value>\"").

Source

Thrown at core/runtime/src/main/java/io/quarkus/runtime/configuration/InetAddressConverter.java:36

@Priority(DEFAULT_QUARKUS_CONVERTER_PRIORITY)
public class InetAddressConverter implements Converter<InetAddress>, Serializable {

    private static final long serialVersionUID = 4539214213710330204L;

    @Override
    public InetAddress convert(String value) {
        value = value.trim();
        if (value.isEmpty()) {
            return null;
        }
        final InetAddress parsed = Inet.parseInetAddress(value);
        if (parsed != null) {
            return parsed;
        }
        try {
            return InetAddress.getByName(value);
        } catch (UnknownHostException e) {
            throw new IllegalArgumentException("Unable to resolve \"" + value + "\"", e);
        }
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Use a literal IP address instead of a hostname if DNS is unreliable.
  2. Fix the hostname typo or add the entry to DNS//etc/hosts.
  3. Ensure DNS is reachable in the runtime environment (container network, CoreDNS, resolv.conf).
  4. If the property accepts multiple formats, confirm the value matches one exactly (try parsing with InetAddress.getByName locally).

Example fix

# before
quarkus.datasource.jdbc.host=db.internal   # unresolvable at startup
# after
quarkus.datasource.jdbc.host=10.0.0.5      # or fix DNS for db.internal
Defensive patterns

Strategy: try-catch

Validate before calling

boolean isResolvable(String s) {
    if (s == null || s.isBlank()) return false;
    try {
        java.net.InetAddress.getByName(s.trim());
        return true;
    } catch (java.net.UnknownHostException e) { return false;
    }
}

Type guard

java.net.InetAddress tryResolve(String s) {
    try { return (s == null || s.isBlank()) ? null : java.net.InetAddress.getByName(s.trim()); }
    catch (java.net.UnknownHostException e) { return null; }
}

Try / catch

try {
    // use converted InetAddress
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Unable to resolve")) {
        log.errorf("Host unresolvable, falling back to loopback: %s", e.getMessage());
        addr = java.net.InetAddress.getLoopbackAddress();
    } else { throw e; }
}

Prevention

When it happens

Trigger: Setting an IP/host-typed property with a hostname that DNS cannot resolve at startup, an invalid IP literal, or running in an environment without DNS/network access (containers, offline CI) where a hostname would be needed.

Common situations: Typo in hostname ('db.host.local' vs 'dbhost.local'); Docker/Kubernetes startup before the DNS entry exists; IPv6 literals needing brackets or wrong syntax; offline native-image container trying to resolve localhost aliases.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/c0cae0e83ad62e19. Report an issue: GitHub.