IPv6 Socket Binding Issue
- Problem Definition
- Solution
Issue: Address family not supported by protocol
When starting the Monitor container, you see errors in the logs related to IPv6 socket binding:
Error binding socket
error: error creating server listener: Address family not supported by protocol (os error 97)
Or:
Failed to bind to [::]:5044
Address family not supported by protocol
The Monitor container fails to start because the host operating system has IPv6 disabled or restricted, but the container defaults to using IPv6 (::) for socket binding.
Any service that binds to a network socket may be affected, including multiple services in Vector that listen for incoming data (e.g., syslog, API). The root cause is that the default socket address is set to :: (IPv6), which is not supported on hosts with IPv6 disabled.
Step 1 — Edit the environment file
Open your .env or .env.prod file and set the following variables to force IPv4 binding:
VECTOR_SOCKET_ADDR=0.0.0.0
VECTOR_API_ADDRESS=0.0.0.0:8686
These can be added to your existing env file:
# .env or .env.prod
VECTOR_SOCKET_ADDR=0.0.0.0
VECTOR_API_ADDRESS=0.0.0.0:8686
# ... other variables
Step 2 — Restart the container
Podman:
podman restart mon
Docker:
docker restart mon
Step 3 — Verify
Check that services are now listening on IPv4:
podman exec mon netstat -tlnp
Expected output:
tcp 0 0 0.0.0.0:5044 0.0.0.0:* LISTEN <pid>/vector
tcp 0 0 0.0.0.0:5045 0.0.0.0:* LISTEN <pid>/vector
tcp 0 0 0.0.0.0:8686 0.0.0.0:* LISTEN <pid>/vector
Or check the logs:
podman logs mon --tail 50
You should see services starting successfully without IPv6 binding errors.
Environment Variables
- VECTOR_SOCKET_ADDR
- VECTOR_API_ADDRESS
The VECTOR_SOCKET_ADDR environment variable controls which network interface Vector binds to:
| Value | Description |
|---|---|
:: (default) | Bind to all IPv6 interfaces |
0.0.0.0 | Bind to all IPv4 interfaces |
<specific-IP> | Bind to a specific IP address |
Note: If your host OS has IPv6 disabled, you must set this to 0.0.0.0.
The VECTOR_API_ADDRESS environment variable controls the Vector API address used for health checks:
| Value | Description |
|---|---|
[::]:8686 (default) | IPv6 API address |
0.0.0.0:8686 | IPv4 API address |
<specific-IP>:8686 | Specific IP address |
Note: Should be in IP:PORT format. Must match the socket address family (IPv4 with 0.0.0.0, IPv6 with ::).
Reference
See the Installation Environment Variables documentation for the complete list of available environment variables.