vectordotdev/vector · error

Multicast for systemd fd sockets is not supported

Error message

Multicast for systemd fd sockets is not supported

What it means

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.

Solutions

  1. 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.
  2. Drop multicast_groups if the systemd-activated socket only needs unicast.
  3. Use a helper process/relay that joins the multicast group and forwards traffic into the systemd-managed socket.
  4. Extend the source to resolve the fd's local address and call join_multicast_v4 if you need native support.

Example fix

// before (panics under systemd fd)
address = "fd://"
multicast_groups = ["224.0.0.1"]
// after
address = "0.0.0.0:514"
multicast_groups = ["224.0.0.1"]
Defensive patterns

Strategy: validation

Validate before calling

if (String(config.address).startsWith("fd://") && config.multicast_groups?.length) {
  throw new Error("multicast_groups cannot be used with systemd fd sockets; bind the address directly");
}

Type guard

function isSystemdFdAddress(address) {
  return typeof address === "string" && (address.startsWith("fd://") || address === "systemd");
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/8539ba34c5577d7c. Report an issue: GitHub.

Appendix: source

Thrown at src/sources/socket/udp.rs:198

            .map_err(|error| {
                emit!(SocketBindError {
                    mode: SocketMode::Udp,
                    error,
                })
            })?;

        if !config.multicast_groups.is_empty() {
            socket.set_multicast_loop_v4(true).unwrap();
            let listen_addr = match config.address() {
                SocketListenAddr::SocketAddr(SocketAddr::V4(addr)) => addr,
                SocketListenAddr::SocketAddr(SocketAddr::V6(_)) => {
                    // We could support Ipv6 multicast with the
                    // https://doc.rust-lang.org/std/net/struct.UdpSocket.html#method.join_multicast_v6 method
                    // and specifying the interface index as `0`, in order to bind all interfaces.
                    unimplemented!("IPv6 multicast is not supported")
                }
                SocketListenAddr::SystemdFd(_) => {
                    unimplemented!("Multicast for systemd fd sockets is not supported")
                }
            };
            for group_addr in config.multicast_groups {
                let interface = config.multicast_interface.unwrap_or(*listen_addr.ip());
                socket
                    .join_multicast_v4(group_addr, interface)
                    .map_err(|error| {
                        emit!(SocketMulticastGroupJoinError {
                            error,
                            group_addr,
                            interface,
                        })
                    })?;
                info!(message = "Joined multicast group.", group = %group_addr);
            }
        }

        if let Some(receive_buffer_bytes) = config.receive_buffer_bytes

View on GitHub (pinned to bdb87aeaa4)