From a65293c036620f4e495899155eb687d403dfd37c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 15 Oct 2025 02:24:34 +0200 Subject: [PATCH] libnetwork/osl/kernel: ApplyOSTweaks: don't log errors if not found I noticed these errors logged inside the dev-container; ERRO[2025-10-14T16:15:46.603781797Z] error reading the kernel parameter net.ipv4.neigh.default.gc_thresh1 error="open /proc/sys/net/ipv4/neigh/default/gc_thresh1: no such file or directory" ERRO[2025-10-14T16:15:46.603808089Z] error reading the kernel parameter net.ipv4.neigh.default.gc_thresh2 error="open /proc/sys/net/ipv4/neigh/default/gc_thresh2: no such file or directory" ERRO[2025-10-14T16:15:46.603819922Z] error reading the kernel parameter net.ipv4.neigh.default.gc_thresh3 error="open /proc/sys/net/ipv4/neigh/default/gc_thresh3: no such file or directory" Given that these happen during an initial check, we can probably ignore them if there's nothing to tweak. Signed-off-by: Sebastiaan van Stijn --- daemon/libnetwork/osl/kernel/knobs_linux.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/libnetwork/osl/kernel/knobs_linux.go b/daemon/libnetwork/osl/kernel/knobs_linux.go index 81ad174265..6b2a27c555 100644 --- a/daemon/libnetwork/osl/kernel/knobs_linux.go +++ b/daemon/libnetwork/osl/kernel/knobs_linux.go @@ -32,14 +32,16 @@ func ApplyOSTweaks(osConfig map[string]*OSValue) { // read the existing property from disk oldv, err := readSystemProperty(k) if err != nil { - log.G(context.TODO()).WithError(err).Errorf("error reading the kernel parameter %s", k) + if !os.IsNotExist(err) { + log.G(context.TODO()).WithError(err).Errorf("error reading the kernel parameter %s", k) + } continue } if propertyIsValid(oldv, v.Value, v.CheckFn) { // write new prop value to disk if err := writeSystemProperty(k, v.Value); err != nil { - log.G(context.TODO()).WithError(err).Errorf("error setting the kernel parameter %s = %s, (leaving as %s)", k, v.Value, oldv) + log.G(context.TODO()).WithError(err).Warnf("error setting the kernel parameter %s = %s, (leaving as %s)", k, v.Value, oldv) continue } log.G(context.TODO()).Debugf("updated kernel parameter %s = %s (was %s)", k, v.Value, oldv)