Zammad mail notifications delay

  • Used Zammad version: zammad-2.8.0
  • Used Zammad installation source: RPM
  • Operating system: Centos7

●There is quite some delay in mail notifications which are sent by zammad

Can’t use Channel::Driver::Imap: #<Net::IMAP::NoResponseError: Authentication failed.>

●And sometimes zammad is very slow

●I need to investigate the root causes. Please can someone help ?

today’s production.log: any suggestions please ?

E, [2019-03-19T10:02:36.994216 #4639-69967505023260] ERROR -- : Can't use Channel::Driver::Imap: #<Net::IMAP::NoResponseError:  Authentication failed.>
    E, [2019-03-19T10:02:36.994733 #4639-69967505023260] ERROR -- : ["/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/net/imap.rb:1194:in `get_tagged_response'", "/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/net/imap.rb:1248:in `block in send_command'", "/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'", "/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/net/imap.rb:1230:in `send_command'", "/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/net/imap.rb:434:in `login'", "/opt/zammad/app/models/channel/driver/imap.rb:110:in `block in fetch'", "/opt/zammad/app/models/channel/driver/imap.rb:333:in `block in timeout'", "/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'", "/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/timeout.rb:33:in `block in catch'", "/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/timeout.rb:33:in `catch'", "/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/timeout.rb:33:in `catch'", "/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/timeout.rb:108:in `timeout'", "/opt/zammad/app/models/channel/driver/imap.rb:332:in `timeout'", "/opt/zammad/app/models/channel/driver/imap.rb:109:in `fetch'", "/opt/zammad/app/models/channel.rb:56:in `fetch'", "/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord- `each'", "/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord- `each'", "/opt/zammad/app/models/channel.rb:30:in `fetch'", "(eval):1:in `_start_job'", "/opt/zammad/app/models/scheduler.rb:279:in `eval'", "/opt/zammad/app/models/scheduler.rb:279:in `_start_job'", "/opt/zammad/app/models/scheduler.rb:239:in `block (2 levels) in start_job'", "/opt/zammad/app/models/scheduler.rb:237:in `loop'", "/opt/zammad/app/models/scheduler.rb:237:in `block in start_job'", "/opt/zammad/vendor/bundle/ruby/2.4.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'"]


first things first:
Authentication failed seems like a good hint.

Are you sure your provided credentials to connect to your IMAP server are correct?
Because zammad probably doesn’t think so.

FYI: IMAP doesn’t have anything to do with sent notifications from zammad. That’s two different things.


Zammad mail notifications delay
And sometimes zammad is very slow

Could be the result of the same problem. Did you have a look at your load?


Hello @dvnkln,

Thank’s for your reply, sorry if the Topic is not well organized.

Actually, i’m a new zammad user and i don’t know a lot :confused:

Please how can i check the things that you suggested to me?

Thank’s in advance.


two things:
Please provide hardware information of the host Zammad runs on, slowness might be a hardware related issue when you have too many agents and not enough power (in hardware terms). Also it would be good to know how this slowness appears to you, to hunt down the issue for this better.

Please also run the following commands and give us the output:

zammad run rails r 'p Delayed::Job.count'
zammad run rails r 'p Delayed::Job.first'
zammad run rails r 'p Delayed::Job.last'

As @dvnkln already said, Authentication failed is a response from your E-Mail-Server.
You can check affected mailboxes either inside the mail channel (failed mailboxes will be shown with different “dot color”:

You can also check each mailbox and it’s error state via:

zammad run rails r 'p Channel.fetch'

Above will issue a fetch process and return issues and well… what Zammad did to improted stuff.

Last but not least regarding notifications delay:
As I stated in my first point regarding hardware, I guess your hardware or mail structure is having trouble. If your mail structure is totally fine, it will be Zammad related. Please note that outgoing mail and notifications are Background jobs and might be sent out later, if Zammad is missing the steam from CPU.

Hello @MrGeneration,

Hardware information: 2x4 CPU Cores and 16GB RAM. Average Load is 1.6 1.6 1.4

zammad run rails r 'p Delayed::Job.count':
zammad run rails r 'p Delayed::Job.first':
#<Delayed::Backend::ActiveRecord::Job id: 2766924, priority: 0, attempts: 0, handler: "--- !ruby/object:BackgroundJobSearchIndex\nobject: ...", last_error: nil, run_at: "2019-03-20 09:16:46", locked_at: "2019-03-20 09:17:19", failed_at: nil, locked_by: "host:zammad@host pid:4639", queue: nil, created_at: "2019-03-20 09:16:46", updated_at: "2019-03-20 09:16:46">
zammad run rails r 'p Delayed::Job.last':
#<Delayed::Backend::ActiveRecord::Job id: 2766964, priority: 0, attempts: 0, handler: "--- !ruby/object:Transaction::BackgroundJob\nitem:\n...", last_error: nil, run_at: "2019-03-20 09:18:40", locked_at: nil, failed_at: nil, locked_by: nil, queue: nil, created_at: "2019-03-20 09:18:40", updated_at: "2019-03-20 09:18:40">

One thing :
The Zammad application and the database are separated.

For the notifications delay i have restared Zammad and it works fine, but sometimes the “Authentication failed” error appears again in production.log.

Thank you.

That’s really odd, maybe your mail server logs give a hint why the server responded that way during the time this appears in the logs? This shouldn’t happen too often. I am using over 20 mailboxes in my private setup and have never seen this issue.

Hello @MrGeneration,

Unfortunately, i don’t have access to the mail server so i have asked the network administrator to check the logs.

Otherwise, I have executed this command “htop” in the zammad host and as you can see in the “uploaded picture”

the “script/scheduler.rb” is eating a lot of CPU.

Please is there a way to solve this without increasing the CPU ?

Thank you.

Your load averade and CPU looks totally fine to me.
You can try to restart the Zammad-Service. If you want to make extra sure you’re not having a Zombie, just stop Zammad and search for scheduler and puma in your process list and kill those (if they’re still there after stopping the service).

Ohter than that, right now I’m not sure how to help you further.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.