Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#850009: logrotate: daily cron fails if .1.gz file already exists

247 views
Skip to first unread message

Witold Baryluk

unread,
Jan 3, 2017, 1:30:02 AM1/3/17
to
Package: logrotate
Version: 3.8.7-2
Severity: normal

Stock configs.


/etc/cron.daily/logrotate:
error: error creating output file /var/log/apache2/error.log.1.gz: File exists
error: error creating output file /var/log/cups/access_log.1.gz: File exists
error: error creating output file /var/log/exim4/mainlog.1.gz: File exists
run-parts: /etc/cron.daily/logrotate exited with return code 1


few days later:

/etc/cron.daily/logrotate:
error: error creating output file /var/log/apache2/error.log.1.gz: File exists
error: error creating output file /var/log/clamav/clamav.log.1.gz: File exists
error: error creating output file /var/log/clamav/freshclam.log.1.gz: File exists
error: error creating output file /var/log/cups/access_log.1.gz: File exists
error: error creating output file /var/log/exim4/mainlog.1.gz: File exists
error: error creating output file /var/log/mail.info.1.gz: File exists
error: error creating output file /var/log/mail.warn.1.gz: File exists
error: error creating output file /var/log/mail.err.1.gz: File exists
error: error creating output file /var/log/mail.log.1.gz: File exists
error: error creating output file /var/log/kern.log.1.gz: File exists
error: error creating output file /var/log/auth.log.1.gz: File exists
error: error creating output file /var/log/debug.1.gz: File exists
error: error creating output file /var/log/messages.1.gz: File exists


That is rather annoying.



-- Package-specific info:
Contents of /etc/logrotate.d
total 84
-rw-r--r-- 1 root root 433 Dec 19 2015 apache2
-rw-r--r-- 1 root root 173 Dec 13 2012 apt
-rw-r--r-- 1 root root 79 Nov 7 2012 aptitude
-rw-r--r-- 1 root root 382 Feb 21 2016 clamav-daemon
-rw-r--r-- 1 root root 409 Feb 21 2016 clamav-freshclam
-rw-r--r-- 1 root root 135 Jul 30 2012 consolekit
-rw-r--r-- 1 root root 181 Mar 20 2014 cups-daemon
-rw-r--r-- 1 root root 232 Oct 20 2012 dpkg
-rw-r--r-- 1 root root 146 Jan 2 2013 exim4-base
-rw-r--r-- 1 root root 126 Jan 2 2013 exim4-paniclog
-rw-r--r-- 1 root root 151 Oct 4 2012 iptraf
-rw-r--r-- 1 root root 165 Jan 22 2016 libvirtd
-rw-r--r-- 1 root root 164 Jan 22 2016 libvirtd.libxl
-rw-r--r-- 1 root root 162 Jan 22 2016 libvirtd.lxc
-rw-r--r-- 1 root root 163 Jan 22 2016 libvirtd.qemu
-rw-r--r-- 1 root root 162 Jan 22 2016 libvirtd.uml
-rw-r--r-- 1 root root 101 Feb 5 2013 mpd
-rw-r--r-- 1 root root 157 Jan 16 2012 pm-utils
-rw-r--r-- 1 root root 94 Jun 22 2012 ppp
-rw-r--r-- 1 root root 515 Sep 26 2012 rsyslog
-rw-r--r-- 1 root root 235 Feb 18 2016 unattended-upgrades


-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-1-amd64 (SMP w/12 CPU cores)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages logrotate depends on:
ii anacron 2.3-23
ii base-passwd 3.5.42
ii cron [cron-daemon] 3.0pl1-128
ii libacl1 2.2.52-3
ii libc6 2.24-8
ii libpopt0 1.16-10
ii libselinux1 2.6-3

Versions of packages logrotate recommends:
ii bsd-mailx [mailx] 8.1.2-0.20160123cvs-3

logrotate suggests no packages.

-- no debconf information

Robert Collins

unread,
Oct 9, 2017, 2:40:02 AM10/9/17
to
We hit this in a cloud workload (k8s cluster to be specific).

logrotate can enter this mode if anything interrupts - e.g. if the
volume runs out of space temporarily, it will make the new .1.gz file
and then fail to write anything to it, but leave it behind. Subsequent
runs will then never rotate the logs.

And eventually the system will run out of space - which in a cloud
workload with pretty similar log rates on all the machines can lead to
a correlated failure across a few hours of an entire cluster.

Christian Göttsche

unread,
Aug 22, 2018, 11:50:02 AM8/22/18
to
Control: tags -1 moreinfo unreproducible

Hi,
can you reproduce this issue with version 3.14.0-2?
logrotate should nowadays clean up empty broken files.

Best regards
Christian Göttsche

Cadschool Sàrl

unread,
Aug 19, 2019, 3:50:03 AM8/19/19
to

Hi,

I've he same error that mentionned in this bugs reports:

[code]

/etc/cron.daily/logrotate:
error: error creating output file /var/log/mail.warn.1.gz: Le fichier existe
error: error creating output file /var/log/mail.err.1.gz: Le fichier existe
error: error creating output file /var/log/daemon.log.1.gz: Le fichier existe
error: error creating output file /var/log/auth.log.1.gz: Le fichier existe
error: error creating output file /var/log/user.log.1.gz: Le fichier existe
error: error creating output file /var/log/messages.1.gz: Le fichier existe
run-parts: /etc/cron.daily/logrotate exited with return code 1

[/code]

My server config (KVM Debian Jessie):

[code]

root@myserver:/home/user1# cat /etc/debian_version
8.11
root@myserver:/home/user1# uname -r
3.16.0-8-amd64
root@myserver:/home/user1# dpkg -l | grep logrotate
ii  logrotate                         3.8.7-1+b1                         amd64        Log rotation utility
root@myserver:/home/user1#

[/code]

Is there a patch ?

Many thanks

Mickaël

Christoph Biedl

unread,
Aug 20, 2019, 3:00:05 AM8/20/19
to
Cadschool Sàrl wrote...

> I've he same error that mentionned in this bugs reports:

> //etc/cron.daily/logrotate: error: error creating output file
> /var/log/mail.warn.1.gz: Le fichier existe (...)

This smells like a duplicate of #734688 (scroll down to the end).

> My server config (KVM Debian Jessie):

The listed upstream patch fixed the issue and is part of Debian 9
(stretch) and later. You could try to backport it on your own.

Christoph (not the logrotate maintainer, but I fixed the above issue
in Debian)
signature.asc
0 new messages