Scheduler Daemon Cron: TicketUnlockTimeout

Moderator: crythias

Post Reply
amedina
Znuny newbie
Posts: 22
Joined: 22 Jun 2016, 22:03
Znuny Version: 5.0.7
Real Name: Alberto Medina
Company: Maritima Dominicana, S.A.S.

Scheduler Daemon Cron: TicketUnlockTimeout

Post by amedina »

Hi all,
I'm receiving tow emails every five minutes or so from OTRS with the subject "OTRS Scheduler Daemon Cron: TicketUnlockTimeout" and "OTRS Scheduler Daemon Cron: EscalationCheck". This is the contend of the messages:

Code: Select all

ERROR: OTRS-otrs.Console.pl-Maint::Ticket::EscalationCheck-65 Perl: 5.14.2 OS: linux Time: Wed Sep 14 14:00:18 2016 

Message: Module Kernel/System/Ticket/Custom.pm not in @INC (/opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) 

Traceback (5087): 
  Module: Kernel::System::Main::RequireBaseClass Line: 164 
  Module: Kernel::System::Ticket::new Line: 157 
  Module: Kernel::System::ObjectManager::_ObjectBuild Line: 226 
  Module: Kernel::System::ObjectManager::Get Line: 180 
  Module: Kernel::System::Console::Command::Maint::Ticket::EscalationCheck::Run Line: 64 
  Module: (eval) Line: 444 
  Module: Kernel::System::Console::BaseCommand::Execute Line: 438 
  Module: (eval) Line: 147 
  Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Cron::Run Line: 131 
  Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Run Line: 259 
  Module: (eval) Line: 316 
  Module: main::Start Line: 316 
  Module: ./otrs.Daemon.pl Line: 138 
and:

Code: Select all

ERROR: OTRS-otrs.Console.pl-Maint::Ticket::UnlockTimeout-65 Perl: 5.14.2 OS: linux Time: Wed Sep 14 13:35:17 2016 

Message: Module Kernel/System/Ticket/Custom.pm not in @INC (/opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) 

Traceback (4260): 
  Module: Kernel::System::Main::RequireBaseClass Line: 164 
  Module: Kernel::System::Ticket::new Line: 157 
  Module: Kernel::System::ObjectManager::_ObjectBuild Line: 226 
  Module: Kernel::System::ObjectManager::Get Line: 180 
  Module: Kernel::System::Console::Command::Maint::Ticket::UnlockTimeout::Run Line: 64 
  Module: (eval) Line: 444 
  Module: Kernel::System::Console::BaseCommand::Execute Line: 438 
  Module: (eval) Line: 147 
  Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Cron::Run Line: 131 
  Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Run Line: 259 
  Module: (eval) Line: 316 
  Module: main::Start Line: 316 
  Module: ./otrs.Daemon.pl Line: 138
Anyway, I receive emails notification when a ticket escalate so, what could be causing this notifications?

Best Regards,
Amedina
Jerikan
Znuny newbie
Posts: 1
Joined: 04 Oct 2018, 09:27
Znuny Version: 6.0.11

Re: Scheduler Daemon Cron: TicketUnlockTimeout

Post by Jerikan »

Hello, i have the same issue, on version 6.x.

I can explain the problem... (but it's beyond my knowledge to correct it.)
The problem is in this query (in UnlockTimeout.pm):

Code: Select all

SELECT st.tn, st.id, st.timeout, sq.unlock_timeout
            FROM ticket st, queue sq
            WHERE st.queue_id = sq.id
                AND sq.unlock_timeout != 0
                AND st.ticket_state_id IN ( ${\(join ', ', @UnlockStateIDs)} )
                AND st.ticket_lock_id NOT IN ( ${\(join ', ', @ViewableLockIDs)} ) ",

The query is in wrong syntax here (You can see it in the notification mail):

Code: Select all

SELECT st.tn, st.id, st.timeout, sq.unlock_timeout, st.sla_id, st.queue_id
            FROM ticket st, queue sq
            WHERE st.queue_id = sq.id
                AND sq.unlock_timeout != 0
                AND st.ticket_state_id IN (  )              <====== Empty value (for IN ) isn't a valid mariadb syntax
                AND st.ticket_lock_id NOT IN ( 1, 3 ) '
The @UnlockStateIDs (var) is define here (in file /opt/otrs/Kernel/System/Console/Command/Maint/Ticket/UnlockTimeout.pm) :

Code: Select all

 @UnlockStateIDs = $Kernel::OM->Get('Kernel::System::State')->StateGetStatesByType(
        Type   => 'Unlock',
        Result => 'ID',
    );
So, we can't change the query to include the case where this value is empty (no existing SQL syntax in this case, in my knowledge)

Then, IMO, we need to change this part :

Code: Select all

 @UnlockStateIDs = $Kernel::OM->Get('Kernel::System::State')->StateGetStatesByType(
        Type   => 'Unlock',
        Result => 'ID',
    );
To prevent the case where the @UnlockStateID is an empty value...

PS : Sorry for my poor english :lol:
Post Reply