Can't load UntouchedInHours module

I’m working with Request Tracker 4.0.7 on Debian Wheezy 7.0.1 and am attempting to configure rt-crontool and UntouchedInHours.pm as presented on the Wiki (http://requesttracker.wikia.com/wiki/UntouchedInHours)

I’m running the following rt-crontool command:

/usr/bin/rt-crontool
–search RT::Search::FromSQL
–search-arg “Queue = ‘1’ AND (Status = ‘new’ OR Status = ‘open’ ) AND Owner != ‘Nobody’”
–condition RT::Condition::UntouchedInHours --condition-arg 4
–action RT::Action::SendEmail
–template “Custom - Untouched Ticket Notification”
–transaction ‘last’
–transaction-type ‘Correspond,Comment,Status’
–verbose echo “”

Which returns the following result:

[Thu Aug 29 17:32:17 2013] [critical]: Failed to load module RT::Condition::UntouchedInHours. () at /usr/bin/rt-crontool line 307. (/usr/share/request-tracker4/lib/RT.pm:351)
Failed to load module RT::Condition::UntouchedInHours. () at /usr/bin/rt-crontool line 307.

I’m taking that to mean that there is a programming pub in UntouchedInHours.pm that is preventing it from being called correctly but for the life of me I can’t seem to find it anywhere. It was copied verbatim from the Wiki:

root@DorJnuASD-RT:~/Bin# cat /usr/share/request-tracker4/lib/RT/Condition/UntouchedInHours.pm

package RT::Condition::UntouchedInHours;
require RT::Condition::Generic;

use RT::Date;

@ISA = qw(RT::Condition::Generic);

use strict;
use vars qw/@ISA/;

sub IsApplicable {
my $self = shift;

             if ((time()-$self->TicketObj->LastUpdatedObj->Unix)/3600 >= $self->Argument) {
                    return 1;
             }
             else {
                    return 0;
            }

}

The following could be omitted. They’re there to allow overrides from Vendor and Local

but as this isn’t a core module, they’re just there for completeness :slight_smile:

eval “require RT::Condition::UntouchedInHours_Vendor”;
die $@ if ($@ && $@ !~ qr{^Can’t locate RT/Condition/UntouchedInHours_Vendor.pm});
eval “require RT::Condition::UntouchedInHours_Local”;
die $@ if ($@ && $@ !~ qr{^Can’t locate RT/Condition/UntouchedInHours_Local.pm});

1;

The permissions look appropriate as well:

root@DorJnuASD-RT:~/Bin# ls -la /usr/share/request-tracker4/lib/RT/Condition/
total 60
drwxr-xr-x 2 root root 4096 Aug 29 09:24 .
drwxr-xr-x 17 root root 4096 Jun 11 11:27 …
-rw-r–r-- 1 root root 2247 May 22 09:49 AnyTransaction.pm
-rw-r–r-- 1 root root 2742 May 22 09:49 BeforeDue.pm
-rw-r–r-- 1 root root 2677 May 22 09:49 CloseTicket.pm
-rw-r–r-- 1 root root 2475 May 22 09:49 Overdue.pm
-rw-r–r-- 1 root root 2351 May 22 09:49 OwnerChange.pm
-rw-r–r-- 1 root root 2356 May 22 09:49 PriorityChange.pm
-rw-r–r-- 1 root root 2325 May 22 09:49 PriorityExceeds.pm
-rw-r–r-- 1 root root 2306 May 22 09:49 QueueChange.pm
lrwxrwxrwx 1 root root 9 Aug 29 08:37 RCS → /root/RCS
-rw-r–r-- 1 root root 2829 May 22 09:49 ReopenTicket.pm
-rw-r–r-- 1 root root 4593 May 22 09:49 StatusChange.pm
-rw-r–r-- 1 root root 800 Aug 29 09:23 UntouchedInHours.pm
-rw-r–r-- 1 root root 2458 May 22 09:49 UserDefined.pm

Any idea what I’m missing here? Thanks.

Kevin Elliott
Networking Specialist II
Alaska Department of Revenue, ASD-IT
(907) 465-2314

[Thu Aug 29 17:32:17 2013] [critical]: Failed to load module RT::Condition::UntouchedInHours. () at /usr/bin/rt-crontool line 307. (/usr/share/request-tracker4/lib/RT.pm:351)
Failed to load module RT::Condition::UntouchedInHours. () at /usr/bin/rt-crontool line 307.

root@DorJnuASD-RT:~/Bin# cat /usr/share/request-tracker4/lib/RT/Condition/UntouchedInHours.pm

package RT::Condition::UntouchedInHours;
require RT::Condition::Generic;

use RT::Date;

@ISA = qw(RT::Condition::Generic);

At the very least, this line is wrong:
http://bestpractical.com/docs/rt/latest/UPGRADING-4.0.html#Removals-and-updates

You want to inherit from RT::Condition.

-kevin

root@DorJnuASD-RT:~/Bin# ls -la /usr/share/request-tracker4/lib/RT/Condition/
total 60
drwxr-xr-x 2 root root 4096 Aug 29 09:24 .
drwxr-xr-x 17 root root 4096 Jun 11 11:27 …
-rw-r–r-- 1 root root 2247 May 22 09:49 AnyTransaction.pm
-rw-r–r-- 1 root root 2742 May 22 09:49 BeforeDue.pm
-rw-r–r-- 1 root root 2677 May 22 09:49 CloseTicket.pm
-rw-r–r-- 1 root root 2475 May 22 09:49 Overdue.pm
-rw-r–r-- 1 root root 2351 May 22 09:49 OwnerChange.pm
-rw-r–r-- 1 root root 2356 May 22 09:49 PriorityChange.pm
-rw-r–r-- 1 root root 2325 May 22 09:49 PriorityExceeds.pm
-rw-r–r-- 1 root root 2306 May 22 09:49 QueueChange.pm
lrwxrwxrwx 1 root root 9 Aug 29 08:37 RCS → /root/RCS
-rw-r–r-- 1 root root 2829 May 22 09:49 ReopenTicket.pm
-rw-r–r-- 1 root root 4593 May 22 09:49 StatusChange.pm
-rw-r–r-- 1 root root 800 Aug 29 09:23 UntouchedInHours.pm
-rw-r–r-- 1 root root 2458 May 22 09:49 UserDefined.pm

Hi,

Probably not related to your problem, but I really recommend not
putting locally installed files in /usr/share as that space is
reserved for the package manager (dpkg) and you could end up with
overwritten files there (plus it’s difficult to see what came from
where).

/usr/local/share/request-tracker4/lib exists for this purpose so you
could move that file into
/usr/local/share/request-tracker4/lib/RT/Condition/

Cheers,
Dominic.

Dominic Hargreaves, Systems Development and Support Section
IT Services, University of Oxford, 13 Banbury Road, Oxford, OX2 6NN

signature.asc (198 Bytes)

That was indeed the issue. Thanks.

Good call. I’ve moved it over to /usr/local/share/request-tracker.