PROCFILE: Cannot rewind on file '/proc/[netdata_pid]/net/stat/{stat/nf_conntrack,netstat,sockstat6,sockstat,dev,stat/nf_conntrack,netstat,sockstat6,sockstat,dev}'.

Problem/Question

The netdata agent is logging many messages of the form:

netdata[538630]: PROCFILE: Cannot rewind on file '/proc/538630/net/stat/nf_conntrack'.
netdata[538630]: PROCFILE: Cannot rewind on file '/proc/538630/net/netstat'.
netdata[538630]: PROCFILE: Cannot rewind on file '/proc/538630/net/sockstat6'.
netdata[538630]: PROCFILE: Cannot rewind on file '/proc/538630/net/sockstat'.
netdata[538630]: PROCFILE: Cannot rewind on file '/proc/538630/net/dev'.
netdata[538630]: PROCFILE: Cannot rewind on file '/proc/538630/net/stat/nf_conntrack'.
netdata[538630]: PROCFILE: Cannot rewind on file '/proc/538630/net/netstat'.
netdata[538630]: PROCFILE: Cannot rewind on file '/proc/538630/net/sockstat6'.
netdata[538630]: PROCFILE: Cannot rewind on file '/proc/538630/net/sockstat'.
netdata[538630]: PROCFILE: Cannot rewind on file '/proc/538630/net/dev'.

As you can see, this is copied from journald the netdata main process’ PID is included (538630), and the /proc/538630 that is causing the error therefore corresponds to netdata itself. This seems strange to me…

This works fine for instance:

sudo -u netdata -- cat /proc/538630/net/stat/nf_conntrack

More detailed error using journalctl –output=json:

{"_COMM":"netdata",
"_BOOT_ID":"1a2d891f6af84bfea2c521c53fa22481",
"ERRNO":"29",
"_GID":"134",
"MESSAGE":"PROCFILE: Cannot rewind on file '/proc/538630/net/dev'.",
"_UID":"134",
"CODE_FILE":"/usr/src/debug/netdata/netdata-v2.6.2/src/libnetdata/procfile/procfile.c",
"THREAD_TAG":"P[proc netdev]",
"__CURSOR":"s=e250ffab473647f2b579ad6018789b5f;i=4309a87;b=1a2d891f6af84bfea2c521c53fa22481;m=1ae261a28;t=63ccfd4620f7f;x=b16016026494a20a",
"_SYSTEMD_SLICE":"system.slice",
"PRIORITY":"3",
"_SYSTEMD_UNIT":"netdata.service",
"_CAP_EFFECTIVE":"0",
"__REALTIME_TIMESTAMP":"1755713179357055",
"SYSLOG_IDENTIFIER":"netdata",
"CODE_FUNC":"procfile_readall",
"_PID":"538630",
"CODE_LINE":"336",
"_RUNTIME_SCOPE":"system",
"ND_LOG_SOURCE":"collector",
"INVOCATION_ID":"7a30abc6be54417f8f8e3bc380706903",
"__SEQNUM_ID":"e250ffab473647f2b579ad6018789b5f",
"__SEQNUM":"70294151",
"_HOSTNAME":"[REDACTED]",
"_MACHINE_ID":"79fc3ff7cd964795a50c956771a0f31a",
"__MONOTONIC_TIMESTAMP":"7216699944",
"TID":"539441",
"_EXE":"/usr/bin/netdata",
"_SYSTEMD_INVOCATION_ID":"7a30abc6be54417f8f8e3bc380706903",
"_TRANSPORT":"journal",
"_SYSTEMD_CGROUP":"/system.slice/netdata.service",
"_SOURCE_REALTIME_TIMESTAMP":"1755713179357022",
"_CMDLINE":"/usr/bin/netdata -D"}

Relevant docs you followed/actions you took to solve the issue

I could find no information on this error or any similar ones through searching the docs or this forum.

Environment/Browser/Agent’s version etc

Arch Linux, with netdata installed through the native pacman package.

# pacman -Qi netdata
Name            : netdata
Version         : 2.6.2-1
[clip]

Also, maybe the systemd service used by this package to run netdata is relevant as it sets/limits capabilities:

# /etc/systemd/system/netdata.service
# SPDX-License-Identifier: GPL-3.0-or-later
[Unit]
Description=Real time performance monitoring

# append here other services you want netdata to wait for them to start
After=network.target httpd.service squid.service nfs-server.service mysqld.service mysql.service named.service postfix.service chronyd.service

[Service]
Type=simple
User=netdata
Group=netdata
RuntimeDirectory=netdata
CacheDirectory=netdata
StateDirectory=netdata
LogsDirectory=netdata
RuntimeDirectoryMode=0775
StateDirectoryMode=0755
CacheDirectoryMode=0755
LogsDirectoryMode=2750
EnvironmentFile=-/etc/default/netdata
ExecStart=/usr/bin/netdata -D $EXTRA_OPTS

# saving a big db on slow disks may need some time
TimeoutStopSec=150

# restart netdata if it crashes
Restart=on-failure
RestartSec=30

# Valid policies: other (the system default) | batch | idle | fifo | rr
# To give netdata the max priority, set CPUSchedulingPolicy=rr and CPUSchedulingPriority=99
CPUSchedulingPolicy=batch

# This sets the scheduling priority (for policies: rr and fifo).
# Priority gets values 1 (lowest) to 99 (highest).
#CPUSchedulingPriority=1

# For scheduling policy 'other' and 'batch', this sets the lowest niceness of netdata (-20 highest to 19 lowest).
Nice=0

[Install]
WantedBy=multi-user.target


# /etc/systemd/system/netdata.service.d/override.conf

[Unit]
After=dns-ready.service

[Service]
ExecStartPre=/usr/bin/chown -R netdata:netdata /var/lib/netdata
#CapabilityBoundingSet=~

What I expected to happen

This error message should not be logged I would imagine. It is certainly very frequent… (every 2 to 5 seconds).

For some reason, this has now stopped :man_shrugging: