Emails for old tickets started going out after update

Infos:

  • Used Zammad version: 3.3
  • Used Zammad installation source: package
  • Operating system: CentOS 7
  • Browser + version: Chrome on Linux

Hi,
I imported 34000 tickets from RT using the API
Before importing I disabled all triggers and I can’t remember if I disabled any schedulers, but none show on the scheduler list even with the schedulers table has 22 records all having a 1 in the active field.

I imported the 34000 tickets over days and no emails were generated. Last night, after finishing the last import and comparing the results, adjusted a couple of merges that were missed during the import, etc. After that, happy that both systems matched, I decided to update from 3.2 to 3.3 using “yum update”.
The update went OK and then I restarted zammad with “systemctl restart zammad”.
As soon as I restarted zammad it started sending email from ticket number 1
I removed hundred of emails from the postfix queue, I stopped postfix but emails are still being generated and going out.
On the Channel Email setup I have the use local mta.
Even with postfix stopped emails go out.
The only way I found to stop them is by stopping zammad.
Is there a queue somewhere that I can empty to stop old emails from going out and only start notifying by email changes from now on? Or is zammad going through the tickets and verifying some flag to see if it was notified before.
I work with MySQL so if there’s a flag I can update, I’ll do it if you point me in the right direction or and API function.
Also, should those schedulers appear in the schedulers list in the web interface or are they somehow internal?

Any help will be appreciated as I’m ready to start using it for real.
±—±------------------------------------------------------±------------------------------------±--------±------------------------±-------±-------+
| id | name | method | period | last_run | status | active |
±—±------------------------------------------------------±------------------------------------±--------±------------------------±-------±-------+
| 1 | Process pending tickets | Ticket.process_pending | 900 | 2020-06-07 10:25:10.610 | ok | 1 |
| 2 | Process escalation tickets | Ticket.process_escalation | 300 | 2020-06-07 10:37:31.996 | ok | 1 |
| 3 | Process auto unassign tickets | Ticket.process_auto_unassign | 600 | 2020-06-07 10:36:53.691 | ok | 1 |
| 4 | Import OTRS diff load | Import::OTRS.diff_worker | 180 | 2020-06-07 10:36:53.985 | ok | 1 |
| 5 | Check Channels | Channel.fetch | 30 | 2020-06-07 10:39:22.253 | ok | 1 |
| 6 | Check streams for Channel | Channel.stream | 60 | 2020-06-07 10:12:51.339 | ok | 1 |
| 7 | Generate Session data | Sessions.jobs | 60 | 2020-06-07 10:13:01.341 | ok | 1 |
| 8 | Execute jobs | Job.run | 300 | 2020-06-07 10:38:23.463 | ok | 1 |
| 9 | Cleanup expired sessions | SessionHelper.cleanup_expired | 43200 | 2020-06-07 01:09:01.674 | ok | 1 |
| 10 | Delete old activity stream entries. | ActivityStream.cleanup | 86400 | 2020-06-07 01:09:11.677 | ok | 1 |
| 11 | Delete old entries. | RecentView.cleanup | 86400 | 2020-06-07 01:09:21.676 | ok | 1 |
| 12 | Delete old online notification entries. | OnlineNotification.cleanup | 7200 | 2020-06-07 09:55:34.769 | ok | 1 |
| 13 | Delete old token entries. | Token.cleanup | 2592000 | 2020-06-07 01:09:41.678 | ok | 1 |
| 14 | Closed chat sessions where participients are offline. | Chat.cleanup_close | 900 | 2020-06-07 10:28:33.349 | ok | 1 |
| 15 | Cleanup closed sessions. | Chat.cleanup | 432000 | 2020-06-07 01:10:01.679 | ok | 1 |
| 16 | Sync calendars with ical feeds. | Calendar.sync | 86400 | 2020-06-07 01:10:11.690 | ok | 1 |
| 17 | Generate user based stats. | Stats.generate | 660 | 2020-06-07 10:30:43.433 | ok | 1 |
| 18 | Delete old stats store entries. | StatsStore.cleanup | 2678400 | 2020-06-07 01:10:31.716 | ok | 1 |
| 19 | Cleanup HttpLog | HttpLog.cleanup | 86400 | 2020-06-07 01:10:41.717 | ok | 1 |
| 20 | Cleanup Cti::Log | Cti::Log.cleanup | 2629746 | 2020-06-07 01:10:51.717 | ok | 1 |
| 21 | Import Jobs | ImportJob.start_registered | 3600 | 2020-06-07 09:55:14.363 | ok | 1 |
| 22 | Cleanup ActiveJob locks. | ActiveJobLockCleanupJob.perform_now | 86400 | 2020-06-07 01:03:57.999 | NULL | 1 |
±—±------------------------------------------------------±------------------------------------±--------±------------------------±-------±-------+

Sounds like you had stacked up background jobs.
Just to ensure about which mails we’re talking about, please provide a screenshot of such a mail including the from sender name.

You can and should blurr out sensitive information.

Hi,

Please find attached an example, the body of the message just has the original body that was sent to the RT, it hasn’t got the “we’ve created a ticket for you”. The ticket number starting with 43000 is from zammad, on RT I’m on the 34000s.
The table jobs is empty but the delayed_jobs has 419232 records

Here are some records on delayed_jobs

MariaDB [zammad]> select * from delayed_jobs limit 419200,10 \G

*************************** 1. row ***************************

id: 421946

priority: 0

attempts: 1

handler: — !ruby/object:ActiveJob::QueueAdapters:elayedJobAdapter::JobWrapper

job_data:

job_class: TicketArticleCommunicateEmailJob

job_id: eca2ca18-6d12-4a7d-ae2c-a6cc71c2488f

provider_job_id:

queue_name: default

priority:

arguments:

  • 4190

executions: 1

locale: en

last_error: NULL

run_at: 2020-06-07 10:14:42

locked_at: NULL

failed_at: NULL

locked_by: NULL

 queue: default

created_at: 2020-06-07 10:14:18.215

updated_at: 2020-06-07 10:14:18.215

*************************** 2. row ***************************

id: 421947

priority: 200

attempts: 0

handler: — !ruby/object:ActiveJob::QueueAdapters:elayedJobAdapter::JobWrapper

job_data:

job_class: UserDeviceLogJob

job_id: 6bc9d9c5-2ab1-4016-83ba-88baa854c16f

provider_job_id:

queue_name: default

priority: 200

arguments:

  • Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92

Safari/537.36

  • 192.168.91.10

  • 3

  • ‘1200608815’

  • session

executions: 0

locale: en

last_error: NULL

run_at: 2020-06-07 10:14:19

locked_at: NULL

failed_at: NULL

locked_by: NULL

 queue: default

created_at: 2020-06-07 10:14:19.348

updated_at: 2020-06-07 10:14:19.348

*************************** 3. row ***************************

id: 421948

priority: 200

attempts: 0

handler: — !ruby/object:ActiveJob::QueueAdapters:elayedJobAdapter::JobWrapper

job_data:

job_class: UserDeviceLogJob

job_id: 24a2a09b-5c27-422d-92b3-15976cc95433

provider_job_id:

queue_name: default

priority: 200

arguments:

  • Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92

Safari/537.36

  • 192.168.91.10

  • 3

  • ‘1200608815’

  • session

executions: 0

locale: en

last_error: NULL

run_at: 2020-06-07 10:14:19

locked_at: NULL

failed_at: NULL

locked_by: NULL

 queue: default

created_at: 2020-06-07 10:14:19.349

updated_at: 2020-06-07 10:14:19.349

*************************** 4. row ***************************

id: 421949

priority: 200

attempts: 0

handler: — !ruby/object:ActiveJob::QueueAdapters:elayedJobAdapter::JobWrapper

job_data:

job_class: UserDeviceLogJob

job_id: db76a4b4-8b30-4093-8c6b-9c20343cbeca

provider_job_id:

queue_name: default

priority: 200

arguments:

  • Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

  • 192.168.91.10

  • 3

  • ‘39000839’

  • session

executions: 0

locale: en

last_error: NULL

run_at: 2020-06-07 10:14:19

locked_at: NULL

failed_at: NULL

locked_by: NULL

 queue: default

created_at: 2020-06-07 10:14:19.428

updated_at: 2020-06-07 10:14:19.428

*************************** 5. row ***************************

id: 421950

priority: 200

attempts: 0

handler: — !ruby/object:ActiveJob::QueueAdapters:elayedJobAdapter::JobWrapper

job_data:

job_class: UserDeviceLogJob

job_id: c7104ee9-a7b0-42ee-b612-f16d4a2b8b0d

provider_job_id:

queue_name: default

priority: 200

arguments:

  • Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92

Safari/537.36

  • 192.168.91.10

  • 3

  • ‘2042694714’

  • session

executions: 0

locale: en

last_error: NULL

run_at: 2020-06-07 10:16:09

locked_at: NULL

failed_at: NULL

locked_by: NULL

 queue: default

created_at: 2020-06-07 10:16:09.393

updated_at: 2020-06-07 10:16:09.393

*************************** 6. row ***************************

id: 421951

priority: 0

attempts: 1

handler: — !ruby/object:ActiveJob::QueueAdapters:elayedJobAdapter::JobWrapper

job_data:

job_class: TicketArticleCommunicateEmailJob

job_id: 0a288919-e2d9-43df-abba-a10533797eee

provider_job_id:

queue_name: default

priority:

arguments:

  • 4192

executions: 1

locale: en

last_error: NULL

run_at: 2020-06-07 10:17:11

locked_at: NULL

failed_at: NULL

locked_by: NULL

 queue: default

created_at: 2020-06-07 10:16:46.955

updated_at: 2020-06-07 10:16:46.955

*************************** 7. row ***************************

id: 421952

priority: 0

attempts: 1

handler: — !ruby/object:ActiveJob::QueueAdapters:elayedJobAdapter::JobWrapper

job_data:

job_class: TicketArticleCommunicateEmailJob

job_id: e231fba5-68f9-40d4-816e-56207862cf6f

provider_job_id:

queue_name: default

priority:

arguments:

  • 4194

executions: 1

locale: en

last_error: NULL

run_at: 2020-06-07 10:18:40

locked_at: NULL

failed_at: NULL

locked_by: NULL

 queue: default

created_at: 2020-06-07 10:18:15.704

updated_at: 2020-06-07 10:18:15.704

*************************** 8. row ***************************

id: 421953

priority: 0

attempts: 0

handler: — !ruby/object:Transaction::BackgroundJob

item:

:object: User

:object_id: 154

:user_id: 3

:created_at: !ruby/object:ActiveSupport::TimeWithZone

utc: &1 2020-06-07 10:13:59.667393164 Z

zone: !ruby/object:ActiveSupport::TimeZone

name: Etc/UTC

time: *1

:type: update

:changes:

preferences:

  • !ruby/hash:ActiveSupport::HashWithIndifferentAccess

locale: en-gb

  • !ruby/hash:ActiveSupport::HashWithIndifferentAccess

locale: en-gb

tickets_closed: 9

tickets_open: 0

params:

:interface_handle: scheduler

last_error: NULL

run_at: 2020-06-07 10:18:37

locked_at: NULL

failed_at: NULL

locked_by: NULL

 queue: NULL

created_at: 2020-06-07 10:18:37.175

updated_at: 2020-06-07 10:18:37.175

*************************** 9. row ***************************

id: 421954

priority: 0

attempts: 1

handler: — !ruby/object:ActiveJob::QueueAdapters:elayedJobAdapter::JobWrapper

job_data:

job_class: TicketArticleCommunicateEmailJob

job_id: 4c146ee4-968f-402d-a4c9-3d27e11a2fba

provider_job_id:

queue_name: default

priority:

arguments:

  • 4195

executions: 1

locale: en

last_error: NULL

run_at: 2020-06-07 10:19:48

locked_at: NULL

failed_at: NULL

locked_by: NULL

 queue: default

created_at: 2020-06-07 10:19:23.484

updated_at: 2020-06-07 10:19:23.484

*************************** 10. row ***************************

id: 421955

priority: 0

attempts: 1

handler: — !ruby/object:ActiveJob::QueueAdapters:elayedJobAdapter::JobWrapper

job_data:

job_class: TicketArticleCommunicateEmailJob

job_id: e933abaf-fb22-4e95-8379-cc8b9e6d3471

provider_job_id:

queue_name: default

priority:

arguments:

  • 4196

executions: 1

locale: en

last_error: NULL

run_at: 2020-06-07 10:20:16

locked_at: NULL

failed_at: NULL

locked_by: NULL

 queue: default

created_at: 2020-06-07 10:19:51.951

updated_at: 2020-06-07 10:19:51.951Screenshot from 2020-06-07 17-54-06

Thanks

It looks like you’ve been importing email articles as emails which could cause a sendout.
This would explain the number of stacked delayed jobs, because they mainly are for communication task (like answering on tickets).

However, it’s impossible that your tickets are not existent (or you removed them after wards).
A zammad run rails r "p Ticket.count" should reveal the number of existing tickets.

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