Sync Plans errors: undefined method `xxx' for nil:NilClass

Problem:
When trying to perform any operation on a sync plans, such as deactivating or activating, I receive errors related to undefined method `xxxx’ for nil:NilClass.

$ hammer sync-plan update --id x --enabled no --organization "XXXX"
Could not update the sync plan:
  undefined method `frozen=' for nil:NilClass

Expected outcome:
I hope the disable/enable operation completes successfully.
Foreman and Proxy versions:

Foreman and Proxy plugin versions:
Version 3.10.0 © 2009-2024 Paul Kelly and Ohad Levy
foreman-3.10.0-1.el8.noarch
foreman-proxy-3.10.0-1.el8.noarch
katello-4.12.1-1.el8.noarch
Distribution and version:
Rocky Linux release 8.10 (Green Obsidian)
Other relevant data:
I tried to change the sync plans via the web interface without success, same error.
I have several sync plans, scheduled daily at 10 pm, with a five-minute start difference between them. Errors occur in all sync plans.
I’ve already deleted the sync plans and recreated them, the errors reappear after 9 days or so.
Below is the list of my sync plans.

---|-------------------|---------------------|----------|---------|-----------------|-------------------
ID | NAME              | START DATE          | INTERVAL | ENABLED | CRON EXPRESSION | RECURRING LOGIC ID
---|-------------------|---------------------|----------|---------|-----------------|-------------------
3  | sp_centos_linux   | 2024/06/19 01:00:00 | daily    | yes     |                 | 40
10 | sp_fedora_linux   | 2024/06/19 01:35:00 | daily    | yes     |                 | 41
4  | sp_foreman        | 2024/06/19 01:05:00 | daily    | yes     |                 | 42
11 | sp_oracle_linux   | 2024/06/19 01:40:00 | daily    | yes     |                 | 43
5  | sp_remi_php       | 2024/06/19 01:10:00 | daily    | yes     |                 | 44
12 | sp_rhel           | 2024/06/18 01:45:00 | daily    | no      |                 | 38
8  | sp_rocky_linux8   | 2024/06/19 01:25:00 | daily    | yes     |                 | 45
9  | sp_rocky_linux9   | 2024/06/19 01:30:00 | daily    | yes     |                 | 46
6  | sp_xxxx_main_repo | 2024/06/19 01:15:00 | daily    | yes     |                 | 47
7  | sp_zabbix         | 2024/06/19 01:20:00 | daily    | yes     |                 | 48
---|-------------------|---------------------|----------|---------|-----------------|-------------------

Below are details of the flat sync plans with id 8.

Id:                 8
Name:               sp_rocky_linux8
Start Date:         2024/06/19 01:25:00
Interval:           daily
Enabled:            yes
Cron Expression:
Recurring Logic ID: 45
Description:        Repos para o Produto Rocky Linux 8
Created at:         2024/06/17 17:59:22
Updated at:         2024/06/18 15:53:51
Next Sync:          2024/06/27 01:25:00
Products:
 1) Id:   36
    Name: Rocky Linux 8

Was the foreman server down near the end of that time frame?

I did not understand your question. Could you detail your question?
But, if you want to know if the Foreman server went offline around nine days, the answer is no, all services related to Foreman were operational.

Yes, that was the question. There were some issues in the past that could rise up if Foreman was down at the time when a recurring thing should have happened, but if your instance was up the whole time, then it has to be something else.

We’ll need more details to be at least able to tell what happened. What would be helpful:

  1. Pick any of the broken sync plans
  2. Look up its recurring logic
  3. Look up tasks of that recurring logic
  4. Take a look at the most recent one
  5. Look in the logs (both in /var/log/foreman/production.log and in the output of journalctl -u dynflow-sidekiq@*) around the time the task from 4) was running

More information follows as requested.

Let’s focus on syncplan sp_rocky_linux9 id 9

List of all sync_plans

---|-------------------|---------------------|----------|---------|-----------------|-------------------
ID | NAME              | START DATE          | INTERVAL | ENABLED | CRON EXPRESSION | RECURRING LOGIC ID
---|-------------------|---------------------|----------|---------|-----------------|-------------------
3  | sp_centos_linux   | 2024/06/19 01:00:00 | daily    | yes     |                 | 40
10 | sp_fedora_linux   | 2024/06/19 01:35:00 | daily    | yes     |                 | 41
4  | sp_foreman        | 2024/06/19 01:05:00 | daily    | yes     |                 | 42
11 | sp_oracle_linux   | 2024/06/19 01:40:00 | daily    | yes     |                 | 43
5  | sp_remi_php       | 2024/06/19 01:10:00 | daily    | yes     |                 | 44
12 | sp_rhel           | 2024/06/18 01:45:00 | daily    | no      |                 | 38
8  | sp_rocky_linux8   | 2024/06/19 01:25:00 | daily    | yes     |                 | 45
9  | sp_rocky_linux9   | 2024/06/19 01:30:00 | daily    | yes     |                 | 46
6  | sp_tjgo_main_repo | 2024/06/19 01:15:00 | daily    | yes     |                 | 47
7  | sp_zabbix         | 2024/06/19 01:20:00 | daily    | yes     |                 | 48
---|-------------------|---------------------|----------|---------|-----------------|-------------------

List of sync_plans details with id 9

Id:                 9
Name:               sp_rocky_linux9
Start Date:         2024/06/19 01:30:00
Interval:           daily
Enabled:            yes
Cron Expression:
Recurring Logic ID: 46
Description:        Repos para o Produto Rocky Linux 9
Created at:         2024/06/17 18:00:39
Updated at:         2024/06/18 15:54:30
Next Sync:          2024/06/27 01:30:00
Products:
 1) Id:   35
    Name: Rocky Linux 9

List of all recurring-logic

---|-------------|------------|------------------------------|---------------------|---------------------|-----------|-----------------|----------|----------|--------
ID | CRON LINE   | TASK COUNT | ACTION                       | LAST OCCURRENCE     | NEXT OCCURRENCE     | ITERATION | ITERATION LIMIT | END TIME | STATE    | PURPOSE
---|-------------|------------|------------------------------|---------------------|---------------------|-----------|-----------------|----------|----------|--------
38 | 45 22 * * * | 1          | Run Sync Plan:               |                     |                     | 1         |                 |          | disabled |
18 | 0 0 * * *   | 6          | Check for long running tasks | 2024/07/15 00:00:13 | 2024/07/16 00:00:00 | 95        |                 |          | active   |
40 | 0 22 * * *  | 1          | Run Sync Plan:               |                     | 2024/06/27 01:00:00 | 9         |                 |          | active   |
42 | 5 22 * * *  | 1          | Run Sync Plan:               |                     | 2024/06/27 01:05:00 | 9         |                 |          | active   |
44 | 10 22 * * * | 1          | Run Sync Plan:               |                     | 2024/06/27 01:10:00 | 9         |                 |          | active   |
47 | 15 22 * * * | 1          | Run Sync Plan:               |                     | 2024/06/27 01:15:00 | 9         |                 |          | active   |
48 | 20 22 * * * | 1          | Run Sync Plan:               |                     | 2024/06/27 01:20:00 | 9         |                 |          | active   |
45 | 25 22 * * * | 1          | Run Sync Plan:               |                     | 2024/06/27 01:25:00 | 9         |                 |          | active   |
46 | 30 22 * * * | 1          | Run Sync Plan:               |                     | 2024/06/27 01:30:00 | 9         |                 |          | active   |
41 | 35 22 * * * | 1          | Run Sync Plan:               |                     | 2024/06/27 01:35:00 | 9         |                 |          | active   |
43 | 40 22 * * * | 1          | Run Sync Plan:               |                     | 2024/06/27 01:40:00 | 9         |                 |          | active   |
1  | 0 0 * * *   | 0          |                              |                     |                     | 4         |                 |          | active   |
13 | 0 0 * * *   | 0          |                              |                     |                     | 2         |                 |          | active   |
15 | 0 0 * * *   | 0          |                              |                     |                     | 3         |                 |          | active   |
---|-------------|------------|------------------------------|---------------------|---------------------|-----------|-----------------|----------|----------|--------

List of recurring-logic details with id 46

ID:              46
Cron line:       30 22 * * *
Action:          Run Sync Plan:
Last occurrence: -
Next occurrence: 2024-06-27 01:30:00 UTC
Task count:      1
Action:          Run Sync Plan:
Last occurrence:
Next occurrence: 2024/06/27 01:30:00
Iteration:       9
Iteration limit: Unlimited
Iteration limit:
Repeat until:    Unlimited
State:           active
Purpose:

List the task for sync_plan sp_rocky_linux9

ID:         d15cf7f8-a2fd-4323-b5cc-646db2b6184a
Action:     Run Sync Plan:
State:      scheduled
Result:     pending
Started at:
Ended at:
Duration:   0
Owner:      foreman_admin

Regarding the search in the logs, I didn’t find any traces. Command used.

grep -H "sp_rocky_linux9" /var/log/foreman/production.log* && zgrep -H "sp_rocky_linux9" /var/log/foreman/production.log-*.gz

About journalctl ran without any trace.

journalctl -u dynflow-sidekiq@*
journalctl -u dynflow-sidekiq@*
journalctl -u dynflow-sidekiq
journalctl -u dynflow
journalctl -xe

My impressions

We have the sync_plan registered correctly.
We have the recurring-logic correctly associated with the sync_plan.
We have the task scheduled for sync_plan.
What happens is that the task is not executed, partly I suspect the date that was registered in both sync_plan and recurring-logic: Next Sync: 2024/06/27 01:30:00, a date in the past.

If it is at iteration 9 then the last occurrence shouldn’t be empty.

When you look at its details, what date and time does it have set for start at?

That’s not surprising. When tasks run (and that’s what we’re looking for), their state updates don’t really mention the sync plan name.

That’s rather odd.

What appears in /var/log/foreman/production.log when you get this?

If it is in iteration 9, the last occurrence must not be empty.

All the information I sent you in the previous message was taken directly from the Foreman server via the command line using the hammer command. Therefore, the fields without information were presented by the Foreman system itself, that is, it does not have this information saved.

When you look at the details, what is the start at date and time?

As I explained in the previous answer, when we create a synchronization plan, Foreman creates the recurrence plan and also creates a task with scheduled status. When the sync plan is executed, then in Foreman’s task list, we will have a specific task for the sp_rocky_linux9 sync plan. What happens is that the schedule is not being executed or invoked.

This is not surprising. When tasks run (and that’s what we’re looking for), their state updates don’t actually mention the sync plan name.

Exactly, the plans are not being executed according to the schedule made. And the logs for the month of June, when the last sync plan execution occurred, are no longer available due to log rotation.

This is quite strange.

Here is the same situation, as the sync plans are not being executed, we have no traces in the logs or in journalctl. When I run the plan sync manually, it happens successfully.

What appears in /var/log/foreman/production.log when you receive this?

When I try to disable the sp_rocky_linux9 sync plan via the web interface.

An error occurred saving the Sync Plan: undefined method `frozen=’ for nil:NilClass

When I try to change the start date of the sp_rocky_linux9 sync plan via the web interface.

An error occurred saving the Sync Plan: undefined method `cancel’ for nil:NilClass

See below the log excerpt from production.log when I tried to perform the operations described above.

2024-07-16T12:56:34 [I|app|163eaaee] Started PUT "/katello/api/v2/organizations/4/sync_plans/9" for 172.28.16.32 at 2024-07-16 12:56:34 -0300
2024-07-16T12:56:34 [I|app|163eaaee] Processing by Katello::Api::V2::SyncPlansController#update as HTML
2024-07-16T12:56:34 [I|app|163eaaee]   Parameters: {"id"=>"9", "organization_id"=>"4", "name"=>"sp_rocky_linux9", "description"=>"Repos para o Produto Rocky Linux 9", "interval"=>"daily", "next_sync"=>"2024-06-26 22:30:00 -0300", "sync_date"=>"Wednesday, July 17, 2024 at 10:30:00 PM", "created_at"=>"2024-06-17 15:00:39 -0300", "updated_at"=>"2024-06-18 12:54:30 -0300", "enabled"=>true, "foreman_tasks_recurring_logic_id"=>46, "cron_expression"=>nil, "products"=>[{"id"=>35, "cp_id"=>"878577181345", "name"=>"Rocky Linux 9", "label"=>"rocky_linux_9", "description"=>"Distribuição Linux downstream compatível com RHEL", "sync_state"=>"Syncing Complete.", "last_sync"=>"2024-07-12 14:21:35 -0300", "last_sync_words"=>"4 days", "repository_count"=>45}], "permissions"=>{"view_sync_plans"=>true, "edit_sync_plans"=>true, "destroy_sync_plans"=>true}, "syncDate"=>"2024-07-18T01:30:00.000Z", "syncTime"=>"2024-06-19T01:30:00.000Z", "api_version"=>"v2", "sync_plan"=>{"id"=>"9", "name"=>"sp_rocky_linux9", "description"=>"Repos para o Produto Rocky Linux 9", "sync_date"=>"Wednesday, July 17, 2024 at 10:30:00 PM", "interval"=>"daily", "organization_id"=>"4", "created_at"=>"2024-06-17 15:00:39 -0300", "updated_at"=>"2024-06-18 12:54:30 -0300", "foreman_tasks_recurring_logic_id"=>46, "cron_expression"=>nil}}
2024-07-16T12:56:34 [I|aud|163eaaee] Katello::SyncPlan (9) update event on sync_date 2024-06-18 22:30:00 -0300, 2024-07-17 22:30:00 -0300
2024-07-16T12:56:34 [I|aud|163eaaee] Katello::SyncPlan (9) update event on foreman_tasks_recurring_logic_id 46, 56
2024-07-16T12:56:34 [E|app|163eaaee] NoMethodError: undefined method `cancel' for nil:NilClass
 163eaaee | /usr/share/gems/gems/dynflow-1.8.3/lib/dynflow/execution_plan.rb:311:in `block in cancel'
 163eaaee | /usr/share/gems/gems/dynflow-1.8.3/lib/dynflow/execution_plan.rb:311:in `tap'
 163eaaee | /usr/share/gems/gems/dynflow-1.8.3/lib/dynflow/execution_plan.rb:311:in `cancel'
 163eaaee | /usr/share/gems/gems/foreman-tasks-9.1.1/app/models/foreman_tasks/task/dynflow_task.rb:32:in `cancel'
 163eaaee | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/relation/delegation.rb:88:in `each'
 163eaaee | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/relation/delegation.rb:88:in `each'
 163eaaee | /usr/share/gems/gems/foreman-tasks-9.1.1/app/models/foreman_tasks/recurring_logic.rb:95:in `cancel'
 163eaaee | /usr/share/gems/gems/katello-4.12.1/app/models/katello/sync_plan.rb:87:in `block in update_attributes_with_logics!'
 163eaaee | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
 163eaaee | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
 163eaaee | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
 163eaaee | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
 163eaaee | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/transactions.rb:209:in `transaction'
 163eaaee | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/transactions.rb:290:in `transaction'
 163eaaee | /usr/share/gems/gems/katello-4.12.1/app/models/katello/sync_plan.rb:77:in `update_attributes_with_logics!'
 163eaaee | /usr/share/gems/gems/katello-4.12.1/app/controllers/katello/api/v2/sync_plans_controller.rb:79:in `update'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/base.rb:228:in `process_action'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/rendering.rb:30:in `process_action'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
 163eaaee | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 163eaaee | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 163eaaee | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 163eaaee | /usr/share/gems/gems/audited-5.4.3/lib/audited/sweeper.rb:16:in `around'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 163eaaee | /usr/share/gems/gems/audited-5.4.3/lib/audited/sweeper.rb:16:in `around'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:137:in `run_callbacks'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/callbacks.rb:41:in `process_action'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/rescue.rb:22:in `process_action'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications.rb:203:in `block in instrument'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications.rb:203:in `instrument'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
 163eaaee | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
 163eaaee | /usr/share/gems/gems/katello-4.12.1/app/controllers/katello/concerns/api/api_controller.rb:46:in `process_action'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/base.rb:165:in `process'
 163eaaee | /usr/share/gems/gems/actionview-6.1.7.8/lib/action_view/rendering.rb:39:in `process'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal.rb:190:in `dispatch'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal.rb:254:in `dispatch'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:33:in `serve'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:49:in `serve'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `each'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `serve'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:842:in `call'
 163eaaee | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/engine.rb:539:in `call'
 163eaaee | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `public_send'
 163eaaee | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `method_missing'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:20:in `block in <class:Constraints>'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:49:in `serve'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `each'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `serve'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:842:in `call'
 163eaaee | /usr/share/gems/gems/katello-4.12.1/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
 163eaaee | /usr/share/gems/gems/katello-4.12.1/lib/katello/middleware/event_daemon.rb:10:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 163eaaee | /usr/share/gems/gems/apipie-dsl-2.6.2/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
 163eaaee | /usr/share/gems/gems/apipie-rails-1.3.0/lib/apipie/static_dispatcher.rb:74:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 163eaaee | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
 163eaaee | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
 163eaaee | /usr/share/gems/gems/apipie-rails-1.3.0/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/tempfile_reaper.rb:15:in `call'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/etag.rb:27:in `call'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/conditional_get.rb:40:in `call'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/head.rb:12:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
 163eaaee | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/session/abstract/id.rb:266:in `context'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/session/abstract/id.rb:260:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/cookies.rb:697:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:98:in `run_callbacks'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
 163eaaee | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:37:in `call_app'
 163eaaee | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:28:in `call'
 163eaaee | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
 163eaaee | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
 163eaaee | /usr/share/gems/gems/request_store-1.6.0/lib/request_store/middleware.rb:19:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/request_id.rb:26:in `call'
 163eaaee | /usr/share/gems/gems/katello-4.12.1/lib/katello/prevent_json_parsing.rb:12:in `call'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/method_override.rb:24:in `call'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/runtime.rb:22:in `call'
 163eaaee | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/executor.rb:14:in `call'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/sendfile.rb:110:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/ssl.rb:77:in `call'
 163eaaee | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
 163eaaee | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
 163eaaee | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/engine.rb:539:in `call'
 163eaaee | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `public_send'
 163eaaee | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `method_missing'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/urlmap.rb:74:in `block in call'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/urlmap.rb:58:in `each'
 163eaaee | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/urlmap.rb:58:in `call'
 163eaaee | /usr/share/gems/gems/puma-6.4.2/lib/puma/configuration.rb:272:in `call'
 163eaaee | /usr/share/gems/gems/puma-6.4.2/lib/puma/request.rb:100:in `block in handle_request'
 163eaaee | /usr/share/gems/gems/puma-6.4.2/lib/puma/thread_pool.rb:378:in `with_force_shutdown'
 163eaaee | /usr/share/gems/gems/puma-6.4.2/lib/puma/request.rb:99:in `handle_request'
 163eaaee | /usr/share/gems/gems/puma-6.4.2/lib/puma/server.rb:464:in `process_client'
 163eaaee | /usr/share/gems/gems/puma-6.4.2/lib/puma/server.rb:245:in `block in run'
 163eaaee | /usr/share/gems/gems/puma-6.4.2/lib/puma/thread_pool.rb:155:in `block in spawn_thread'
 163eaaee | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2024-07-16T12:56:34 [I|app|163eaaee] Completed 500 Internal Server Error in 196ms (Views: 0.3ms | ActiveRecord: 86.5ms | Allocations: 31614)

When I try to disable the sp_rocky_linux9 sync plan via the web interface.

An error occurred saving the Sync Plan: undefined method `frozen=’ for nil:NilClass

2024-07-16T12:55:50 [I|app|a10cce6d] Started PUT "/katello/api/v2/organizations/4/sync_plans/9" for 172.28.16.32 at 2024-07-16 12:55:50 -0300
2024-07-16T12:55:50 [I|app|a10cce6d] Processing by Katello::Api::V2::SyncPlansController#update as HTML
2024-07-16T12:55:50 [I|app|a10cce6d]   Parameters: {"id"=>"9", "organization_id"=>"4", "name"=>"sp_rocky_linux9", "description"=>"Repos para o Produto Rocky Linux 9", "interval"=>"daily", "next_sync"=>"2024-06-26 22:30:00 -0300", "sync_date"=>"Tuesday, June 18, 2024 at 10:30:00 PM", "created_at"=>"2024-06-17 15:00:39 -0300", "updated_at"=>"2024-06-18 12:54:30 -0300", "enabled"=>false, "foreman_tasks_recurring_logic_id"=>46, 
"cron_expression"=>nil, "products"=>[{"id"=>35, "cp_id"=>"878577181345", "name"=>"Rocky Linux 9", "label"=>"rocky_linux_9", "description"=>"Distribuição Linux downstream compatível com RHEL", "sync_state"=>"Syncing Complete.", "last_sync"=>"2024-07-12 14:21:35 -0300", "last_sync_words"=>"4 days", "repository_count"=>45}], "permissions"=>{"view_sync_plans"=>true, "edit_sync_plans"=>true, "destroy_sync_plans"=>true}, "syncDate"=>"2024-06-19T01:30:00.000Z", "syncTime"=>"2024-06-19T01:30:00.000Z", "api_version"=>"v2", "sync_plan"=>{"id"=>"9", "name"=>"sp_rocky_linux9", "description"=>"Repos para o Produto Rocky Linux 9", "sync_date"=>"Tuesday, June 18, 2024 at 10:30:00 PM", "interval"=>"daily", "organization_id"=>"4", "created_at"=>"2024-06-17 15:00:39 -0300", "updated_at"=>"2024-06-18 12:54:30 -0300", "foreman_tasks_recurring_logic_id"=>46, "cron_expression"=>nil}}
2024-07-16T12:55:50 [E|app|a10cce6d] NoMethodError: undefined method `frozen=' for nil:NilClass
 a10cce6d | /usr/share/gems/gems/dynflow-1.8.3/lib/dynflow/persistence.rb:116:in `set_delayed_plan_frozen'
 a10cce6d | /usr/share/gems/gems/foreman-tasks-9.1.1/app/models/foreman_tasks/recurring_logic.rb:43:in `enabled='
 a10cce6d | /usr/share/gems/gems/katello-4.12.1/app/controllers/katello/api/v2/sync_plans_controller.rb:75:in `update'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/base.rb:228:in `process_action'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/rendering.rb:30:in `process_action'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
 a10cce6d | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 a10cce6d | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 a10cce6d | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 a10cce6d | /usr/share/gems/gems/audited-5.4.3/lib/audited/sweeper.rb:16:in `around'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 a10cce6d | /usr/share/gems/gems/audited-5.4.3/lib/audited/sweeper.rb:16:in `around'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:137:in `run_callbacks'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/callbacks.rb:41:in `process_action'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/rescue.rb:22:in `process_action'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications.rb:203:in `block in instrument'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications.rb:203:in `instrument'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
 a10cce6d | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
 a10cce6d | /usr/share/gems/gems/katello-4.12.1/app/controllers/katello/concerns/api/api_controller.rb:46:in `process_action'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/base.rb:165:in `process'
 a10cce6d | /usr/share/gems/gems/actionview-6.1.7.8/lib/action_view/rendering.rb:39:in `process'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal.rb:190:in `dispatch'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal.rb:254:in `dispatch'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:33:in `serve'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:49:in `serve'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `each'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `serve'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:842:in `call'
 a10cce6d | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/engine.rb:539:in `call'
 a10cce6d | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `public_send'
 a10cce6d | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `method_missing'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:20:in `block in <class:Constraints>'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:49:in `serve'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `each'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `serve'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:842:in `call'
 a10cce6d | /usr/share/gems/gems/katello-4.12.1/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
 a10cce6d | /usr/share/gems/gems/katello-4.12.1/lib/katello/middleware/event_daemon.rb:10:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 a10cce6d | /usr/share/gems/gems/apipie-dsl-2.6.2/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
 a10cce6d | /usr/share/gems/gems/apipie-rails-1.3.0/lib/apipie/static_dispatcher.rb:74:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 a10cce6d | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
 a10cce6d | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
 a10cce6d | /usr/share/gems/gems/apipie-rails-1.3.0/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/tempfile_reaper.rb:15:in `call'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/etag.rb:27:in `call'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/conditional_get.rb:40:in `call'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/head.rb:12:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
 a10cce6d | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/session/abstract/id.rb:266:in `context'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/session/abstract/id.rb:260:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/cookies.rb:697:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:98:in `run_callbacks'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
 a10cce6d | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:37:in `call_app'
 a10cce6d | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:28:in `call'
 a10cce6d | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
 a10cce6d | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
 a10cce6d | /usr/share/gems/gems/request_store-1.6.0/lib/request_store/middleware.rb:19:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/request_id.rb:26:in `call'
 a10cce6d | /usr/share/gems/gems/katello-4.12.1/lib/katello/prevent_json_parsing.rb:12:in `call'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/method_override.rb:24:in `call'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/runtime.rb:22:in `call'
 a10cce6d | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/executor.rb:14:in `call'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/sendfile.rb:110:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/ssl.rb:77:in `call'
 a10cce6d | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
 a10cce6d | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
 a10cce6d | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/engine.rb:539:in `call'
 a10cce6d | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `public_send'
 a10cce6d | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `method_missing'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/urlmap.rb:74:in `block in call'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/urlmap.rb:58:in `each'
 a10cce6d | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/urlmap.rb:58:in `call'
 a10cce6d | /usr/share/gems/gems/puma-6.4.2/lib/puma/configuration.rb:272:in `call'
 a10cce6d | /usr/share/gems/gems/puma-6.4.2/lib/puma/request.rb:100:in `block in handle_request'
 a10cce6d | /usr/share/gems/gems/puma-6.4.2/lib/puma/thread_pool.rb:378:in `with_force_shutdown'
 a10cce6d | /usr/share/gems/gems/puma-6.4.2/lib/puma/request.rb:99:in `handle_request'
 a10cce6d | /usr/share/gems/gems/puma-6.4.2/lib/puma/server.rb:464:in `process_client'
 a10cce6d | /usr/share/gems/gems/puma-6.4.2/lib/puma/server.rb:245:in `block in run'
 a10cce6d | /usr/share/gems/gems/puma-6.4.2/lib/puma/thread_pool.rb:155:in `block in spawn_thread'
 a10cce6d | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2024-07-16T12:55:50 [I|app|a10cce6d] Completed 500 Internal Server Error in 37ms (Views: 0.2ms | ActiveRecord: 9.6ms | Allocations: 10612)

Putting together the stacktrace, the lack of start at the latest task and the lack of last occurrence in recurring logic details, we can conclude that this is busted beyond saving. Removing the sync plans and creating them again as you already did is the only way to go. That’s all I can say from the information you provided.

Thank you for your attention.
When trying to remove the synchronization plans through the web interface, I also receive the error and the plans in question are not deleted.
Strange.

2024-07-23T14:27:35 [I|app|56b3857a] Started DELETE "/katello/api/v2/organizations/4/sync_plans/7" for 172.28.16.32 at 2024-07-23 14:27:35 -0300
2024-07-23T14:27:35 [I|app|56b3857a] Processing by Katello::Api::V2::SyncPlansController#destroy as HTML
2024-07-23T14:27:35 [I|app|56b3857a]   Parameters: {"api_version"=>"v2", "organization_id"=>"4", "id"=>"7"}
2024-07-23T14:27:35 [I|aud|56b3857a] Katello::SyncPlan (7) destroy event on name sp_zabbix
2024-07-23T14:27:35 [I|aud|56b3857a] Katello::SyncPlan (7) destroy event on description Repos para o Produto Zabbix
2024-07-23T14:27:35 [I|aud|56b3857a] Katello::SyncPlan (7) destroy event on sync_date 2024-06-18 22:20:00 -0300
2024-07-23T14:27:35 [I|aud|56b3857a] Katello::SyncPlan (7) destroy event on interval daily
2024-07-23T14:27:35 [I|aud|56b3857a] Katello::SyncPlan (7) destroy event on organization_id 4
2024-07-23T14:27:35 [I|aud|56b3857a] Katello::SyncPlan (7) destroy event on foreman_tasks_recurring_logic_id 48
2024-07-23T14:27:35 [I|aud|56b3857a] Katello::SyncPlan (7) destroy event on cron_expression
2024-07-23T14:27:35 [I|aud|56b3857a] Katello::SyncPlan (7) destroy event on task_group_id 54
2024-07-23T14:27:35 [I|aud|56b3857a] Katello::SyncPlan (7) destroy event on product_ids [44]
2024-07-23T14:27:35 [E|app|56b3857a] NoMethodError: undefined method `cancel' for nil:NilClass
 56b3857a | /usr/share/gems/gems/dynflow-1.8.3/lib/dynflow/execution_plan.rb:311:in `block in cancel'
 56b3857a | /usr/share/gems/gems/dynflow-1.8.3/lib/dynflow/execution_plan.rb:311:in `tap'
 56b3857a | /usr/share/gems/gems/dynflow-1.8.3/lib/dynflow/execution_plan.rb:311:in `cancel'
 56b3857a | /usr/share/gems/gems/foreman-tasks-9.1.1/app/models/foreman_tasks/task/dynflow_task.rb:32:in `cancel'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/relation/delegation.rb:88:in `each'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/relation/delegation.rb:88:in `each'
 56b3857a | /usr/share/gems/gems/foreman-tasks-9.1.1/app/models/foreman_tasks/recurring_logic.rb:95:in `cancel'
 56b3857a | /usr/share/gems/gems/katello-4.12.1/app/models/katello/sync_plan.rb:125:in `cancel_recurring_logic'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:427:in `block in make_lambda'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:603:in `catch'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:603:in `block in default_terminator'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:199:in `block in halting'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:512:in `block in invoke_before'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:512:in `each'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:512:in `invoke_before'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:105:in `run_callbacks'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:824:in `_run_destroy_callbacks'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/callbacks.rb:439:in `destroy'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/transactions.rb:294:in `block in destroy'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/transactions.rb:350:in `with_transaction_returning_status'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/transactions.rb:294:in `destroy'
 56b3857a | /usr/share/gems/gems/katello-4.12.1/app/models/katello/model.rb:23:in `destroy!'
 56b3857a | /usr/share/gems/gems/katello-4.12.1/app/controllers/katello/api/v2/sync_plans_controller.rb:88:in `destroy'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/base.rb:228:in `process_action'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/rendering.rb:30:in `process_action'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
 56b3857a | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 56b3857a | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 56b3857a | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 56b3857a | /usr/share/gems/gems/audited-5.4.3/lib/audited/sweeper.rb:16:in `around'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 56b3857a | /usr/share/gems/gems/audited-5.4.3/lib/audited/sweeper.rb:16:in `around'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:137:in `run_callbacks'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/callbacks.rb:41:in `process_action'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/rescue.rb:22:in `process_action'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications.rb:203:in `block in instrument'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications.rb:203:in `instrument'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
 56b3857a | /usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
 56b3857a | /usr/share/gems/gems/katello-4.12.1/app/controllers/katello/concerns/api/api_controller.rb:46:in `process_action'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/abstract_controller/base.rb:165:in `process'
 56b3857a | /usr/share/gems/gems/actionview-6.1.7.8/lib/action_view/rendering.rb:39:in `process'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal.rb:190:in `dispatch'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_controller/metal.rb:254:in `dispatch'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:33:in `serve'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:49:in `serve'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `each'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `serve'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:842:in `call'
 56b3857a | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/engine.rb:539:in `call'
 56b3857a | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `public_send'
 56b3857a | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `method_missing'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:20:in `block in <class:Constraints>'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:49:in `serve'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `each'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32:in `serve'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:842:in `call'
 56b3857a | /usr/share/gems/gems/katello-4.12.1/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
 56b3857a | /usr/share/gems/gems/katello-4.12.1/lib/katello/middleware/event_daemon.rb:10:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 56b3857a | /usr/share/gems/gems/apipie-dsl-2.6.2/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
 56b3857a | /usr/share/gems/gems/apipie-rails-1.3.0/lib/apipie/static_dispatcher.rb:74:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24:in `call'
 56b3857a | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
 56b3857a | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
 56b3857a | /usr/share/gems/gems/apipie-rails-1.3.0/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/tempfile_reaper.rb:15:in `call'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/etag.rb:27:in `call'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/conditional_get.rb:40:in `call'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/head.rb:12:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
 56b3857a | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/session/abstract/id.rb:266:in `context'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/session/abstract/id.rb:260:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/cookies.rb:697:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:98:in `run_callbacks'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
 56b3857a | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:37:in `call_app'
 56b3857a | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:28:in `call'
 56b3857a | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
 56b3857a | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
 56b3857a | /usr/share/gems/gems/request_store-1.6.0/lib/request_store/middleware.rb:19:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/request_id.rb:26:in `call'
 56b3857a | /usr/share/gems/gems/katello-4.12.1/lib/katello/prevent_json_parsing.rb:12:in `call'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/method_override.rb:24:in `call'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/runtime.rb:22:in `call'
 56b3857a | /usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/executor.rb:14:in `call'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/sendfile.rb:110:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/ssl.rb:77:in `call'
 56b3857a | /usr/share/gems/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
 56b3857a | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
 56b3857a | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/engine.rb:539:in `call'
 56b3857a | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `public_send'
 56b3857a | /usr/share/gems/gems/railties-6.1.7.8/lib/rails/railtie.rb:207:in `method_missing'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/urlmap.rb:74:in `block in call'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/urlmap.rb:58:in `each'
 56b3857a | /usr/share/gems/gems/rack-2.2.8.1/lib/rack/urlmap.rb:58:in `call'
 56b3857a | /usr/share/gems/gems/puma-6.4.2/lib/puma/configuration.rb:272:in `call'
 56b3857a | /usr/share/gems/gems/puma-6.4.2/lib/puma/request.rb:100:in `block in handle_request'
 56b3857a | /usr/share/gems/gems/puma-6.4.2/lib/puma/thread_pool.rb:378:in `with_force_shutdown'
 56b3857a | /usr/share/gems/gems/puma-6.4.2/lib/puma/request.rb:99:in `handle_request'
 56b3857a | /usr/share/gems/gems/puma-6.4.2/lib/puma/server.rb:464:in `process_client'
 56b3857a | /usr/share/gems/gems/puma-6.4.2/lib/puma/server.rb:245:in `block in run'
 56b3857a | /usr/share/gems/gems/puma-6.4.2/lib/puma/thread_pool.rb:155:in `block in spawn_thread'
 56b3857a | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2024-07-23T14:27:35 [I|app|56b3857a] Completed 500 Internal Server Error in 80ms (Views: 0.2ms | ActiveRecord: 19.5ms | Allocations: 14252)
2024-07-23T14:27:38 [I|app|badacd64] Started GET "/notification_recipients" for 172.28.16.32 at 2024-07-23 14:27:38 -0300
2024-07-23T14:27:38 [I|app|badacd64] Processing by NotificationRecipientsController#index as JSON
2024-07-23T14:27:38 [I|app|badacd64] Completed 200 OK in 11ms (Views: 0.1ms | ActiveRecord: 2.9ms | Allocations: 1989)