Scrubber.pm error on ticket display

Hi there,

I’m running into an issue with my RT 5.0 installation. If I tail my syslog, RT is reporting the following error when I go to the ticket display page (Ticket/Display.html):

Sep 15 16:50:03 tickets RT: [1116] Use of uninitialized value in pattern match (m//) at /usr/local/share/perl/5.28.1/HTML/Scrubber.pm line 223.

The page appears to load correctly but this error repeats in my syslog several times each time a ticket is viewed. Any ideas?

I’m running RT 5.0 on Debian 10. Please let me know if any other information is necessary. I appreciate any and all help and advice. Thanks!

1 Like

I am getting this in my syslogs as well. Did you ever find what causes these uinintialized perl errors ?

Hi,
Same here on 5.0.2 , anyone fixed it ?

Hello,

Same here on 5.0.2, Perl 5.32. It’s really filling up the syslog.

How does one go at debugging it? Here it is the function and line mentioned:

sub _validate {
    my ( $s, $t, $r, $a, $as ) = @_;
    return "<$t>" unless %$a;

    $r = $s->{_rules}->{$r};
    my %f;

    for my $k ( keys %$a ) {
        my $check = exists $r->{$k} ? $r->{$k} : exists $r->{'*'} ? $r->{'*'} : next;

        if ( ref $check eq 'CODE' ) {
            my @v = $check->( $s, $t, $k, $a->{$k}, $a, \%f );
            next unless @v;
            $f{$k} = shift @v;
        }
        elsif ( ref $check || length($check) > 1 ) {
            $f{$k} = $a->{$k} if $a->{$k} =~ m{$check}; # <-- HERE, line 223, Scrubber.pm
        }
        elsif ($check) {
            $f{$k} = $a->{$k};
        }
    }

    if (%f) {
        my %seen;
        return "<$t $r>"
            if $r = join ' ', map {
            defined $f{$_}
                ? qq[$_="] . encode_entities( $f{$_} ) . q["]
                : $_;    # boolean attribute (TODO?)
            } grep { exists $f{$_} and !$seen{$_}++; } @$as;
    }

    return "<$t>";
}

You could try changing that line to:

$f{$k} = $a->{$k} if( $a->{$k} && $check && $a->{$k} =~ m{$check});

and see if that help?

2 Likes

It did help!

I’ll keep testing, but so far so good.

Thank you very much, GreenJimll!