OTRS Mailqueue get stuck and fills up

Moderator: crythias

Post Reply
Psycho007
Znuny newbie
Posts: 9
Joined: 07 May 2021, 11:33
Znuny Version: 6.0.30
Real Name: Jan Peterhänsel
Company: Secure Cloud Services

OTRS Mailqueue get stuck and fills up

Post by Psycho007 »

We have the problem that from time to time our Mailqueue gets stuck and fills up. It seems that one of the mails get stuck and causes the queue to fill. When trying to send the mail via the Console command:

Code: Select all

su -c "/opt/otrs/bin/otrs.Console.pl Maint::Email::MailQueue --send" -s /bin/bash otrs
We get the following error:

Code: Select all

ERROR: OTRS-otrs.Console.pl-Maint::Email::MailQueue-89 Perl: 5.26.1 OS: linux Time: Thu Oct 7 09:39:14 2021

 Message: The communication '2590090' is already closed, can't be used.

 Traceback (1135717): 
   Module: Kernel::System::CommunicationLog::_LogError Line: 539
   Module: Kernel::System::CommunicationLog::_RecoverCommunicationObject Line: 504
   Module: Kernel::System::CommunicationLog::new Line: 68
   Module: Kernel::System::ObjectManager::_ObjectBuild Line: 307
   Module: Kernel::System::ObjectManager::Create Line: 242
   Module: Kernel::System::MailQueue::_GetCommunicationLog Line: 1653
   Module: Kernel::System::MailQueue::Send Line: 639
   Module: Kernel::System::Console::Command::Maint::Email::MailQueue::Send Line: 199
   Module: Kernel::System::Console::Command::Maint::Email::MailQueue::Run Line: 148
   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

Error: Can't call method "CommunicationIDGet" on an undefined value at /opt/otrs/Kernel/System/MailQueue.pm line 640.
After deleting the first mail in the queue the queue gets send.

Code: Select all

su -c "/opt/otrs/bin/otrs.Console.pl Maint::Email::MailQueue --delete --filter='ID::1' --force" -s /bin/bash otrs
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Email::MailQueue --send" -s /bin/bash otrs
What is causing this error? How do we fix this. It get annoying to have to clear the mailqueue every other day.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: OTRS Mailqueue get stuck and fills up

Post by reneeb »

Did you check the communication log? Did you check if it always the same kind of mails that lead to the error?
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Psycho007
Znuny newbie
Posts: 9
Joined: 07 May 2021, 11:33
Znuny Version: 6.0.30
Real Name: Jan Peterhänsel
Company: Secure Cloud Services

Re: OTRS Mailqueue get stuck and fills up

Post by Psycho007 »

There are no errors in the communication log. And its always diferent Mails.
Reedu
Znuny newbie
Posts: 29
Joined: 11 Mar 2013, 15:08
Znuny Version: Znuny 6.1.2
Real Name: Adam

Re: OTRS Mailqueue get stuck and fills up

Post by Reedu »

There was similiar problem
viewtopic.php?t=38531

Maybe try stop Cron and Deamon, and run just Cron.
Psycho007
Znuny newbie
Posts: 9
Joined: 07 May 2021, 11:33
Znuny Version: 6.0.30
Real Name: Jan Peterhänsel
Company: Secure Cloud Services

Re: OTRS Mailqueue get stuck and fills up

Post by Psycho007 »

Thanks for the suggestion. We tried that already, and it did work the first few times. After that, restarting the Cron had no more effect on the error in the Mailqueue.
fabiociardullo
Znuny newbie
Posts: 1
Joined: 19 Jul 2023, 11:31
Znuny Version: 6.0.32
Real Name: fabio ciardullo

Re: OTRS Mailqueue get stuck and fills up

Post by fabiociardullo »

Did you ever manage to solve this problem?
I tried with Cron and Daemon but it didn't help...

There are no errors in Log, the sending process get stuck and never stops until we manually delete the first mail in queue

Thanks!
cisiu
Znuny newbie
Posts: 9
Joined: 26 Feb 2016, 15:38
Znuny Version: 6.4.5 - 6.5.2
Real Name: Krzysztof Ławniczak

Re: OTRS Mailqueue get stuck and fills up

Post by cisiu »

Hello,

I'd like to add my insights into this issue.

We use several Znuny systems and from time to time (mostly in the last few months) there is this issue, that outgoing mails queue get stuck and what we do is manually send e-mails then reboot the VM (supported Ubuntu LTS with updates) in order to bring MailQueueSend task to running again.

(attachement 1_ with handled worker task stuck)

We use f.e. 6.4.5, 6.5.2 Znuny versions and O365/MS365 as e-mail service (with OAuth).

I have no idea why this occurs, but it seems that this happens more frequently.
If there is anyone with some hints regarding this issue.

Commands used:
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Daemon::Summary" - otrs
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Email::MailQueue --list" - otrs
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Email::MailQueue --send --verbose" - otrs
You do not have the required permissions to view the files attached to this post.
Post Reply