znuny / Znuny

Znuny/Znuny LTS is a fork of the ((OTRS)) Community Edition, one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management.
https://www.znuny.org
GNU General Public License v3.0
335 stars 82 forks source link

Bug - Error Message: Need OldTicketData in Data! on ArticleCreateTransmissionError event #440

Open pboguslawski opened 1 year ago

pboguslawski commented 1 year ago

Environment

Expected behaviour

No errors in procmail.log on saving bonce reponse.

Actual behaviour

When bounce is stored in Znuny, ArticleCreateTransmissionError event is thrown in /opt/otrs/Kernel/System/Ticket/Article/Backend/Email.pm > ArticleCreateTransmissionError() and this makes also all handlers listening for ArticleCreate (regexp comparison in /opt/otrs/Kernel/System/EventHandler.pm) to run; one of them (TriggerEscalationStopEvents) requires OldTicketData parameter not provided by ArticleCreateTransmissionError and this throws an error like

procmail: Executing "/opt/otrs/bin/otrs.Console.pl,Maint::PostMaster::Read"
ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::Read-1 Perl: 5.32.1 OS: linux Time: Sun May 28 09:18:27 2023

 Message: Need OldTicketData in Data!

 Traceback (2195):.
   Module: Kernel::System::Ticket::Event::TriggerEscalationStopEvents::Run Line: 45
   Module: Kernel::System::EventHandler::EventHandler Line: 224
   Module: Kernel::System::Ticket::Article::Backend::Email::ArticleCreateTransmissionError Line: 847
   Module: Kernel::System::PostMaster::FollowUpCheck::BounceEmail::_SetArticleTransmissionSendError Line: 115
   Module: Kernel::System::PostMaster::FollowUpCheck::BounceEmail::Run Line: 71
   Module: Kernel::System::PostMaster::CheckFollowUp Line: 538
   Module: Kernel::System::PostMaster::Run Line: 224
   Module: (eval) Line: 123
   Module: Kernel::System::Console::Command::Maint::PostMaster::Read::Run Line: 105
   Module: (eval) Line: 461
   Module: Kernel::System::Console::BaseCommand::Execute Line: 455
   Module: Kernel::System::Console::InterfaceConsole::Run Line: 81
   Module: /opt/otrs/bin/otrs.Console.pl Line: 37

How to reproduce

In Znuny with procmail feeding e-mails to Znuny, send outbound e-mail ticket to non existing mailbox in valid domain and wait for mail bounce to return. See error like above in procmail log when storing bounce in Znuny.

Additional information

New event names introduced in https://github.com/znuny/Znuny/commit/e59690ba9ddff11c39685bd7ca3b042330779fdd problaby conflict now with Ticket::EventModulePost###4300-EscalationStopEvents > Event regexp and should be renamed or regexp should be narrowed down if possible to something like

^TicketSLAUpdate$|^TicketQueueUpdate$|^TicketStateUpdate$|^ArticleCreate$

Safest solution would be to avoid regexp matching and treat Event param as list of literals separated by | but some of Event definitions are regexps already so this would be braking change.

gody01 commented 1 year ago

Same error observed on version 6.5.3.

Reedu commented 3 months ago

And on 6.5.7 too ;)

rkaldung commented 3 months ago

Internal issue 856