{"record":{"id":"8539ba34c5577d7c","repo":"vectordotdev/vector","slug":"multicast-for-systemd-fd-sockets-is-not-supported","errorCode":null,"errorMessage":"Multicast for systemd fd sockets is not supported","messagePattern":"Multicast for systemd fd sockets is not supported","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sources/socket/udp.rs","lineNumber":198,"sourceCode":"            .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            }\n        }\n\n        if let Some(receive_buffer_bytes) = config.receive_buffer_bytes","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/sources/socket/udp.rs#L180-L216","documentation":"When the UDP socket source is configured for multicast, the listen address must be a concrete SocketAddr so an interface IP can be chosen for joining groups. SocketListenAddr::SystemdFd (socket inherited from systemd socket activation) carries no usable address, so the code panics with unimplemented!: multicast is not supported for systemd fd sockets.","triggerScenarios":"Running Vector under systemd socket activation (ListenDatagram=, addressed via fd:// or SOCKET_FD) with a UDP socket source that also sets multicast_groups; the source startup path reaches the SystemdFd arm and panics.","commonSituations":"Hardened systemd deployments that pass the syslog/datagram socket as an fd and also expect multicast reception; migrating an existing multicast config to a systemd-activated service.","solutions":["Bind the address directly in the Vector config (e.g. address = \"0.0.0.0:514\") instead of receiving the socket from systemd, and keep multicast_groups.","Drop multicast_groups if the systemd-activated socket only needs unicast.","Use a helper process/relay that joins the multicast group and forwards traffic into the systemd-managed socket.","Extend the source to resolve the fd's local address and call join_multicast_v4 if you need native support."],"exampleFix":"// before (panics under systemd fd)\naddress = \"fd://\"\nmulticast_groups = [\"224.0.0.1\"]\n// after\naddress = \"0.0.0.0:514\"\nmulticast_groups = [\"224.0.0.1\"]","handlingStrategy":"validation","validationCode":"if (String(config.address).startsWith(\"fd://\") && config.multicast_groups?.length) {\n  throw new Error(\"multicast_groups cannot be used with systemd fd sockets; bind the address directly\");\n}","typeGuard":"function isSystemdFdAddress(address) {\n  return typeof address === \"string\" && (address.startsWith(\"fd://\") || address === \"systemd\");\n}","tryCatchPattern":null,"preventionTips":["Do not combine systemd socket activation (ListenDatagram) with multicast options in the Vector unit.","Review systemd unit files and Vector config together when migrating to socket activation.","If multicast is required, bind in Vector directly and drop the systemd socket.","Add a config lint that rejects fd:// addresses with multicast_groups."],"tags":["network","udp","multicast","systemd","sockets"],"backgroundTag":"operation-not-supported","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}