Logrotate fails because of duplicate netdata log entry

Anyone else encountering this? Dragonfish-24.04.1.1

Jul 02 00:00:06 october logrotate[3309658]: error: netdata_override:1 duplicate log entry for /var/log/netdata/access.log
Jul 02 00:00:06 october logrotate[3309658]: error: found error in file netdata_override, skipping
Jul 02 00:00:06 october systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
root@october[~]# cat /etc/logrotate.d/netdata
/var/log/netdata/*log {
	compress
	create 0640 netdata adm
	weekly
	delaycompress
	missingok
	notifempty
	rotate 14
	sharedscripts
	postrotate
		/bin/kill -HUP `pidof netdata 2>/dev/null` 2>/dev/null || true
	endscript
}
root@october[~]# cat /etc/logrotate.d/netdata_override
/var/log/netdata/*.log {
    size 10M
    rotate 7
    compress
    missingok
    notifempty
    copytruncate
}

Same problem here, after upgrade from 23 to 24 . The error is correct, but both files not: There can only 1 file served, but both configs serving same files:

root@nfs1:# ll /etc/logrotate.d
total 108
drwxr-xr-x   2 root root  23 May 29 18:27 .
drwxr-xr-x 128 root root 246 Jul  2 12:34 ..
-rw-r--r--   1 root root 120 Feb 14  2023 alternatives
-rw-r--r--   1 root root 173 May 25  2023 apt
-rw-r--r--   1 root root 285 Sep  3  2022 bmc-watchdog
-rw-r--r--   1 root root 130 Oct 14  2019 btmp
-rw-r--r--   1 root root 160 May  8  2023 chrony
-rw-r--r--   1 root root 112 Feb 14  2023 dpkg
-rw-r--r--   1 root root 128 Sep 29  2023 exim4-base
-rw-r--r--   1 root root 108 Sep 29  2023 exim4-paniclog
-rw-r--r--   1 root root  67 Sep  6  2022 ipmctl
-rw-r--r--   1 root root 165 May 21  2023 libvirtd
-rw-r--r--   1 root root 149 May 21  2023 libvirtd.libxl
-rw-r--r--   1 root root 147 May 21  2023 libvirtd.lxc
-rw-r--r--   1 root root 540 May 21  2023 libvirtd.qemu
-rw-r--r--   1 root root 221 Dec  5  2022 netdata
-rw-r--r--   1 root root 112 May 29 16:02 netdata_override
-rw-r--r--   1 root root 329 Mar 14  2023 nginx
-rw-r--r--   1 root root 799 Nov 14  2023 proftpd-core
-rw-r--r--   1 root root 802 May 29 16:02 syslog-ng-truenas
-rw-r--r--   1 root root 875 May 29 16:02 truenas-samba
-rw-r--r--   1 root root 908 Aug 17  2022 waagent.logrotate
-rw-r--r--   1 root root 145 Oct 14  2019 wtmp

So I think netdata_override is the new file and netdata was not correct removed during upgrade.
I moved netdata to a backup directory and now logrotate has no error.

root@nfs1:# mkdir /etc/logrotate.bak
root@nfs1:# mv /etc/logrotate.d/netdata /etc/logrotate.bak
root@nfs1:# systemctl reset-failed logrotate
root@nfs1:# systemctl start logrotate
root@nfs1:# systemctl status logrotate
○ logrotate.service - Rotate log files
     Loaded: loaded (/lib/systemd/system/logrotate.service; static)
     Active: inactive (dead) since Wed 2024-07-03 06:59:17 CEST; 53s ago
TriggeredBy: ● logrotate.timer
       Docs: man:logrotate(8)
             man:logrotate.conf(5)
    Process: 2379875 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=0/SUCCESS)
   Main PID: 2379875 (code=exited, status=0/SUCCESS)
        CPU: 432ms

Jul 03 06:59:16 nfs1 systemd[1]: Starting logrotate.service - Rotate log files...
Jul 03 06:59:17 nfs1 systemd[1]: logrotate.service: Deactivated successfully.
Jul 03 06:59:17 nfs1 systemd[1]: Finished logrotate.service - Rotate log files.

Hi there,

I have the same problem these days. I never noticed it until I enabled the alert service of the combination of node_exporter, prometheus and grafana.

After moving the file to the backup directory, the failure vanished too.

Which file did you move?

It would be great if we got an official answer as to which one is meant to be kept. If only I knew who to ask here…

This issue still seems to exist and I’m seeing the error on 24.04.2.

@UnissuedReselect It looks like netdata_override is the intended “new” file, added in PR #13649 of the middleware repo (I’m unable to link). There are review comments that seem to indicate they were aware the original config file would also be present, but not that access.log then matching two logrotate config sections would be a problem.

The PR is now locked and issues are disabled for the github repo, so I’m not sure how to create a new follow up issue that might see it fixed.

1 Like