From da1d263760b96813c82421cc56a30c0b3c5ecd7b Mon Sep 17 00:00:00 2001 From: Nikolay Sivko Date: Mon, 23 Dec 2024 14:16:00 +0300 Subject: [PATCH] handle missing `nf_conntrack` gracefully --- ebpftracer/tracer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ebpftracer/tracer.go b/ebpftracer/tracer.go index a0e3d25..3efde37 100644 --- a/ebpftracer/tracer.go +++ b/ebpftracer/tracer.go @@ -491,6 +491,12 @@ const nfConntrackEventsParameterPath = "/proc/sys/net/netfilter/nf_conntrack_eve func ensureConntrackEventsAreEnabled() error { v, err := common.ReadUintFromFile(nfConntrackEventsParameterPath) if err != nil { + if common.IsNotExist(err) { + klog.Warningf( + "unable to check the value of %s, it appears that nf_conntrack is not loaded: %s", + nfConntrackEventsParameterPath, err) + return nil + } return err } if v != 1 {