Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2131839 - re-enabling sync plans [FAIL] Could not update the sync plan: ERF28-1357 [ForemanTasks::RecurringLogicCancelledException]: Cannot update a cancelled Recurring Logic.
Summary: re-enabling sync plans [FAIL] Co...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Dynflow
Version: 6.11.3
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: 6.13.0
Assignee: Adam Ruzicka
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-10-03 21:26 UTC by William Staten
Modified: 2024-02-15 09:04 UTC (History)
14 users (show)

Fixed In Version: rubygem-dynflow-1.6.10
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2184125 (view as bug list)
Environment:
Last Closed: 2023-05-03 13:22:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github Dynflow dynflow pull 422 0 None Merged Fix oddities in delayed planning 2023-02-28 12:45:10 UTC
Github Dynflow dynflow pull 423 0 None Merged Fix issues with delayed executor and rails 2023-03-01 12:25:51 UTC
Red Hat Issue Tracker SAT-14836 0 None None None 2023-01-09 18:30:11 UTC
Red Hat Knowledge Base (Solution) 5694161 0 None None None 2023-02-09 14:18:43 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:23:51 UTC

Description William Staten 2022-10-03 21:26:19 UTC
Description of problem: When updating from Satellite 6.11.2 to 6.11.3 I get the  following message:

re-enabling sync plans                                              [FAIL]
Could not update the sync plan:
  ERF28-1357 [ForemanTasks::RecurringLogicCancelledException]: Cannot update a cancelled Recurring Logic.
--------------------------------------------------------------------------------
Scenario [Procedures after migrating to Satellite 6.11.z] failed.

The following steps ended up in failing state:

  [sync-plans-enable]

Resolve the failed steps and rerun the command.

If the situation persists and, you are unclear what to do next,
contact Red Hat Technical Support.

In case the failures are false positives, use
--whitelist="sync-plans-enable"

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.satellite-maintain upgrade run --target-version 6.11.z
2.
3.

Actual results:
\ All services started                                                [OK]
--------------------------------------------------------------------------------
re-enable sync plans:
| re-enabling sync plans                                              [FAIL]
Could not update the sync plan:
  ERF28-1357 [ForemanTasks::RecurringLogicCancelledException]: Cannot update a cancelled Recurring Logic.
--------------------------------------------------------------------------------
Scenario [Procedures after migrating to Satellite 6.11.z] failed.

The following steps ended up in failing state:

  [sync-plans-enable]

Resolve the failed steps and rerun the command.

If the situation persists and, you are unclear what to do next,
contact Red Hat Technical Support.

In case the failures are false positives, use
--whitelist="sync-plans-enable"

Expected results:
run satellite satellite-maintain upgrade run --target-version 6.11.z and have it finish successfully. 

Additional info:

Comment 1 Brad Buckingham 2022-10-06 14:27:35 UTC
Hi William,

Thanks for raising the bugzilla with your finding.

Do you already have a case open on this with support?  If not, I'd recommend that we begin there.

Comment 2 William Staten 2022-10-11 10:37:06 UTC
I have already opened a case with support.

Comment 3 Steve Turner 2022-12-02 19:44:05 UTC
I also experienced this problem for which I opened the following case record:

https://access.redhat.com/support/cases/#/case/03373216

I suspect it was caused by the upgrade of our Satellite from 6.10 to 6.11.
I worked around the problem by deleting the offending sync plan and re-creating an identical plan (but which obviously has a new and unique recurring logics ID.

Comment 4 Pavel Moravec 2022-12-12 13:27:40 UTC
I hit it on my own Satellite as well. I *think* the sufficient reproducer is:

- have Sat 6.11.[0-3]
- have a sync plan
- disable it
- run upgrade to 6.11.4

Comment 7 Sayan Das 2023-02-02 12:12:52 UTC
Hello, 

I have Hilti AG reporting a similar issue with the upgrade to 6.12.1 and with the Recurring Logic for Inventory sync action. 

So I tested with Sync Plan stuff ( on 6.12.0 and 6.12.1 ):


* Created a sync plan with custom cron to be executed just after 2 mins

* Stop all services

* Bring up the services after 3 mins

* Check the sync plan and RL, the next sync date\time is still OLD

* Disable the RL, Try to reenable it, and fails with "ERF28-1357 [ForemanTasks::RecurringLogicCancelledException]: Cannot update a cancelled Recurring Logic."


The same was reproducible for Inventory Scheduled Sync Recurring Logic as well.

While for a sync plan, It's easy to fix from UI, but for Inventory Scheduled Sync Action, It's not since the cronline for the Recurring Logic is not editable ( yet ). So we have to clear that canceled logic and recreate a new from rake console

The fact that Satellite cannot gracefully handle the RL execution and Status if the "Next Run" falls into a downtime ( when services will be down ), that makes it nearly impossible for users to identify the source of the issue and then fix it somehow. 


Let me know if a new BZ is needed for this .

Comment 10 Adam Ruzicka 2023-02-03 12:15:20 UTC
Dynflow has a built in subcomponent which runs inside the orchestrator and periodically dispatches delayed execution plans scheduled for the future. Once the delayed plan is properly planned, the delay record (the thing saying "an execution plan $X should be executed at time $T") is destroyed. There are some safeguards in place to ensure a single delayed plan does not get planned multiple times. 

Issue 1:
In sidekiq-based deployments, the delayed plan dispatching subcomponent is started too early, while the rest of the orchestrator is still doing world validity checks. This can lead to a situation where the subcomponent dispatches a single delayed plan multiple times.

Issue 2:
When delayed plans get dispatched multiple times, the safeguards are not handling it properly. The safeguards essentially act as an early return in case the plan in question is already being planned, however, as soon as the early return happens, the delayed record is removed. This breaks planning of the next repetition, which relies on data from it.

Comment 12 Lukáš Hellebrandt 2023-03-22 13:37:24 UTC
Verified with Sat 6.13.0 snap 15.0 and upgrade path 6.12.3 snap 2.0 -> 6.13.0 snap 15.0.

1) Create a recurring task (All hosts -> <host> -> Schedule a job) with cron "*/2 * * * *"
2) Create a sync plan (Content -> Sync plans -> Create sync plan) on some repo with the same cron
3) Run the upgrade to 6.13
4) Go to Recurring logics and disable both
5) Enable them again

A sync plan created in 2) was rescheduled to future during upgrade.

A recurring task created in 1) was NOT rescheduled to future during upgrade. After disabling it manually, it can't be enabled again. It doesn't run at specified time.

This BZ specifically mentions sync plans so I'm verifying it and filing a followup BZ for general recurring tasks, like running hosts jobs.

Comment 14 Sayan Das 2023-04-14 13:48:10 UTC
(In reply to Lukáš Hellebrandt from comment #12)
> Verified with Sat 6.13.0 snap 15.0 and upgrade path 6.12.3 snap 2.0 ->
> 6.13.0 snap 15.0.
> 
> 1) Create a recurring task (All hosts -> <host> -> Schedule a job) with cron
> "*/2 * * * *"
> 2) Create a sync plan (Content -> Sync plans -> Create sync plan) on some
> repo with the same cron
> 3) Run the upgrade to 6.13
> 4) Go to Recurring logics and disable both
> 5) Enable them again
> 
> A sync plan created in 2) was rescheduled to future during upgrade.
> 
> A recurring task created in 1) was NOT rescheduled to future during upgrade.
> After disabling it manually, it can't be enabled again. It doesn't run at
> specified time.
> 
> This BZ specifically mentions sync plans so I'm verifying it and filing a
> followup BZ for general recurring tasks, like running hosts jobs.

Hi Adam,

Do you think this will affect The InventorySync Recurring logic as well in the same way it affected a normal recurring REX task ?


@Lukas,

Would it be possible to do a second test ?

* Ensure that "Inventory Scheduled Sync" is scheduled to execute tonight and note down the time\date
* Leave all services of satellite overnight --> 'satellite-maintain service stop'
* Start back the services next day or few mins after the RL was supposed to be executed --> 'satellite-maintain service start'
* Verify if "Inventory Scheduled Sync" continues to work or the RL is just not working any more.


-- Sayan

Comment 15 Adam Ruzicka 2023-04-17 08:02:59 UTC
> Do you think this will affect The InventorySync Recurring logic as well in the same way it affected a normal recurring REX task ?

I'm afraid right now I can't give you a better answer than maybe. All three (sync plans, rex jobs and inventory sync) use the same code paths under the hood and as of now I don't see how it could work for one but not for others.

Comment 16 Lukáš Hellebrandt 2023-04-17 09:41:58 UTC
This is the followup BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2180875

Comment 17 Lukáš Hellebrandt 2023-04-18 09:35:56 UTC
@Sayan done. After starting the services, the sync plans ran once and were scheduled for the next regular occurence. Sat 6.13 snap 18.0.

Comment 18 Sayan Das 2023-04-18 09:39:13 UTC
(In reply to Lukáš Hellebrandt from comment #17)
> @Sayan done. After starting the services, the sync plans ran once and were
> scheduled for the next regular occurence. Sat 6.13 snap 18.0.

Thanks Lukas. But, Was it Sync plan or "Inventory Scheduled Sync" that you tested this time ?

-- Sayan

Comment 19 Lukáš Hellebrandt 2023-04-18 09:45:41 UTC
I supposed you meant Sync Plan, i.e. repository sync. Did you really mean Insights inventory sync? Because that is only mildly related to this BZ which is about product sync plans.

Comment 20 Sayan Das 2023-04-18 09:55:42 UTC
(In reply to Lukáš Hellebrandt from comment #19)
> I supposed you meant Sync Plan, i.e. repository sync. Did you really mean
> Insights inventory sync? Because that is only mildly related to this BZ
> which is about product sync plans.

Well, You already had confirmed about Repo Sync plans on Comment 12 but if you see above in Comment 7 , We also had discussed the same issue for "Inventory Scheduled Sync" as well and the BZ fix is technically expected to cover that task\action.

The way you found that REX-related recurring logics were affected, Can you perhaps repeat a similar test for "Inventory Scheduled Sync" ( InventorySync::Async::InventoryScheduledSync )  as well to confirm whether it's working or It also needs to fixed via followup BZ https://bugzilla.redhat.com/show_bug.cgi?id=2180875 ?


-- Sayan

Comment 21 Lukáš Hellebrandt 2023-04-18 15:07:20 UTC
In 6.13, I can see task "Wait and Inventory scheduled sync". When I used your reproducer, that task ran and was correctly rescheduled. Is that what you need?

Comment 22 Sayan Das 2023-04-18 15:12:13 UTC
Yup yup.. As long as "Inventory scheduled sync" continues to reschedule, I guess the fix is working.. 

Do you think this info needs to be posted in the follow up BZ as well ?


-- Sayan

Comment 24 errata-xmlrpc 2023-05-03 13:22:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.13 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2097


Note You need to log in before you can comment on or make changes to this bug.