Require of RT::Condition::AnyTransaction condition module failed

I’m trying to dig my way through an error state that is confusing on several levels.

I have a RT 5.0.2 (yes I know, let me fix this before doing an upgrade) server set up in a Docker container. I’m taking over maintenance. Recently we noticed that outbound email is not happening at all. After doing some debugging, it seems that the AnyTransaction.pm file is failing to pass the require check for some reason. I have no idea why. All I have is a stack trace.

[78] [Sat Dec 23 19:21:19 2023] [error]: Scrip IsApplicable 14 died. - Require of RT::Condition::AnyTransaction condition module failed.
Attempt to reload RT/Condition/AnyTransaction.pm aborted.
Compilation failed in require at /opt/rt5/sbin/../lib/RT/ScripCondition.pm line 179.

Stack:
  [/opt/rt5/sbin/../lib/RT/ScripCondition.pm:179]
  [/opt/rt5/sbin/../lib/RT/ScripCondition.pm:179]
  [/opt/rt5/sbin/../lib/RT/Scrip.pm:594]
  [/opt/rt5/sbin/../lib/RT/Scrips.pm:333]
  [/opt/rt5/sbin/../lib/RT/Transaction.pm:194]
  [/opt/rt5/sbin/../lib/RT/Record.pm:1686]
  [/opt/rt5/sbin/../lib/RT/Ticket.pm:1734]
  [/opt/rt5/sbin/../lib/RT/Ticket.pm:1613]
  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:2555]
  [/opt/rt5/share/html/Ticket/Display.html:203]
  [/opt/rt5/share/html/Ticket/Display.html:216]
  [/opt/rt5/share/html/Ticket/Update.html:448]
  [/opt/rt5/share/html/Ticket/autohandler:66]
  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:719]
  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:398]
  [/opt/rt5/share/html/autohandler:53]


Stack:
  [/opt/rt5/sbin/../lib/RT/ScripCondition.pm:179]
  [/opt/rt5/sbin/../lib/RT/Scrip.pm:594]
  [/opt/rt5/sbin/../lib/RT/Scrips.pm:333]
  [/opt/rt5/sbin/../lib/RT/Transaction.pm:194]
  [/opt/rt5/sbin/../lib/RT/Record.pm:1686]
  [/opt/rt5/sbin/../lib/RT/Ticket.pm:1734]
  [/opt/rt5/sbin/../lib/RT/Ticket.pm:1613]
  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:2555]
  [/opt/rt5/share/html/Ticket/Display.html:203]
  [/opt/rt5/share/html/Ticket/Display.html:216]
  [/opt/rt5/share/html/Ticket/Update.html:448]
  [/opt/rt5/share/html/Ticket/autohandler:66]
  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:719]
  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:398]
  [/opt/rt5/share/html/autohandler:53] (/opt/rt5/sbin/../lib/RT/Scrip.pm:607)
Trace begun at /opt/rt5/sbin/../lib/RT.pm line 314
Log::Dispatch::__ANON__('Log::Dispatch=HASH(0x5604fdb8a2d0)', 'Scrip IsApplicable 14 died. - Require of RT::Condition::AnyTransaction condition module failed.^JAttempt to reload RT/Condition/AnyTransaction.pm aborted.^JCompilation failed in require at /opt/rt5/sbin/../lib/RT/ScripCondition.pm line 179.^J^JStack:^J  [/opt/rt5/sbin/../lib/RT/ScripCondition.pm:179]^J  [/opt/rt5/sbin/../lib/RT/ScripCondition.pm:179]^J  [/opt/rt5/sbin/../lib/RT/Scrip.pm:594]^J  [/opt/rt5/sbin/../lib/RT/Scrips.pm:333]^J  [/opt/rt5/sbin/../lib/RT/Transaction.pm:194]^J  [/opt/rt5/sbin/../lib/RT/Record.pm:1686]^J  [/opt/rt5/sbin/../lib/RT/Ticket.pm:1734]^J  [/opt/rt5/sbin/../lib/RT/Ticket.pm:1613]^J  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:2555]^J  [/opt/rt5/share/html/Ticket/Display.html:203]^J  [/opt/rt5/share/html/Ticket/Display.html:216]^J  [/opt/rt5/share/html/Ticket/Update.html:448]^J  [/opt/rt5/share/html/Ticket/autohandler:66]^J  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:719]^J  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:398]^J  [/opt/rt5/share/html/autohandler:53]^J^J^JStack:^J  [/opt/rt5/sbin/../lib/RT/ScripCondition.pm:179]^J  [/opt/rt5/sbin/../lib/RT/Scrip.pm:594]^J  [/opt/rt5/sbin/../lib/RT/Scrips.pm:333]^J  [/opt/rt5/sbin/../lib/RT/Transaction.pm:194]^J  [/opt/rt5/sbin/../lib/RT/Record.pm:1686]^J  [/opt/rt5/sbin/../lib/RT/Ticket.pm:1734]^J  [/opt/rt5/sbin/../lib/RT/Ticket.pm:1613]^J  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:2555]^J  [/opt/rt5/share/html/Ticket/Display.html:203]^J  [/opt/rt5/share/html/Ticket/Display.html:216]^J  [/opt/rt5/share/html/Ticket/Update.html:448]^J  [/opt/rt5/share/html/Ticket/autohandler:66]^J  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:719]^J  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:398]^J  [/opt/rt5/share/html/autohandler:53]^J') called at /opt/rt5/sbin/../lib/RT/Scrip.pm line 607

Where else can I dig to determine why this scrip is failing?

That’s a surprise, the module is rather simple. What happens if you run: perl -I/opt/rt5/lib -c /opt/rt5/lib/RT/Condition/AnyTransaction.pm

Cheers,
Andrew

Thank you for the response. I was wondering how to run each bit of code in isolation.

The answer to your question is as follows

Can't modify undef operator in scalar assignment at /opt/rt5/lib/RT/Condition.pm line 202, near "undef;"
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl-base/base.pm line 135.
	...propagated at /usr/lib/x86_64-linux-gnu/perl-base/base.pm line 157.
BEGIN failed--compilation aborted at /opt/rt5/lib/RT/Condition/AnyTransaction.pm line 50.

and that error seems to point to this in Condition.pm

sub DESTROY {
    my $self = shift;

    # We need to clean up all the references that might maybe get
    # oddly circular
    $self->{'TemplateObj'} =undef
    $self->{'TicketObj'} = undef;
    $self->{'TransactionObj'} = undef;
    $self->{'ScripObj'} = undef;

}

Let me try correcting that missing semicolon and see if this fixes things

Yeah, that should fix it. Was fixed in commit 8c00018ab32527460d51c1dcfc12c18fbfbec097 which was included in 4.4.6 and 5.0.3.

That was indeed the fix I needed.

I will look at doing an upgrade in the new year, but it looks like our prior admin customized the system just enough to make it difficult to just replace the container with a new version.

Good to hear you fixed it.

Ugh, the joys of customisations in the wrong place! You might be interested in this conference talk by the BP folks on customising Perl (using RT as an example): Did you miss the Perl and Raku Conference last week?