I have a Perl script on Nagios server checking iLO status of remote servers. It worked fine since 2015; however, since midnight on 1 January 2025, it crashes with the following error:
Day too big - 38351 > 24855
Sec too small - 38351 < 74752
Sec too big - 38351 > 11647
Cannot handle date (0, 0, 0, 1, 0, 2075) at /usr/lib/perl5/site_perl/5.8.8/Math/Calc/Units/Convert/Date.pm line 7
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/Math/Calc/Units/Convert/Multi.pm line 12.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/Math/Calc/Units/Convert.pm line 7.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/Math/Calc/Units/Convert.pm line 7.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/Math/Calc/Units/Compute.pm line 10.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/Math/Calc/Units/Compute.pm line 10.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/Math/Calc/Units.pm line 3.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/Math/Calc/Units.pm line 3.
Compilation failed in require at /usr/lib/perl5/5.8.8/Monitoring/Plugin/Functions.pm line 12.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.8/Monitoring/Plugin/Functions.pm line 12.
Compilation failed in require at /usr/lib/perl5/5.8.8/Monitoring/Plugin.pm line 3.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.8/Monitoring/Plugin.pm line 3.
Compilation failed in require at ./check_ilo2_health.pl line 143.
BEGIN failed--compilation aborted at ./check_ilo2_health.pl line 143.
As I'm not familiar with Perl, it's not clear to me why it should fail on Line 7 in Date.pm
package Math::Calc::Units::Convert::Date;
use base 'Math::Calc::Units::Convert::Base';
use Time::Local qw(timegm);
use strict;
use vars qw(%units %pref %ranges %total_unit_map);
my $min_nice_time = timegm(0, 0, 0, 1, 0, 1975-1900);
my $max_nice_time = timegm(0, 0, 0, 1, 0, 2030-1900);
I understand that components are outdated, but this solution described above worked for 10 years so far.
Was there any specific issue with Perl 5.8.8? Can anyone suggest how to debug this?
To resolve this issue, I had no choice but to manually apply the patch mentioned above (comment by Toolic):
https://rt.cpan.org/Public/Bug/Display.html?id=124521
Directly in .../perl5/vendor_perl/Math/Calc/Units/Convert/Date.pm
my $min_nice_time = timegm(0, 0, 0, 1, 0, 1975-1900);
my $max_nice_time = timegm(0, 0, 0, 1, 0, 2030-1900);
Change it to:
my $min_nice_time = timegm(0, 0, 0, 1, 0, 1975);
my $max_nice_time = timegm(0, 0, 0, 1, 0, 2030);
And also:
my $timestamp = timegm($s, $m, $h, $d, $M, $y-1900);
->
my $timestamp = timegm($s, $m, $h, $d, $M, $y);