{"record":{"id":"4c85db0176c6fc64","repo":"aeron-io/aeron","slug":"interface-is-null-or-empty","errorCode":null,"errorMessage":"interface is null or empty","messagePattern":"interface is null or empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/media/UnresolvedInterface.java","lineNumber":35,"sourceCode":"\nimport org.agrona.Strings;\n\nimport java.net.ProtocolFamily;\nimport java.net.SocketException;\nimport java.net.UnknownHostException;\n\n/**\n * Interface specification as found, for example, in the {@code interface=} channel parameter.\n */\nsealed interface UnresolvedInterface permits InterfaceSearchAddress, NamedInterface\n{\n    ResolvedInterface resolve(boolean multicast, ProtocolFamily protocolFamily) throws SocketException;\n\n    static UnresolvedInterface parse(final String str) throws UnknownHostException\n    {\n        if (Strings.isEmpty(str))\n        {\n            throw new IllegalArgumentException(\"interface is null or empty\");\n        }\n\n        if (str.charAt(0) == NamedInterface.OPENING_CHAR)\n        {\n            return NamedInterface.parse(str);\n        }\n        else\n        {\n            return InterfaceSearchAddress.parse(str);\n        }\n    }\n}\n","sourceCodeStart":17,"sourceCodeEnd":48,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/media/UnresolvedInterface.java#L17-L48","documentation":"UnresolvedInterface.parse was given a null or empty string for a network interface specification and throws IllegalArgumentException. An interface value is required to select the local network interface for a UDP channel, so empty input is rejected immediately.","triggerScenarios":"Calling UnresolvedInterface.parse(null) or parse(\"\") directly, or configuring a channel URI whose interface= parameter is empty so an empty string reaches parse.","commonSituations":"Template/config files with an unfilled interface variable, environment variables not set, programmatic channel construction concatenating an empty interface value, or YAML/properties parsing yielding empty strings.","solutions":["Provide a valid interface value in the channel URI, e.g. interface=eth0 or interface=192.168.1.5.","Check that the config source (env var, properties) actually supplies a non-empty interface string.","Validate the interface value before building the ChannelUri."],"exampleFix":"// before\nString iface = System.getProperty(\"aeron.interface\"); // null/empty\nUnresolvedInterface.parse(iface);\n// after\nString iface = System.getProperty(\"aeron.interface\", \"eth0\");\nif (!iface.isEmpty()) { UnresolvedInterface.parse(iface); }","handlingStrategy":"validation","validationCode":"String iface = config.get(\"interface\");\nif (iface == null || iface.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"interface must be set (e.g. eth0 or 192.168.1.5)\");\n}","typeGuard":"boolean validInterface(String s) {\n    return s != null && !s.trim().isEmpty();\n}","tryCatchPattern":"try {\n    UnresolvedInterface.parse(str);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"null or empty\")) { /* supply default interface */ }\n}","preventionTips":["Set interface= explicitly in every channel URI","Fail config load fast when env vars are missing","Keep a documented default interface per deployment"],"tags":["configuration","network","interface","validation"],"backgroundTag":"empty-required-field","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}