{"record":{"id":"f1894062317e670c","repo":"eclipse-vertx/vert.x","slug":"could-not-find-network-interface-with-name-optio","errorCode":null,"errorMessage":"Could not find network interface with name ${options.getMulticastNetworkInterface()}","messagePattern":"Could not find network interface with name (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/spi/transport/Transport.java","lineNumber":140,"sourceCode":"    if (options.getReceiveBufferSize() != -1) {\n      channel.config().setReceiveBufferSize(options.getReceiveBufferSize());\n      channel.config().setRecvByteBufAllocator(new FixedRecvByteBufAllocator(options.getReceiveBufferSize()));\n    }\n    channel.config().setOption(ChannelOption.SO_REUSEADDR, options.isReuseAddress());\n    if (options.getTrafficClass() != -1) {\n      channel.config().setTrafficClass(options.getTrafficClass());\n    }\n    channel.config().setBroadcast(options.isBroadcast());\n    if (this instanceof NioTransport) {\n      channel.config().setLoopbackModeDisabled(options.isLoopbackModeDisabled());\n      if (options.getMulticastTimeToLive() != -1) {\n        channel.config().setTimeToLive(options.getMulticastTimeToLive());\n      }\n      if (options.getMulticastNetworkInterface() != null) {\n        try {\n          channel.config().setNetworkInterface(NetworkInterface.getByName(options.getMulticastNetworkInterface()));\n        } catch (SocketException e) {\n          throw new IllegalArgumentException(\"Could not find network interface with name \" + options.getMulticastNetworkInterface());\n        }\n      }\n    }\n  }\n\n  default void configure(TcpConfig config, boolean domainSocket, Bootstrap bootstrap) {\n    if (!domainSocket) {\n      NioTransport.configOption(bootstrap, config, TcpOption.NODELAY, ChannelOption.TCP_NODELAY);\n      bootstrap.option(ChannelOption.SO_KEEPALIVE, config.isSoKeepAlive());\n    }\n    if (config.getSoLinger() != -1) {\n      bootstrap.option(ChannelOption.SO_LINGER, config.getSoLinger());\n    }\n  }\n\n  default void configure(TcpConfig config, boolean domainSocket, ServerBootstrap bootstrap) {\n    if (!domainSocket) {\n      NioTransport.configChildOption(bootstrap, config, TcpOption.NODELAY, ChannelOption.TCP_NODELAY);","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/spi/transport/Transport.java#L122-L158","documentation":"Thrown by Transport.configure when configuring a DatagramSocket's channel with the multicast network interface name set in DatagramSocketOptions. NetworkInterface.getByName() returned null or threw SocketException, meaning no NIC matches the configured name, so Vert.x rejects the options with an IllegalArgumentException rather than silently ignoring multicast configuration.","triggerScenarios":"Creating a DatagramSocket (or anything using DatagramSocketImpl) with DatagramSocketOptions.setMulticastNetworkInterface(name) set to a name that does not exist on the host, e.g. 'eth9', a VPN/tunnel interface that is down, or a Docker bridge removed since config was written.","commonSituations":"Hardcoded interface names from one machine deployed to another; container/Kubernetes environments where interface names differ (eth0 vs ens5); interfaces renamed by netplan/udev; VPN or multicast-capable interface being down at startup.","solutions":["List valid interface names with 'ip link' (or NetworkInterface.getNetworkInterfaces()) and set options.setMulticastNetworkInterface() to an existing one","Remove the setMulticastNetworkInterface call entirely and let the OS pick the default interface if multicast binding to a specific NIC is not required","Make the interface name configurable per environment (config/env var) and resolve it at startup","Ensure the named interface is up (ip link set <name> up) before creating the socket"],"exampleFix":"// before\noptions.setMulticastNetworkInterface(\"eth0\");\n// after\nString ifName = System.getenv(\"MULTICAST_IF\"); // e.g. resolved per host\nif (ifName != null && java.net.NetworkInterface.getByName(ifName) != null) {\n  options.setMulticastNetworkInterface(ifName);\n}","handlingStrategy":"validation","validationCode":"String ifName = options.getMulticastNetworkInterface();\nif (ifName != null && java.net.NetworkInterface.getByName(ifName) == null) {\n  throw new IllegalStateException(\"Network interface not found: \" + ifName\n      + \". Available: \" + java.net.NetworkInterface.getNetworkInterfaces());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hardcode interface names; resolve them from config/env per deployment","Verify the interface exists and is up at startup before opening the socket","Log NetworkInterface.getNetworkInterfaces() names in diagnostics"],"tags":["network","multicast","configuration","datagram"],"backgroundTag":"invalid-config-value","analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}