{"record":{"id":"011e0b8be8fa5e34","repo":"vectordotdev/vector","slug":"ipv6-multicast-is-not-supported","errorCode":null,"errorMessage":"IPv6 multicast is not supported","messagePattern":"IPv6 multicast is not supported","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sources/socket/udp.rs","lineNumber":198,"sourceCode":"        let listenfd = ListenFd::from_env();\n        let socket = try_bind_udp_socket(config.address, listenfd)\n            .await\n            .map_err(|error| {\n                emit!(SocketBindError {\n                    mode: SocketMode::Udp,\n                    error,\n                })\n            })?;\n\n        if !config.multicast_groups.is_empty() {\n            socket.set_multicast_loop_v4(true).unwrap();\n            let listen_addr = match config.address() {\n                SocketListenAddr::SocketAddr(SocketAddr::V4(addr)) => addr,\n                SocketListenAddr::SocketAddr(SocketAddr::V6(_)) => {\n                    // We could support Ipv6 multicast with the\n                    // https://doc.rust-lang.org/std/net/struct.UdpSocket.html#method.join_multicast_v6 method\n                    // and specifying the interface index as `0`, in order to bind all interfaces.\n                    unimplemented!(\"IPv6 multicast is not supported\")\n                }\n                SocketListenAddr::SystemdFd(_) => {\n                    unimplemented!(\"Multicast for systemd fd sockets is not supported\")\n                }\n            };\n            for group_addr in config.multicast_groups {\n                let interface = config.multicast_interface.unwrap_or(*listen_addr.ip());\n                socket\n                    .join_multicast_v4(group_addr, interface)\n                    .map_err(|error| {\n                        emit!(SocketMulticastGroupJoinError {\n                            error,\n                            group_addr,\n                            interface,\n                        })\n                    })?;\n                info!(message = \"Joined multicast group.\", group = %group_addr);\n            }","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/vectordotdev/vector/blob/711f03abce4f7a65e3a84b8893be60675a8aef39/src/sources/socket/udp.rs#L180-L216","documentation":"The UDP socket source only implements IPv4 multicast: it calls set_multicast_loop_v4 and join_multicast_v4 with the IPv4 listen address (src/sources/socket/udp.rs:191-210). If multicast_groups is non-empty and the configured address parses to an IPv6 socket address, the SocketAddr::V6 arm panics via unimplemented!(\"IPv6 multicast is not supported\") at udp.rs:198. The in-code comment notes IPv6 support would require std's join_multicast_v6 with an interface index, which has not been implemented.","triggerScenarios":"A socket source with mode = \"udp\", a non-empty multicast_groups list, and an IPv6 listen address such as address = \"[::]:9999\" or address = \"[::1]:9999\". The panic occurs when the source task starts (right after binding), so Vector crashes at pipeline startup. The config docs for multicast_interface/multicast_groups state the listen address must be IPv4 (udp.rs:55).","commonSituations":"Switching a listener to \"[::]\" for dual-stack v4-mapped acceptance while keeping multicast_groups from an older IPv4 config; IPv6-only containers/hosts; copying an example config that used IPv6 address syntax; renaming hosts so the address literal resolves to v6.","solutions":["Use an IPv4 listen address for this source, e.g. address = \"0.0.0.0:9999\" (or a specific IPv4 unicast address), keeping the IPv4 multicast groups.","Remove multicast_groups (and multicast_interface) if multicast membership is not actually required, then any address family works.","Run a separate IPv4-bound UDP source solely for multicast ingestion alongside your IPv6 listener.","If IPv6 multicast is required, patch the V6 arm to call UdpSocket::join_multicast_v6(group, interface_index 0) (as the source comment suggests) and upstream the change."],"exampleFix":"# vector.toml — before: IPv6 listen address + multicast panics at startup\n[sources.udp_in]\ntype = \"socket\"\nmode = \"udp\"\naddress = \"[::]:9999\"\nmulticast_groups = [\"239.1.1.1:9999\"]\n\n# after: IPv4 listen address (multicast path requires SocketAddr::V4)\n[sources.udp_in]\ntype = \"socket\"\nmode = \"udp\"\naddress = \"0.0.0.0:9999\"\nmulticast_groups = [\"239.1.1.1:9999\"]","handlingStrategy":"validation","validationCode":"# CI pre-deploy check: reject IPv6 listen addresses whenever multicast is configured\nif grep -q 'multicast_groups' vector.toml; then\n  if grep -qE 'address[[:space:]]*=[[:space:]]*\"\\[' vector.toml; then\n    echo \"FAIL: UDP multicast requires an IPv4 listen address (found IPv6 '[...]')\"; exit 1\n  fi\nfi","typeGuard":"#!/usr/bin/env python3\n# True only when a UDP socket config can support multicast (IPv4 explicit address)\nimport re, sys\ncfg = open(sys.argv[1]).read()\nhas_mcast = re.search(r'^multicast_groups\\s*=', cfg, re.M)\naddr = re.search(r'^address\\s*=\\s*\"([^\"]+)\"', cfg, re.M)\nok = not has_mcast or (addr and not addr.group(1).startswith(\"[\") and not addr.group(1).startswith(\"systemd\"))\nprint(\"multicast-ok\" if ok else \"multicast-unsupported\")","tryCatchPattern":null,"preventionTips":["Pin an explicit IPv4 address (0.0.0.0:port or a specific unicast v4) on every UDP source that sets multicast_groups; never '[::]'.","The panic occurs at source startup, not config validation, so smoke-test the exact production config (vector validate alone is not enough — actually start the topology once in CI).","Watch for dual-stack refactors: switching a listener to IPv6 silently breaks any sibling multicast_groups setting.","Track Vector's documented limitation: multicast_interface/multicast_groups require an IPv4, non-systemd-fd listen address."],"tags":["udp","multicast","ipv6","socket","source","network","panic"],"backgroundTag":"ipv6-udp-multicast","analyzedSha":"711f03abce4f7a65e3a84b8893be60675a8aef39","analyzedAt":"2026-08-16T23:17:25.807Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}