Sync plan does not work after Red Hat Satellite upgrade.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • Sync plan is not working after the upgrade to the next version.

Resolution

  • Verify the Sync plan and Recurring logic information in the Satellite.

    # hammer organization list
    # hammer sync-plan list --organization-id X
    # hammer recurring-logic list
    
    • Replace X with the correct organization ID

    • The expectation is that Sync Plan should show the Next Sync date and the Recurring Logic associated to the sync plan should be in the active state.

  • If everything looks as expected above then ensure that, We can see some output of this command. The count of records in the output should match the count of enabled sync plans.

    # su - postgres -c "psql foreman -c \"select * from dynflow_delayed_plans inner join foreman_tasks_tasks on \
      foreman_tasks_tasks.external_id::uuid = dynflow_delayed_plans.execution_plan_uuid where label = 'Actions::Katello::SyncPlan::Run' and started_at is null;\""
    
    • If Yes but the scheduled sync is not getting executed then, restart the following services on satellite.

             ** For Satellite 6.8 and above
             # satellite-maintain service restart --only=dynflow-sidekiq@orchestrator,dynflow-sidekiq@worker,dynflow-sidekiq@worker-hosts-queue
      
      
             ** For Satellite 6.7
             # satellite-maintain service restart --only=dynflowd
      
    • If no output from the query, then

      • Edit the sync plan from the Satellite UI --> Content --> Sync Plans page and set the value of Sync Enabled to No to disable it.
      • Enable back the sync plan from the exact same page.
      • If coming across an issue that Cannot update a cancelled Recurring Logic, then modify the Start Time of the sync plan and then try to disable and re-enable it.
      • Observe if the expected Next Sync date appeared and the database query itself is showing an output with Scheduled Sync plan task.

 

  • If the concernedRecurring logic is disabled, then enable it from the Satellite WebUI.

     * Satellite WebUI >> Monitor >> Recurring logics >> Enable
    
  • If the concerned Recurring logic is cancelled, then either modify the Start Time of the related sync plan or else create a new Sync plan.

    • NOTE: Cancelled Recurring logic can't be activated again.
  • When the Sync plan starts working as expected and many old cancelled recurring logics are observed in Satellite, Use the following command to clear them.

    # echo 'ForemanTasks::RecurringLogic.where(state: "cancelled").destroy_all' | foreman-rake console
    

For more KB articles/solutions related to Red Hat Satellite 6.x Satellite Tasking System Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Satellite Tasking System Issues

Root Cause

  • If Recurring logic is in disabled state, enable the 'Recurring logic`.
  • If Recurring logic is in cancelled state, then create a new Sync plan.

Diagnostic Steps

  • Verify the Sync plan and Recurring logic state in the Satellite.

    
    [root@satellite-101 ~]# hammer sync-plan list --organization-id 1
    
ID | NAME | START DATE          | INTERVAL | ENABLED | CRON EXPRESSION | RECURRING LOGIC ID

-|-|-|-|-|-|-
6 | Epel | 2021/02/01 07:04:00 | weekly | no | | 6
7 | EUS | 2021/02/02 07:06:00 | weekly | no | | 7
3 | R1 | 2021/02/06 07:01:00 | weekly | yes | | 3
4 | R2 | 2021/02/07 07:02:00 | weekly | no | | 4

5  | Sat  | 2021/02/03 07:03:00 | weekly   | yes     |                 | 5                 

-|-|-|-|-|-|-

[root@satellite ~]# hammer recurring-logic list 
ID | CRON LINE   | ITERATION | END TIME | STATE    

-|-|-|-|-
5 | 33 12 * * 3 | 2 | | active
4 | 32 12 * * 0 | 2 | | disabled
3 | 31 12 * * 6 | 2 | | active
6 | 34 12 * * 1 | 2 | | cancelled

7  | 36 12 * * 2 | 2         |          | cancelled

-|-|-|-|-
```

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.