Skip to content

Bug: conntrack flush fails on older kernels (4.4.x) #3152

Description

@mrwogu

Is this urgent?

No

Host OS

Synology NAS (DSM)

CPU arch

x86_64

VPN service provider

ProtonVPN

What are you using to run the container

docker-compose

What is the version of Gluetun

Running version latest built on 2026-02-23T20:46:41.174Z (commit 625a63e)

What's the problem 🤔

conntrack flush fails on older kernels (4.4.x) - "netlink receive: invalid argument"

After the recent commit [625a63e] that added conntrack flushing on startup, gluetun fails to start on hosts running older kernels.

Error

ERROR flushing conntrack: netfilter query: netlink receive: invalid argument

Environment

  • Kernel: 4.4.302+
  • VPN provider: ProtonVPN
  • VPN type: WireGuard

nf_conntrack module status

The module is loaded and functional with 8 dependents:

nf_conntrack_ipv6       6656  2
nf_defrag_ipv6          6487  1 nf_conntrack_ipv6
nf_conntrack_ipv4      11666  20
nf_defrag_ipv4          1539  1 nf_conntrack_ipv4
nf_conntrack           62242  8 ip_vs,nf_nat,xt_state,nf_nat_ipv4,xt_conntrack,nf_nat_masquerade_ipv4,nf_conntrack_ipv4,nf_conntrack_ipv6

Analysis

The nf_conntrack kernel module is loaded and working, but the netlink conntrack flush API used by github.com/ti-mo/conntrack appears to require a newer kernel. Kernel 4.4.x may not support all NFNL_SUBSYS_CTNETLINK message types or flags that the library sends.

Expected behavior

Gluetun should either:

  1. Gracefully handle the conntrack flush failure (log a warning instead of a fatal error), or
  2. Detect kernel compatibility before attempting the flush

Suggested fix

Treat conntrack flush failure as non-fatal - a warning rather than a startup-blocking error. The flush is an optimization (clearing stale connections), not a requirement for VPN functionality.

Workaround

Pinning to a gluetun version released before this commit (v3.41.1)

Share your logs (at least 10 lines)

2026-02-23T22:45:25+01:00 ERROR flushing conntrack: netfilter query: netlink receive: invalid argument
2026-02-23T22:45:25+01:00 INFO Shutdown successful

Share your configuration

`cap_add: NET_ADMIN` is set
`/dev/net/tun` mounted

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions