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

Bug#1019343: munin-graph uses deprecated Date::Manip:DM5, spams due to cron

133 views
Skip to first unread message

Nye Liu

unread,
Sep 7, 2022, 12:00:04 PM9/7/22
to
Package: munin
Version: 2.0.69-1
Severity: normal

munin-graph, when run via cron and if cron is configured to send mail on error spams emails every few minutes:

Date::Manip::DM5 is deprecated and will be removed from the Date::Manip package starting in version 7.00 at (eval 5) line 1.

This presumably due to libdate-manip-perl=6.89-1 now issuing warnings in Manip/DM5.pm

Please consider using a different backend

-- System Information:
Debian Release: bookworm/sid
APT prefers unstable
APT policy: (500, 'unstable')
merged-usr: no
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.8.3-x86_64-linode137 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages munin depends on:
ii cron [cron-daemon] 3.0pl1-149
ii debconf [debconf-2.0] 1.5.79
ii fonts-dejavu-core 2.37-2
ii init-system-helpers 1.64
ii libdate-manip-perl 6.89-1
pn libdigest-md5-perl <none>
ii libfile-copy-recursive-perl 0.45-2
ii libhtml-template-perl 2.97-2
ii libio-socket-inet6-perl 2.73-1
ii liblog-log4perl-perl 1.55-1
ii librrds-perl 1.7.2-4+b3
pn libstorable-perl <none>
ii liburi-perl 5.12-1
ii lsb-base 11.2
ii munin-common 2.0.69-1
ii netbase 6.3
ii perl [libtime-hires-perl] 5.34.0-5
ii rrdtool 1.7.2-4+b3
ii systemd-sysv 251.4-3

Versions of packages munin recommends:
ii libcgi-fast-perl 1:2.15-1
ii munin-doc 2.0.69-1
ii munin-node 2.0.69-1

Versions of packages munin suggests:
ii apache2 [httpd] 2.4.54-2
ii elinks [www-browser] 0.13.2-1+b3
ii libapache2-mod-fcgid 1:2.3.9-4
ii libnet-ssleay-perl 1.92-2
ii links [www-browser] 2.27-1+b1
ii lynx [www-browser] 2.9.0dev.10-1
ii nginx-core [httpd] 1.22.0-3
ii nginx-full [httpd] 1.22.0-3
ii w3m [www-browser] 0.5.3+git20220429-1+b1

-- Configuration Files:
/etc/cron.d/munin [Errno 2] No such file or directory: '/etc/cron.d/munin'
/etc/munin/apache.conf changed [not included]

-- debconf information excluded

Nye Liu

unread,
Sep 7, 2022, 1:10:04 PM9/7/22
to
Is this block of code even needed still in munin-graph?

BEGIN {
    # This is needed because Date::Manip has deprecated the functional
    # interface in >= 6.x. So, we force the use of the 5.x API.
    $Date::Manip::Backend = 'DM5';

    # Double line here to avoid spurious warnings about D::M::Backend being
    # used only once.
    $Date::Manip::Backend = 'DM5';
}

Nye Liu

unread,
Sep 7, 2022, 8:10:04 PM9/7/22
to
munin-graph does not seem to use Date::Manip at all, unless there is a
hidden dependency that isn't obvious.

--- munin-graph.dist 2022-09-07 09:48:31.000000000 -0700
+++ munin-graph 2022-09-07 16:55:41.000000000 -0700
@@ -32,16 +32,6 @@
use warnings;
use IO::Handle;

-BEGIN {
- # This is needed because Date::Manip has deprecated the functional
- # interface in >= 6.x. So, we force the use of the 5.x API.
- $Date::Manip::Backend = 'DM5';
-
- # Double line here to avoid spurious warnings about D::M::Backend being
- # used only once.
- $Date::Manip::Backend = 'DM5';
-}
-use Date::Manip;
use POSIX qw(strftime);
use Time::HiRes qw(gettimeofday tv_interval);
use IO::File;

Holger Levsen

unread,
Sep 8, 2022, 10:30:04 AM9/8/22
to
control: severity -1 important
# getting mail every 5mins is really not acceptable
thanks

On Wed, Sep 07, 2022 at 04:59:17PM -0700, Nye Liu wrote:
> munin-graph does not seem to use Date::Manip at all, unless there is a
> hidden dependency that isn't obvious.

thank you for your bug report! have you tried your patch?


--
cheers,
Holger

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ holger@(debian|reproducible-builds|layer-acht).org
⢿⡄⠘⠷⠚⠋⠀ OpenPGP: B8BF54137B09D35CF026FE9D 091AB856069AAA1C
⠈⠳⣄

No mas pobres en un pais rico!
signature.asc

Nye Liu

unread,
Sep 8, 2022, 11:40:03 AM9/8/22
to
On 9/8/22 7:22 AM, Holger Levsen wrote:

> thank you for your bug report! have you tried your patch?
Yes, it seems to work (in cgi mode at least)

gregor herrmann

unread,
Sep 12, 2022, 12:50:04 PM9/12/22
to
On Wed, 07 Sep 2022 16:59:17 -0700, Nye Liu wrote:

> munin-graph does not seem to use Date::Manip at all, unless there is a
> hidden dependency that isn't obvious.

This also causes munin's autopkgtests to fail which blocks
libdate-manip-perl from migrating to testing.

Now it can be argued that Date::Manip sending warnings to STDERR is
not so clever but the old v5 interface _will_ be removed [0] so
munin has to do something at some point.

Originally I shared the impression that munin doesn't actively use
Date::Manip in the end:

% grep -ri Date::Manip
master/_bin/munin-cgi-graph.in: $Date::Manip::Backend = 'DM5';
master/_bin/munin-cgi-graph.in:use Date::Manip;
master/_bin/munin-graph.in: # This is needed because Date::Manip has deprecated the functional
master/_bin/munin-graph.in: $Date::Manip::Backend = 'DM5';
master/_bin/munin-graph.in: $Date::Manip::Backend = 'DM5';
master/_bin/munin-graph.in:use Date::Manip;
ChangeLog: Force usage of the DM5 Date::Manip backend

Looking at Date::Manip::Migration5to6(3pm): This document talks about
Date_Init(), Date_ConvTZ(), etc., and I don't find these two
functions anywhere in munin.

But, reading Date::Manip::DM5(3pm) and grepping a bit there's e.g.:

% grep -r ParseDateString
master/_bin/munin-cgi-graph.in: my $ifmodsec = &UnixDate (&ParseDateString ($since_string), "%s");
master/_bin/munin-graph.in: my $ifmodsec = &UnixDate (&ParseDateString ($since_string), "%s");

Not sure if other functions than ParseDateString and UnixDate are
used somewhere … At least those 2 should work the same with the
Date::Manip::DM6 backend.

Contrary to the comment in the code, v6 _has_ a functional
interface; cf. Date::Manip::Interfaces(3pm)). Which is not
deprecated. And:

From Date::Manip::Interfaces(3pm):

Use the default functional interface
By including:

use Date::Manip;

in your script, one of the functional interfaces will be
loaded. If you are running a version of perl older than 5.10,
it will automatically be the version 5 interface. If you are
running a newer version of perl, it will automatically load
the version 6 interface.


So something like

#v+
--- a/master/_bin/munin-cgi-graph.in
+++ b/master/_bin/munin-cgi-graph.in
@@ -25,10 +25,6 @@
use strict;
use warnings;
use IO::Handle;
-BEGIN {
- no warnings;
- $Date::Manip::Backend = 'DM5';
-}
use Date::Manip;
use POSIX qw(strftime locale_h);
use CGI::Fast qw(:cgi);
--- a/master/_bin/munin-graph.in
+++ b/master/_bin/munin-graph.in
@@ -32,15 +32,6 @@
use warnings;
use IO::Handle;

-BEGIN {
- # This is needed because Date::Manip has deprecated the functional
- # interface in >= 6.x. So, we force the use of the 5.x API.
- $Date::Manip::Backend = 'DM5';
-
- # Double line here to avoid spurious warnings about D::M::Backend being
- # used only once.
- $Date::Manip::Backend = 'DM5';
-}
use Date::Manip;
use POSIX qw(strftime);
use Time::HiRes qw(gettimeofday tv_interval);
#v-

might be enough.



Cheers,
gregor

[0] from Changes6.pod:
#=head1 VERSION 7.00 (expected 2024-12-01)
# Remove DM5

--
.''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
`-
signature.asc

Nye Liu

unread,
Sep 12, 2022, 1:10:04 PM9/12/22
to
On 9/12/22 9:42 AM, gregor herrmann wrote:

> On Wed, 07 Sep 2022 16:59:17 -0700, Nye Liu wrote:
>
>> munin-graph does not seem to use Date::Manip at all, unless there is a
>> hidden dependency that isn't obvious.
> This also causes munin's autopkgtests to fail which blocks
> libdate-manip-perl from migrating to testing.

Interesting; I suspected there was something I was missing, but could
not find it.

> use Date::Manip;
> use POSIX qw(strftime);
> use Time::HiRes qw(gettimeofday tv_interval);
> #v-
>
> might be enough.
Given the above, it would probably be a good idea to comment the `use
Date::Manip;` line to be explicit about why it is there in the first place.

gregor herrmann

unread,
Sep 12, 2022, 1:30:04 PM9/12/22
to
On Mon, 12 Sep 2022 10:07:54 -0700, Nye Liu wrote:

> > > munin-graph does not seem to use Date::Manip at all, unless there is a
> > > hidden dependency that isn't obvious.
> > This also causes munin's autopkgtests to fail which blocks
> > libdate-manip-perl from migrating to testing.
> Interesting; I suspected there was something I was missing, but could not
> find it.

Just to avoid a potential confusion: the autopkgtests fail becaause
of the deprecation warning on STDERR.


Cheers,
gregor
signature.asc

Adrian Immanuel Kiess

unread,
Sep 20, 2022, 11:20:03 AM9/20/22
to
Package: munin
Version: 2.0.69-1
Followup-For: Bug #1019343

Dear Maintainer,

I experience the same bug, since last upgrade of Munin on my local machine for
the local network, and on the Munin server on one of my virtual private
servers.

Both of these run Debian/testing.

The E-Mail which I am getting all 5 minutes, twice, because of two instances I
have running, is the following:

From: adr...@mx.aik.onl (Cron Daemon)
To: ro...@mx.aik.onl
Subject: Cron <munin@g6> if [ -x /usr/bin/munin-cron ]; then /usr/bin/munin-
cron; fi
Date: Tue, 20 Sep 2022 16:47:18 +0200

Date::Manip::DM5 is deprecated and will be removed from the Date::Manip package
starting in version 7.00 at (eval 5) line 1.

Thank you for working on this bug already.

With many greetings from Leipzig, Germany.

Sincerely,

Adrian Kiess


-- System Information:
Debian Release: bookworm/sid
APT prefers testing
APT policy: (990, 'testing')
merged-usr: no
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.19.0-1-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
ii chromium [www-browser] 105.0.5195.125-1
ii dillo [www-browser] 3.0.5-7+b1
ii elinks [www-browser] 0.13.2-1+b3
ii epiphany-browser [www-browser] 42.4-1
ii firefox-esr [www-browser] 102.2.0esr-1
ii konqueror [www-browser] 4:21.12.3-1
ii libapache2-mod-fcgid 1:2.3.9-4
ii libnet-ssleay-perl 1.92-2
ii links2 [www-browser] 2.27-1+b1
ii lynx [www-browser] 2.9.0dev.10-1+b1
ii netsurf-gtk [www-browser] 3.10-1+b3
ii w3m [www-browser] 0.5.3+git20220429-1+b1

-- Configuration Files:
/etc/munin/apache.conf changed:
Alias /munin /var/cache/munin/www
Alias /munin-cgi/static /var/cache/munin/www/static
ScriptAlias /munin-cgi /usr/lib/cgi-bin/munin-cgi-html
<Directory /var/cache/munin/www>
Order allow,deny
Allow from 192.168.0.0/24 localhost 127.0.0.0/8 ::1
Options None
# This file can be used as a .htaccess file, or a part of your apache
# config file.
#
# For the .htaccess file option to work the munin www directory
# (/var/cache/munin/www) must have "AllowOverride all" or something
# close to that set.
#
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
# This next part requires mod_expires to be enabled.
#

# Set the default expiration time for files to 5 minutes 10 seconds from
# their creation (modification) time. There are probably new files by
# that time.
#
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault M310
</IfModule>
</Directory>

/etc/munin/apache24.conf changed:
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
Alias /munin/static/ /var/cache/munin/www/static/
<Directory /var/cache/munin/www>
#Require local
Require all granted
Options None
</Directory>
<Directory /usr/lib/munin/cgi>
#Require local
Require all granted
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</Directory>
Alias /munin /var/cache/munin/www

/etc/munin/munin.conf changed:
includedir /etc/munin/munin-conf.d
timeout_fetch_all_nodes 240
timeout_fetch_one_node 180
[g6.lan.dac]
address localhost
use_node_name yes
[tdz2000.lan.dac]
address tdz2000.lan.dac
use_node_name yes
[m2n.lan.dac]
address m2n.lan.dac
use_node_name yes


-- debconf information:
munin/postrm_remove_rrd_files: false
0 new messages