Zammad ActiveJob::DeserializationError

Infos:

  • Used Zammad version: 3.6.0-20
  • Used Zammad installation source: (source, package, …) - Docker
  • Operating system: K8s

Expected behavior:

  • Zammad sync the data

Actual behavior:

  • Jobs failing

Steps to reproduce the behavior:

Zammad it’s have a lot of problems with the Delayed Jobs, and stop, running on a Kubernetes cluster:

I, [2021-01-22T09:57:40.203889 #1-47018330954100] INFO – : Setting.set(‘models_searchable’, [“Organization”, “Chat::Session”, “KnowledgeBase::Answer::Translation”, “Ticket”, “User”])

I, [2021-01-22T09:57:41.459690 #1-47018330954100] INFO – : Scheduler started.

I, [2021-01-22T09:57:41.481304 #1-47018330954100] INFO – : Cleanup of left over locked delayed jobs 2021-01-22 12:57:41 UTC started.

I, [2021-01-22T09:57:41.548556 #1-47018330954100] INFO – : Checking left over delayed job #<Delayed::Backend::ActiveRecord::Job id: 2776434, priority: 200, attempts: 0, handler: “— !ruby/object:ActiveJob::QueueAdapters::Delayed…”, last_error: nil, run_at: “2021-01-21 15:58:27”, locked_at: “2021-01-22 12:46:15”, failed_at: nil, locked_by: “host:saas-zammad-local-0 pid:1”, queue: “default”, created_at: “2021-01-21 15:58:27”, updated_at: “2021-01-21 15:58:27”> started.

bundler: failed to load command: script/scheduler.rb (script/scheduler.rb)

ActiveJob::DeserializationError: Error while trying to deserialize arguments: Couldn’t find Ticket with ‘id’=24771

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/relation/finder_methods.rb:346:in `raise_record_not_found_exception!’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/relation/finder_methods.rb:456:in `find_one’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/relation/finder_methods.rb:435:in `find_with_ids’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/relation/finder_methods.rb:69:in `find’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/querying.rb:5:in `find’

/usr/local/bundle/gems/composite_primary_keys-11.2.0/lib/composite_primary_keys/core.rb:24:in `find’

/usr/local/bundle/gems/globalid-0.4.2/lib/global_id/locator.rb:130:in `locate’

/usr/local/bundle/gems/globalid-0.4.2/lib/global_id/locator.rb:155:in `block in locate’

/usr/local/bundle/gems/globalid-0.4.2/lib/global_id/locator.rb:165:in `block in unscoped’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/scoping/default.rb:34:in `block in unscoped’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/relation.rb:281:in `scoping’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/scoping/default.rb:34:in `unscoped’

/usr/local/bundle/gems/globalid-0.4.2/lib/global_id/locator.rb:165:in `unscoped’

/usr/local/bundle/gems/globalid-0.4.2/lib/global_id/locator.rb:155:in `locate’

/usr/local/bundle/gems/globalid-0.4.2/lib/global_id/locator.rb:17:in `locate’

/usr/local/bundle/gems/activejob-5.2.4.4/lib/active_job/arguments.rb:101:in `deserialize_global_id’

/usr/local/bundle/gems/activejob-5.2.4.4/lib/active_job/arguments.rb:87:in `deserialize_argument’

/usr/local/bundle/gems/activejob-5.2.4.4/lib/active_job/arguments.rb:41:in `block in deserialize’

/usr/local/bundle/gems/activejob-5.2.4.4/lib/active_job/arguments.rb:41:in `map’

/usr/local/bundle/gems/activejob-5.2.4.4/lib/active_job/arguments.rb:41:in `deserialize’

/opt/zammad/config/initializers/delayed_jobs_ensure_active_job_lock_removal.rb:14:in `remove_active_job_lock’

/usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:426:in `block in make_lambda’

/usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:236:in `block in halting_and_conditional’

/usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:517:in `block in invoke_after’

/usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:517:in `each’

/usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:517:in `invoke_after’

/usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:133:in `run_callbacks’

/usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:816:in `_run_destroy_callbacks’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/callbacks.rb:323:in `destroy’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/transactions.rb:305:in `block in destroy’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/transactions.rb:387:in `block in with_transaction_returning_status’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction’

/usr/local/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/transactions.rb:212:in `transaction’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/transactions.rb:385:in `with_transaction_returning_status’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/transactions.rb:305:in `destroy’

/opt/zammad/app/models/scheduler.rb:193:in `cleanup_delayed’

/opt/zammad/app/models/scheduler.rb:143:in `block (3 levels) in cleanup_delayed_jobs’

/opt/zammad/lib/mixin/start_finish_logger.rb:7:in `log_start_finish’

/opt/zammad/app/models/scheduler.rb:142:in `block (2 levels) in cleanup_delayed_jobs’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/relation/delegation.rb:71:in `each’

/usr/local/bundle/gems/activerecord-5.2.4.4/lib/active_record/relation/delegation.rb:71:in `each’

/opt/zammad/app/models/scheduler.rb:141:in `block in cleanup_delayed_jobs’

/opt/zammad/lib/mixin/start_finish_logger.rb:7:in `log_start_finish’

/opt/zammad/app/models/scheduler.rb:139:in `cleanup_delayed_jobs’

/opt/zammad/app/models/scheduler.rb:126:in `cleanup’

/opt/zammad/app/models/scheduler.rb:23:in `threads’

script/scheduler.rb:74:in `block in <top (required)>’

/usr/local/bundle/gems/daemons-1.3.1/lib/daemons/application.rb:275:in `block in start_proc’

/usr/local/bundle/gems/daemons-1.3.1/lib/daemons/application.rb:284:in `start_proc’

/usr/local/bundle/gems/daemons-1.3.1/lib/daemons/application.rb:305:in `start’

/usr/local/bundle/gems/daemons-1.3.1/lib/daemons/controller.rb:59:in `run’

/usr/local/bundle/gems/daemons-1.3.1/lib/daemons.rb:199:in `block in run_proc’

/usr/local/bundle/gems/daemons-1.3.1/lib/daemons/cmdline.rb:121:in `catch_exceptions’

/usr/local/bundle/gems/daemons-1.3.1/lib/daemons.rb:198:in `run_proc’

script/scheduler.rb:54:in `<top (required)>’

I, [2021-01-22T09:57:41.559136 #1-47018330954100] INFO – : script/scheduler.rb stopped.

I don’t if i can change the time of the job to wait for the database commit, i have a big customer, it’s more than 20k tickets by month.

Thanks

it seems the job fails on this, have you checked that ticket id?

Hi,
Yes the ticket exists on database, include you can see on the zammad interface put the direct id on the URL

eg: https://ZAMMAD/#ticket/zoom/24771

What i see on the internet it’s something about the commit on Postgresql
Thanks.

is postgresql reporting any error’s?

Did you try to destroy the job?

Delayed::Job.find(2776434).destroy

Hi,
The postgresql is ok, i checked the logs. Destroy the job works, but it’s no a good option.

I disable the elasticsearch and now i don’t have more this problem.

maybe it helps to rebuild the searchindex in ElasticSearch? rake searchindex:rebuild

We should stop mixing error messages.
The only error message we saw is the deserilization error.

We can’t tell what other delayed jobs are failing which is why we’re currently digging in the dark.
If it IS searchindex related, reindexing might help if the index did drift too much. But it probably won’t fix the root issue.

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