Since upgrading perl to 5.40 I’ve been getting errors from my cron jobs.
I just upgraded RT to 5.0.8 (running on FreeBSD 14.2, RT installed from ports) but I’m still getting one error when I run rt-fulltext-indexer:
(in cleanup) Can't call method "_should_log" on an undefined value at /usr/local/lib/perl5/site_perl/Log/Dispatch.pm line 274, <DATA> line 960 during global destruction.
I’ve grepped through everything in rt code, and I can’t see it calling _should_log.
I found this in Log Dispatch changelog:
This version introduces some changes into the interface that will
cause incompatibility with any Log::Dispatch::Output interface you may
have created. However, it is fairly simple to fix. Simply change the
method in your subclass named ‘log’ to be called ‘log_message’. You
can also remove the line:
return unless $self->_should_log($params{level});
This is now done before the message ever gets to the Output subclass
(which is what it should have done in the first place, really.)
This was done so that I could allow per-Output object callbacks, a
feature which several people have requested and which seems useful
enough to warrant the breakage.
NOTE: This change is transparent if you are only using the Output
objects included with this distribution.
Any idea where to look?
Are you running Oracle as your database?
No, we’re running PostgreSQL
I think I have the same problem. Also FreeBSD 14.2, RT 5.0.8 from ports and Perl 5.40; but MySQL rather than PostgreSQL.
I temporarily hacked would_log() in /usr/local/lib/perl5/site_perl/Log/Dispatch.pm to use Carp and cluck() if $ is undefined. This resulted in the output below.
Searching for the “DBI dr handle … cleared whilst still active” error leads to these bugs:
I’m building a set of FreeBSD packages with Perl 5.38 to see whether that would be a workaround.
$ perl -Mdiagnostics=-t,-w /usr/local/sbin/rt-fulltext-indexer
at /usr/local/lib/perl5/site_perl/Log/Dispatch.pm line 276, line 960.
Log::Dispatch::_would_log(Log::Dispatch=HASH(0x22d7ac1db6f0), 3) called at /usr/local/lib/perl5/site_perl/Log/Dispatch.pm line 167
Log::Dispatch::_log_with_num(Log::Dispatch=HASH(0x22d7ac1db6f0), 3, “level”, “warning”, “message”, “DBI dr handle 0x22d7ab4efdb0 cleared whilst still active, <DA”…) called at /usr/local/lib/perl5/site_perl/Log/Dispatch.pm line 157
Log::Dispatch::log(undef, “level”, “warning”, “message”, “DBI dr handle 0x22d7ab4efdb0 cleared whilst still active, <DA”…) called at /usr/local/sbin/rt-fulltext-indexer line 0
eval {…} called at /usr/local/sbin/rt-fulltext-indexer line 0
(in cleanup) Can’t call method “_should_log” on an undefined value at /usr/local/lib/perl5/site_perl/Log/Dispatch.pm line 278, line 960 during global destruction.
1 Like