Learn in this article how to analyze, debug and fully understand OTRS / Znuny traceback errors. Let us take a common upgrade issue from Znuny 6.2.x to 6.3.x
Here we are failing on fetching E-Mails and we get this error:
ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-10 Perl Message: There was an error executing Execute() in Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch: Console command 'MailAccountFetch' is failed. Traceback Module: Kernel::System::Daemon::DaemonModules::BaseTaskWorker::_HandleError Line: 50 Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Cron::Run Line: 175 Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Run Line: 233 Module: (eval) Line: 331 Module: main::Start Line: 331 Module: /opt/otrs/bin/otrs.Daemon.pl Line: 152
This message looks really awkward but it has lot of details to track down your error. Here a simple process to find your OTRS / Znuny / OTOBO error:
Prozess to read and understand the traceback lines
For this example here we will use specifically Znuny version 6.3.3.
- Line 1: ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch
The line is telling you very specific, who is causing the error. Here it is naming Console.pl and the Module Maint::PostMaster::MailAccountFetch
Now you know how to reproduce or where to search - Line 2: Message: There was an error executing Execute()
Sometimes you get more details from the developed code, if this error is expected. In this case it seems to be an unexpected error - Line 3 and following: Traceback
Traceback is giving you hints to the specific places in code. The topmost entry is showing you there exactly the code terminated expectedly or unexpectedly.
In this case it seems it is unexpected termination in
Module: Kernel::System::Daemon::DaemonModules::BaseTaskWorker::_HandleError
at line 50 in perl file Module: Kernel::System::Daemon::DaemonModules::BaseTaskWorker in function/method _HandleError - find the corresponding file of the Module
this is mostly also very simple by going to your installation (typically /opt/otrs) and you navigate from here to
Kernel/System/Daemon/DaemonModules and your file has mostly .pm or .pl as file extension.
In our case it is BaseTaskWorker.pm - open the file with an editor
go to the given line, in our case Line 50
You will find here this code
sub _HandleError {
my ( $Self, %Param ) = @_;
$Kernel::OM->Get('Kernel::System::Log')->Log( // our Line 50
Priority => 'error',
Message => $Param{LogMessage},
);
If you do not have access to the file system you can use github with it’s git repository.
To get the code simply do:
- open in browser
https://github.com/znuny/Znuny - select tags in the branches dropdown
- select your version 6.3.3
named in this list as rel-6.3.3
which will bring you to the tagged sources
https://github.com/znuny/Znuny/tree/rel-6_3_3 - Now you navigate also the folders down to
Kernel/System/Daemon/DaemonModules, which will bring you to this
https://github.com/znuny/Znuny/tree/rel-6_3_3/Kernel/System/Daemon/DaemonModules - Open the source file
https://github.com/znuny/Znuny/blob/rel-6_3_3/Kernel/System/Daemon/DaemonModules/BaseTaskWorker.pm - Go to source file at Line 50
https://github.com/znuny/Znuny/blob/rel-6_3_3/Kernel/System/Daemon/DaemonModules/BaseTaskWorker.pm#L50
And now you see that the Line 50 is adding something to log:
$Kernel::OM->Get('Kernel::System::Log')->Log( // Line 50
Priority => 'error',
Message => $Param{LogMessage},
);
So the next checks are:
- if your log file is existing
- if your log file can be created (if missing)
- if your log file is writable
The location of your log file is configured in System Configuration > LogModule::LogFile and it is typically
/var/log/otrs/otrs.log