Reminders do not work, please help

I’m trying to follow this guide and set up a crontab for the reminders module to work. https://docs.bestpractical.com/rt/4.4.3/reminders.html

I added the following into /etc/cron.d/rt file:

0 6 * * * root /opt/rt4/bin/rt-crontool
–search RT::Search::FromSQL
–search-arg ‘Type = “reminder” and (Status = “open” or Status = “new”)’
–condition RT::Condition::BeforeDue
–condition-arg 2d
–action RT::Action::SendEmail
–action-arg Owner
–transaction first
–template ‘Reminder’

Then I changed 0 6 * * * to * * * * * so it runs every minute so I can test it and make sure it works.
I changed --condition-arg 2d to --condition-arg 2h \ so it sends a reminder 2 hours before the reminder is due.

I create a reminder and when it’s 2 hours before due time, the reminder is not getting sent.

I thought it was a bad ‘Reminder’ template that was build into the RT templates. I tested it, putting it to a regular ticket update action, I update the ticket, and indeed, the ‘Reminder’ template does not work. Maybe because of some html error in the template. So I changed the template to ‘Transaction’ which is a known working template. It works when I create a new ticket.

Then I create another reminder, and when it’s 2 hours before due, the reminder still doesn’t work.

I also know that the other crontab jobs work because I tested it by setting the Full Text Index job to every minute, then create a new ticket with some unique words in it, and after a minute I can search for that word and it finds the ticket.

What could be wrong with my reminders setup then?

Also, I do not have mail gateway configured. In the RT documentation it says that all outgoing mail is handled by a built in utility. And I do receive emails about ticket notifications.

@GreenJimll
@Jeff_Voskamp
@Gerald_Sedrati-Dinet
@chmrr
@craig
@Guadagnino_Cristiano
@Les_Mikesell
@Mike_Friedman
@Mahoney_Tim

Maybe some of you experts will know this?

Have you tried running the command by hand and/or looking in the logs to see if there are any errors?

Yes. And you can also try what it does when you change the command to this:

/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL --search-arg ‘Type = “reminder” and (Status = “open” or Status = “new”)’ --condition RT::Condition::BeforeDue --condition-arg 2d --action RT::Action::Notify --action-arg Owner,AlwaysNotifyActor --transaction first --template ‘Reminder'

Hello,

I have the same problem when I ran the command the resolver can’t parse the URI with fsck_com_rt scheme I don’t understand why. I think it could be the regex because the $Organisation is like : domain.local and the WebURL looks like : “rt.domain.local”.

If you have any idea.

/usr/bin/rt-crontool --search RT::Search::FromSQL --search-arg ‘Type = “reminder” and (status = “open” or Status = “new”)’ --condition RT::Condition::BeforeDue --condition-arg 2d --action RT::Action::Notify --action-arg Owner,AlwaysNotifyActor --transaction first --template ‘Reminder’
[15059] [Mon Apr 8 12:39:33 2019] [warning]: Resolver RT::URI::fsck_com_rt could not parse fsck.com-rt://<domain.local>/ticket/228, maybe Organization config was changed? (/usr/share/request-tracker4/lib/RT/URI.pm:165)
Trace begun at /usr/share/request-tracker4/lib/RT.pm line 308
Log::Dispatch::ANON(‘Log::Dispatch=HASH(0x561346026b08)’, ‘Resolver RT::URI::fsck_com_rt could not parse fsck.com-rt://<domain.local>/ticket/228, maybe Organization config was changed?’) called at /usr/share/request-tracker4/lib/RT/URI.pm line 165
RT::URI::FromURI(‘RT::URI=HASH(0x561349295dd8)’, ‘fsck.com-rt://<domain.local>/ticket/228’) called at /usr/share/request-tracker4/lib/RT/Link.pm line 285
RT::link::TargetURI(‘RT::Link=HASH(0x561349298d50)’) called at /usr/share/request-tracker4/lib/RT/Links.pm line 164
RT::Links::IsValidLink(‘RT::Links=HASH(0x561349290f40)’, ‘RT::Link=HASH(0x561349298d50)’) called at /usr/share/request-tracker4/lib/RT/Links.pm line 145
RT::Links::AddRecord(‘RT::Links=HASH(0x561349290f40)’, ‘RT::Link=HASH(0x561349298d50)’) called at /usr/share/perl5/DBIx/SearchBuilder.pm line 247
DBIx::SearchBuilder::_DoSearch(‘RT::Links=HASH(0x561349290f40)’) called at /usr/share/request-tracker4/lib/RT/SearchBuilder.pm line 982
RT::SearchBuilder::_DoSearch(‘RT::Links=HASH(0x561349290f40)’) called at /usr/share/perl5/DBIx/SearchBuilder.pm line 513
DBIx::SearchBuilder::Next(‘RT::Links=HASH(0x561349290f40)’) called at /usr/share/perl5/DBIx/SearchBuilder.pm line 574
DBIx::SearchBuilder::First(‘RT::Links=HASH(0x561349290f40)’) called at template line 3
eval ‘package Text::Template::GEN0; ;
#line 3 template
$Target = $Ticket->RefersTo->First->TargetObj;$Target->id;’ at /usr/share/perl5/Text/Template.pm line 320
Text::Template::fill_in(‘Text::Template=HASH(0x5613492837c0)’, ‘HASH’, ‘HASH(0x561344fff800)’, ‘BROKEN’, ‘CODE(0x561349283b20)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 566
RT::Template::_ParseContentPerl(‘RT::Template=HASH(0x561349276c38)’, ‘Content’, ‘Subject:{$Ticket->Subject} is due {$Ticket->DueObj->AsString}^J^JThis reminder is for ticket #{$Target = $Ticket->RefersTo->First->TargetObj;$Target->id}.^J^J{RT->Config->Get(‘WebURL’)}Ticket/Display.html?id={$Target->id}^J’, ‘TemplateArgs’, ‘HASH(0x561344fff800)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 517
RT::Template::_ParseContent(‘RT::Template=HASH(0x561349276c38)’, ‘Argument’, ‘Owner,AlwaysNotifyActor’, ‘TicketObj’, ‘RT::Ticket=HASH(0x561349268ac0)’, ‘TransactionObj’, ‘RT::Transaction=HASH(0x56134927d1f8)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 435
RT::Template::_Parse(‘RT::Template=HASH(0x561349276c38)’, ‘Argument’, ‘Owner,AlwaysNotifyActor’, ‘TicketObj’, ‘RT::Ticket=HASH(0x561349268ac0)’, ‘TransactionObj’, ‘RT::Transaction=HASH(0x56134927d1f8)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 415
RT::Template::Parse(‘RT::Template=HASH(0x561349276c38)’, ‘Argument’, ‘Owner,AlwaysNotifyActor’, ‘TicketObj’, ‘RT::Ticket=HASH(0x561349268ac0)’, ‘TransactionObj’, ‘RT::Transaction=HASH(0x56134927d1f8)’) called at /usr/share/request-tracker4/lib/RT/Action/SendEmail.pm line 140
RT::Action::SendEmail::Prepare(‘RT::Action::Notify=HASH(0x561349273780)’) called at /usr/share/request-tracker4/lib/RT/Action/Notify.pm line 69
RT::Action::Notify::Prepare(‘RT::Action::Notify=HASH(0x561349273780)’) called at /usr/bin/rt-crontool line 228
main::process(‘RT::Ticket=HASH(0x561349268ac0)’, ‘RT::Transaction=HASH(0x56134927d1f8)’, ‘RT::Template=HASH(0x561349272f58)’) called at /usr/bin/rt-crontool line 167
[15059] [Mon Apr 8 12:39:33 2019] [warning]: Resolver RT::URI::fsck_com_rt could not parse fsck.com-rt://<domain.local>/ticket/228, maybe Organization config was changed? (/usr/share/request-tracker4/lib/RT/URI.pm:165)
Trace begun at /usr/share/request-tracker4/lib/RT.pm line 308
Log::Dispatch::ANON(‘Log::Dispatch=HASH(0x561346026b08)’, ‘Resolver RT::URI::fsck_com_rt could not parse fsck.com-rt://<domain.local>/ticket/228, maybe Organization config was changed?’) called at /usr/share/request-tracker4/lib/RT/URI.pm line 165
RT::URI::FromURI(‘RT::URI=HASH(0x561349294368)’, ‘fsck.com-rt://<domain.local>/ticket/228’) called at /usr/share/request-tracker4/lib/RT/Link.pm line 285
RT::link::TargetURI(‘RT::Link=HASH(0x561349298d50)’) called at /usr/share/request-tracker4/lib/RT/Link.pm line 296
RT::link::TargetObj(‘RT::Link=HASH(0x561349298d50)’) called at template line 3
eval ‘package Text::Template::GEN0; ;
#line 3 template
$Target = $Ticket->RefersTo->First->TargetObj;$Target->id;’ at /usr/share/perl5/Text/Template.pm line 320
Text::Template::fill_in(‘Text::Template=HASH(0x5613492837c0)’, ‘HASH’, ‘HASH(0x561344fff800)’, ‘BROKEN’, ‘CODE(0x561349283b20)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 566
RT::Template::_ParseContentPerl(‘RT::Template=HASH(0x561349276c38)’, ‘Content’, ‘Subject:{$Ticket->Subject} is due {$Ticket->DueObj->AsString}^J^JThis reminder is for ticket #{$Target = $Ticket->RefersTo->First->TargetObj;$Target->id}.^J^J{RT->Config->Get(‘WebURL’)}Ticket/Display.html?id={$Target->id}^J’, ‘TemplateArgs’, ‘HASH(0x561344fff800)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 517
RT::Template::_ParseContent(‘RT::Template=HASH(0x561349276c38)’, ‘Argument’, ‘Owner,AlwaysNotifyActor’, ‘TicketObj’, ‘RT::Ticket=HASH(0x561349268ac0)’, ‘TransactionObj’, ‘RT::Transaction=HASH(0x56134927d1f8)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 435
RT::Template::_Parse(‘RT::Template=HASH(0x561349276c38)’, ‘Argument’, ‘Owner,AlwaysNotifyActor’, ‘TicketObj’, ‘RT::Ticket=HASH(0x561349268ac0)’, ‘TransactionObj’, ‘RT::Transaction=HASH(0x56134927d1f8)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 415
RT::Template::Parse(‘RT::Template=HASH(0x561349276c38)’, ‘Argument’, ‘Owner,AlwaysNotifyActor’, ‘TicketObj’, ‘RT::Ticket=HASH(0x561349268ac0)’, ‘TransactionObj’, ‘RT::Transaction=HASH(0x56134927d1f8)’) called at /usr/share/request-tracker4/lib/RT/Action/SendEmail.pm line 140
RT::Action::SendEmail::Prepare(‘RT::Action::Notify=HASH(0x561349273780)’) called at /usr/share/request-tracker4/lib/RT/Action/Notify.pm line 69
RT::Action::Notify::Prepare(‘RT::Action::Notify=HASH(0x561349273780)’) called at /usr/bin/rt-crontool line 228
main::process(‘RT::Ticket=HASH(0x561349268ac0)’, ‘RT::Transaction=HASH(0x56134927d1f8)’, ‘RT::Template=HASH(0x561349272f58)’) called at /usr/bin/rt-crontool line 167
[15059] [Mon Apr 8 12:39:33 2019] [error]: Template parsing error: Can’t call method “id” on an undefined value at template line 3, line 755. (/usr/share/request-tracker4/lib/RT/Template.pm:562)
Trace begun at /usr/share/request-tracker4/lib/RT.pm line 308
Log::Dispatch::ANON(‘Log::Dispatch=HASH(0x561346026b08)’, ‘Template parsing error: Can’t call method “id” on an undefined value at template line 3, line 755.^J’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 562
RT::Template::ANON(‘text’, ‘$Target = $Ticket->RefersTo->First->TargetObj;$Target->id’, ‘error’, ‘Can’t call method “id” on an undefined value at template line 3, line 755.^J’, ‘lineno’, 3, ‘arg’, ‘ARRAY(0x561349287618)’) called at /usr/share/perl5/Text/Template.pm line 331
Text::Template::fill_in(‘Text::Template=HASH(0x5613492837c0)’, ‘HASH’, ‘HASH(0x561344fff800)’, ‘BROKEN’, ‘CODE(0x561349283b20)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 566
RT::Template::_ParseContentPerl(‘RT::Template=HASH(0x561349276c38)’, ‘Content’, ‘Subject:{$Ticket->Subject} is due {$Ticket->DueObj->AsString}^J^JThis reminder is for ticket #{$Target = $Ticket->RefersTo->First->TargetObj;$Target->id}.^J^J{RT->Config->Get(‘WebURL’)}Ticket/Display.html?id={$Target->id}^J’, ‘TemplateArgs’, ‘HASH(0x561344fff800)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 517
RT::Template::_ParseContent(‘RT::Template=HASH(0x561349276c38)’, ‘Argument’, ‘Owner,AlwaysNotifyActor’, ‘TicketObj’, ‘RT::Ticket=HASH(0x561349268ac0)’, ‘TransactionObj’, ‘RT::Transaction=HASH(0x56134927d1f8)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 435
RT::Template::_Parse(‘RT::Template=HASH(0x561349276c38)’, ‘Argument’, ‘Owner,AlwaysNotifyActor’, ‘TicketObj’, ‘RT::Ticket=HASH(0x561349268ac0)’, ‘TransactionObj’, ‘RT::Transaction=HASH(0x56134927d1f8)’) called at /usr/share/request-tracker4/lib/RT/Template.pm line 415
RT::Template::Parse(‘RT::Template=HASH(0x561349276c38)’, ‘Argument’, ‘Owner,AlwaysNotifyActor’, ‘TicketObj’, ‘RT::Ticket=HASH(0x561349268ac0)’, ‘TransactionObj’, ‘RT::Transaction=HASH(0x56134927d1f8)’) called at /usr/share/request-tracker4/lib/RT/Action/SendEmail.pm line 140
RT::Action::SendEmail::Prepare(‘RT::Action::Notify=HASH(0x561349273780)’) called at /usr/share/request-tracker4/lib/RT/Action/Notify.pm line 69
RT::Action::Notify::Prepare(‘RT::Action::Notify=HASH(0x561349273780)’) called at /usr/bin/rt-crontool line 228
main::process(‘RT::Ticket=HASH(0x561349268ac0)’, ‘RT::Transaction=HASH(0x56134927d1f8)’, ‘RT::Template=HASH(0x561349272f58)’) called at /usr/bin/rt-crontool line 167
(in cleanup) Can’t call method “_should_log” on an undefined value at /usr/share/perl5/Log/Dispatch.pm line 254, line 755 during global destruction.