containers / containers/netavark
Podman container with macvlan fails to restart via systemd — “Address already in use” error
- Dominant language
- Rust
- Stars
- 794
- Forks
- 161
- Avg merge
- 8d 17h
- Merged PRs (30d)
- 3
Description
When restarting a Podman container managed by systemd and using a macvlan network with DHCP, the container fails to start with the following error:
```
Error: netavark: set macvlan up: Netlink error: Address already in use (os error 98)
```
This happens consistently when using systemctl restart on the service unit. The container starts fine initially, but fails on restart — even after removing it with podman rm -f. Only a full system reboot clears the issue.
Network Configuration (macvlan.network):
```
[Network]
DisableDNS=true
Driver=macvlan
IPAMDriver=dhcp
PodmanArgs=--interface-name eth3
```
Container Configuration (mqtt-broker.container):
```
[Unit]
Description=mqtt broker server
After=network-online.target
Wants=network-online.target
Before=shutdown.target
[Container]
HostName=mqtt-broker
AutoUpdate=registry
Image=docker.io/eclipse-mosquitto:latest
Network=macvlan.network
#PodmanArgs=--ip 192.168.16.6
PodmanArgs=--mac-address 60:8C:E0:38:D7:8A
Volume=/srv/docker/root/volumes/mqtt/data:/mosquitto/data
Volume=/srv/docker/root/volumes/mqtt/config:/mosquitto/config
Volume=/srv/docker/root/volumes/mqtt/log:/mosquitto/log
[Service]
Restart=always
[Install]
WantedBy=multi-user.target
```
Steps to Reproduce:
Start the container via systemd:
`sudo systemctl start mqtt-broker.service`
Container starts successfully
IP is correctly assigned via DHCP
Restart the container:
`sudo systemctl restart mqtt-broker.service`
Container fails to start
`Error: Netlink error: Address already in use`
Inspect DHCP lease:
File `/run/podman/nv-proxy.lease` still contains the previous lease
Deleting this file has no effect
Killing nv-proxy also has no effect — it auto-restarts
The lease file is not regenerated after restart
Reboot the host:
After reboot, container starts successfully again
Additional Observation:
The container has `AutoUpdate=registry` enabled in the systemd unit
Automatic updates work fine — the container is replaced and restarted without issue
Manual restarts via systemctl restart consistently trigger the MAC address conflict
Contributor guide
Assessment
This issue has not been assessed yet.