Critical error after upgrading to RT 4.4.0

Yesterday I upgraded from RT 4.2.12 to RT 4.4.0.

Today I am sometimes getting errors like this:

[30091] [Wed Jun 1 09:13:03 2016] [critical]: Couldn’t create ticket groups for ticket 133221. aborting Ticket creation. (/opt/rt4/sbin/…/lib/RT/Ticket.pm:444)

[30091] [Wed Jun 1 09:13:03 2016] [crit]: Ticket creation failed: I: AGG MAGGIO 2016.xlsx: Ticket could not be created due to an internal error (/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:
697)

I am having difficulty understanding where the problem is (what’s the meaning of “ticket groups”?) and hence how to solve it.

Please help!!!

Cris

Hi Cris,

Yesterday I upgraded from RT 4.2.12 to RT 4.4.0.

Today I am sometimes getting errors like this:

[30091] [Wed Jun 1 09:13:03 2016] [critical]: Couldn’t create ticket groups for ticket
133221. aborting Ticket creation. (/opt/rt4/sbin/…/lib/RT/Ticket.pm:444)

[30091] [Wed Jun 1 09:13:03 2016] [crit]: Ticket creation failed: I: AGG MAGGIO 2016.xlsx:
Ticket could not be created due to an internal error (/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:
697)

This is the first we’ve seen of this error. :confused: If you can send over a stack trace that will help track it down. Adding this to your site config will do so:

Set($LogStackTraces, “error");

I am having difficulty understanding where the problem is (what’s the meaning of “ticket
groups”?) and hence how to solve it.

Ticket groups are the groups that contain AdminCcs, Ccs, Requestors, etc.

Please help!!!

Do you have any customizations? Which extensions are installed? And which database are you on?

Cris

Best of luck,
Shawn

Hi Shawn!

This is the first we’ve seen of this error. :confused: If you can send over a stack

trace that will help track it down. Adding this to your site config will do

so:

Set($LogStackTraces, “error");

OK, I put it in. Fortunately the error is quite sporadic (one or two times a day), so it will be sometime before I get a stack trace.

Where do I find stack traces when they are generated?

I am having difficulty understanding where the problem is (what’s the

meaning of “ticket groups”?) and hence how to solve it.

Ticket groups are the groups that contain AdminCcs, Ccs, Requestors, etc.

Uhm. The only thing I can think of is that I have added a custom role. Maybe this is the thing that’s giving me problems?

Apparently however the custom role is behaving well.

Do you have any customizations? Which extensions are installed? And which

database are you on?

I have these plugins:

Plugin(‘RT::Extension::ExtractCustomFieldValues’);
Plugin(‘RT::Extension::ReportSpam’);
Plugin(‘RT::Extension::CustomFieldsOnUpdate’);
Plugin(‘RT::Extension::Announce’);

Plus, I have a few customizations:

I am on mysql 5.1.73 (CentOS 6.7)

Thank you!

Cris

Plus, I have a few customizations:

  • show status and priority in color

Thats interesting :slight_smile:

I’m running 4.4.0 too and also an upgrade from but from 4.0.X but I
can’t get to show status in color.
I had the extended_status coloring from the wiki but that doesn’t work
anymore. I had a quick look but at the moment I’m swamped by other stuff
than RT :frowning:

Can you share your mods?

TIA,

Joop

Sorry Joop,

it’s the same here.

I still have colored priority labels, but the status label isn’t colored anymore starting from 4.0.x.

As I’m swamped, too, I don’t have the time to remove that customization since it seems it doesn’t do any harm besides being non-functional.

CrisIl lunedì 6 giugno 2016 alle 10:56:06 CEST, Joop ha scritto:

On 6-6-2016 10:09, Guadagnino Cristiano wrote:

Plus, I have a few customizations:

  • show status and priority in color

Thats interesting :slight_smile:

I’m running 4.4.0 too and also an upgrade from but from 4.0.X but I can’t get to show status in color.
I had the extended_status coloring from the wiki but that doesn’t work anymore. I had a quick look but at the moment I’m swamped by other stuff than RT :frowning:

Can you share your mods?

TIA,

Joop

Hi Shawn!

Hi Cris,

Uhm. The only thing I can think of is that I have added a custom role. Maybe this is the thing
that’s giving me problems?

Apparently however the custom role is behaving well.

I replicated the issue (it happens when a user has CreateTicket but not ShowTicket) and I believe I’ve fixed it. Can you try the following patch?

The fix will be included as part of RT 4.4.1 as this is definitely a blocker!

Thank you!

Cris

Thanks for helping track this down, and sorry about the trouble.

Cheers,
Shawn

Hi Shawn,
I applied the patch a few days ago and it seems to be working quite well!

Thank you!
CrisIl venerdì 10 giugno 2016 alle 16:11:54 CEST, Shawn Moore ha scritto:

On 2016年6月6日 at 4:14:57, Guadagnino Cristiano (guadagnino.cristiano@creval.it) wrote:

Hi Shawn!

Hi Cris,

Uhm. The only thing I can think of is that I have added a custom role.
Maybe this is the thing that’s giving me problems?

Apparently however the custom role is behaving well.

I replicated the issue (it happens when a user has CreateTicket but not
ShowTicket) and I believe I’ve fixed it. Can you try the following patch?

Avoid failure to create tickets due to custom role rights · bestpractical/rt@5d0a88d · GitHub
2aff423

The fix will be included as part of RT 4.4.1 as this is definitely a
blocker!

Thank you!

Cris

Thanks for helping track this down, and sorry about the trouble.

Cheers,
Shawn

RT 4.4 and RTIR Training Sessions https://bestpractical.com/training

  • Los Angeles - September, 2016

Hi Joop,

I just finished rewriting the show status in color to work with RT 4.4.2. I ended up converting the inline CSS to inline style instead. Here is the working code that needs to be called Once in the same location as before. Note: None of the *.css file changes are needed now because I have rolled up their content into the Once file. Here is the path to the file I am using:

./local/html/Callbacks/MyCallbacks/Elements/RT__Ticket/ColumnMap

Hope this is of use.

Regards,
Ken


<%INIT>

Show status in colour using inline style.

sub statusInColor {
my $Ticket = shift;
my $status = $Ticket->Status;
my %style = (
new => ‘color: #bb0000; text-align: left; font-weight: bold;’,
open => ‘color: #0000bb; text-align: left; font-weight: bold;’,
reply => ‘color: #009900; text-align: left; font-weight: bold;’,
resolved => ‘color: #737373; text-align: left; font-weight: bold;’,
rejected => ‘color: #884444; text-align: left; font-weight: bold;’,
stalled => ‘color: #884444; text-align: left; font-weight: bold;’
);

  	my $LastUpdater = $Ticket->LastUpdatedByObj->EmailAddress;
  	my $TicketRequestors = $Ticket->Requestors->MemberEmailAddressesAsString;
  	my $TicketCC = $Ticket->Cc->MemberEmailAddressesAsString;
  	my $CurrentUser = $session{'CurrentUser'}->EmailAddress;
  
  # Added $CurentUser ne $LastUpdater to prevent showing New Reply tag when the last updater is the current user.
  	if (($CurrentUser ne $LastUpdater) && ($TicketRequestors =~ $LastUpdater) || ($TicketCC =~ $LastUpdater))
  	{
  		my $txn = $Ticket->SeenUpTo or return \"<div style=\"$style{$status}\">$status</div>";
  #       my $TicketLink = RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id. "#txn-".$txn->id;
  # Comment out the line above and uncomment the following line to mark posts as seen when following link.
	my $TicketLink = RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id ."&MarkAsSeen=1&Anchor=txn-" . $txn->id;
  		$status = "<div style=\"$style{$status}\">$status <a href=\"$TicketLink\"><span style=\"$style{'reply'}\">New Reply</span></a></div>";
  	}
  	else {
  		$status = "<div style=\"$style{$status}\">$status</div>";
  	}
  
  	return \"$status";

}

Show extended status in colour. This will change the front page and other search pages where the ExtendedStatus is displayed.

sub extStatusInColor {
my $Ticket = shift;
if ( my $count = $Ticket->HasUnresolvedDependencies ) {
my $status;

  		if ( $Ticket->HasUnresolvedDependencies( Type => 'approval' )
  				or $Ticket->HasUnresolvedDependencies( Type => 'code' ) ) {
  			$status = "<em>" . loc('(pending approval)') . "</em>";
  		} else {
  			$status = "<em>" . loc('(pending [quant,_1,other ticket])',$count) . "</em>";
  			}
  		return \$status;
  	} else {
  		return statusInColor($Ticket);
  
  	}

}

Set the priority numbers to a colour.

sub PriorityInColor {
my $Ticket = shift;

  	my $priority = $Ticket->Priority;
  	my $colors = undef;
  
  # Change priority numbers to reflect your priority system.
  	if ($priority >= '50') {
  		$colors = "#FF0000";
  	} elsif ($priority >= '45') {
  		$colors = "#FF2000";
  	} elsif ($priority >= '40') {
  		$colors = "#FF4000";
  	} elsif ($priority >= '35') {
  		$colors = "#FF6A00";
  	} elsif ($priority >= '30') {
  		$colors = "#FF6600";
  	} elsif ($priority >= '25') {
  		$colors = "#FFA000";
  	} elsif ($priority >= '20') {
  		$colors = "#0033CC";
  	} elsif ($priority >= '15') {
  		$colors = "#809FFE";
  	} elsif ($priority >= '10') {
  		$colors = "#004600";
  	} elsif ($priority >= '5') {
  		$colors = "#006400";
  	} elsif ($priority >= '0') {
  		$colors = "#009000";
  	}
  
  	if ($colors) {
  		$priority = "<div style=\"color: $colors;\">$priority</div>"
  	}
  
  		return \"<b>$priority</b>";

}

Comment out any line to disable colour change.

$COLUMN_MAP->{Priority}->{value} = &PriorityInColor;
$COLUMN_MAP->{Status}->{value} = &statusInColor;
$COLUMN_MAP->{ExtendedStatus}->{value} = &extStatusInColor;

</%INIT>
<%ARGS>
$COLUMN_MAP => undef
</%ARGS>

Thanks, will look into it the next few days.

Regards,

Joop

Hi,

Here is an update with an additional check that LastUpdater exists to keep from filling the log with noise.

Regards,
Ken


<%INIT>

Show status in colour using inline style.

sub statusInColor {
my $Ticket = shift;
my $status = $Ticket->Status;
my %style = (
new => ‘color: #bb0000; text-align: left; font-weight: bold;’,
open => ‘color: #0000bb; text-align: left; font-weight: bold;’,
reply => ‘color: #009900; text-align: left; font-weight: bold;’,
resolved => ‘color: #737373; text-align: left; font-weight: bold;’,
rejected => ‘color: #884444; text-align: left; font-weight: bold;’,
stalled => ‘color: #884444; text-align: left; font-weight: bold;’
);

  	my $LastUpdater = $Ticket->LastUpdatedByObj->EmailAddress;
  	my $TicketRequestors = $Ticket->Requestors->MemberEmailAddressesAsString;
  	my $TicketCC = $Ticket->Cc->MemberEmailAddressesAsString;
  	my $CurrentUser = $session{'CurrentUser'}->EmailAddress;
  
  # Added $CurentUser ne $LastUpdater to prevent showing New Reply tag when the last updater is the current user.
  	if ( defined $LastUpdater )
    {
  	    if (($CurrentUser ne $LastUpdater) && ($TicketRequestors =~ "\Q$LastUpdater\E") || ($TicketCC =~ "\Q$LastUpdater\E"))
  	    {
  		my $txn = $Ticket->SeenUpTo or return \"<div style=\"$style{$status}\">$status</div>";
  #         my $TicketLink = RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id. "#txn-".$txn->id;
  # Comment out the line above and uncomment the following line to mark posts as seen when following link.
	my $TicketLink = RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id ."&MarkAsSeen=1&Anchor=txn-" . $txn->id;
  		$status = "<div style=\"$style{$status}\">$status <a href=\"$TicketLink\"><span style=\"$style{'reply'}\">New Reply</span></a></div>";
        }
        else {
  		$status = "<div style=\"$style{$status}\">$status</div>";
        }
  	}
  	else {
  		$status = "<div style=\"$style{$status}\">$status</div>";
  	}
  
  	return \"$status";

}

Show extended status in colour. This will change the front page and other search pages where the ExtendedStatus is displayed.

sub extStatusInColor {
my $Ticket = shift;
if ( my $count = $Ticket->HasUnresolvedDependencies ) {
my $status;

  		if ( $Ticket->HasUnresolvedDependencies( Type => 'approval' )
  				or $Ticket->HasUnresolvedDependencies( Type => 'code' ) ) {
  			$status = "<em>" . loc('(pending approval)') . "</em>";
  		} else {
  			$status = "<em>" . loc('(pending [quant,_1,other ticket])',$count) . "</em>";
  			}
  		return \$status;
  	} else {
  		return statusInColor($Ticket);
  
  	}

}

Set the priority numbers to a colour.

sub PriorityInColor {
my $Ticket = shift;

  	my $priority = $Ticket->Priority;
  	my $colors = undef;
  
  # Change priority numbers to reflect your priority system.
  	if ($priority >= '50') {
  		$colors = "#FF0000";
  	} elsif ($priority >= '45') {
  		$colors = "#FF2000";
  	} elsif ($priority >= '40') {
  		$colors = "#FF4000";
  	} elsif ($priority >= '35') {
  		$colors = "#FF6A00";
  	} elsif ($priority >= '30') {
  		$colors = "#FF6600";
  	} elsif ($priority >= '25') {
  		$colors = "#FFA000";
  	} elsif ($priority >= '20') {
  		$colors = "#0033CC";
  	} elsif ($priority >= '15') {
  		$colors = "#809FFE";
  	} elsif ($priority >= '10') {
  		$colors = "#004600";
  	} elsif ($priority >= '5') {
  		$colors = "#006400";
  	} elsif ($priority >= '0') {
  		$colors = "#009000";
  	}
  
  	if ($colors) {
  		$priority = "<div style=\"color: $colors;\">$priority</div>"
  	}
  
  		return \"<b>$priority</b>";

}

Comment out any line to disable colour change.

$COLUMN_MAP->{Priority}->{value} = &PriorityInColor;
$COLUMN_MAP->{Status}->{value} = &statusInColor;
$COLUMN_MAP->{ExtendedStatus}->{value} = &extStatusInColor;

</%INIT>
<%ARGS>
$COLUMN_MAP => undef
</%ARGS>

Thanks for the update Ken. Anyway you can put this onto github so I don’t have to copy/paste it out of the forum?

Good day.
I found your post and try update my 4.4.4 with your code and no luck - in rt.log I see next:

[14193] [Tue Jul 30 12:36:30 2019] [error]: Can't locate object method "Priority" via package "COLUMN_MAP" (perhaps you forgot to load "COLUMN_MAP"?) at /opt/rt4/local/html/Callbacks/MyCallbacks/Elements/RT__Ticket/ColumnMap/Once line 87.

Stack:
  [/opt/rt4/local/html/Callbacks/MyCallbacks/Elements/RT__Ticket/ColumnMap/Once:87]
  [/opt/rt4/local/html/Callbacks/MyCallbacks/Elements/RT__Ticket/ColumnMap/Once:120]
  [/opt/rt4/share/html/Elements/RT__Ticket/ColumnMap:355]
  [/opt/rt4/share/html/Elements/ColumnMap:274]
  [/opt/rt4/share/html/Elements/CollectionAsTable/Header:100]
  [/opt/rt4/share/html/Elements/CollectionList:123]
  [/opt/rt4/share/html/Search/Results.html:63]
  [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:697]
  [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:376]
  [/opt/rt4/share/html/autohandler:53] (/opt/rt4/sbin/../lib/RT/Interface/Web/Handler.pm:209)

What I do wrong?

That’s custom code but based on the error you are calling the Priority method on an object that does not have that method

Can someone help fix this?

Can you share the code in the Once callback?

thanks for reply. my post was a reply on post with code - Critical error after upgrading to RT 4.4.0 - #10 by ktm

Try making the above:

$COLUMN_MAP->{Priority}->{value} = \&PriorityInColor;
$COLUMN_MAP->{Status}->{value} = \&statusInColor;
$COLUMN_MAP->{ExtendedStatus}->{value} = \&extStatusInColor;

In the original wiki post it looks like sub refs where used

thanks. it’s solved my problem.

1 Like