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 1997186 - [regression] data.yml is referring to old sync plain id which does not exist in katello_sync_plans
Summary: [regression] data.yml is referring to old sync plain id which does not exist ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.13.0
Assignee: Eric Helms
QA Contact: Griffin Sullivan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-24 15:01 UTC by Joniel Pasqualetto
Modified: 2024-04-03 10:53 UTC (History)
15 users (show)

Fixed In Version: rubygem-foreman_maintain-1.2.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2175007 (view as bug list)
Environment:
Last Closed: 2023-05-03 13:21:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36024 0 Normal Ready For Testing sync-plans not in sync with foreman-maintan data.yml 2023-02-16 17:56:55 UTC
Github theforeman foreman_maintain pull 681 0 None open Fixes #36024 - ignore already deleted sync plans 2023-02-16 02:26:00 UTC
Red Hat Issue Tracker SAT-15078 0 None None None 2023-01-24 17:53:57 UTC
Red Hat Knowledge Base (Solution) 6967460 0 None None None 2022-08-02 05:01:25 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:21:16 UTC

Description Joniel Pasqualetto 2021-08-24 15:01:19 UTC
Description of problem:
foreman-maintain will try to re-enable sync plans that don't exist anymore if there are references to them on the data.yml file.

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

Satellite 6.9

How reproducible:


Steps to Reproduce:
1. Create 2 sync plans
2. Disable sync plans using foreman-maintain:

~~~
# foreman-maintain advanced procedure run sync-plans-disable
Running ForemanMaintain::Scenario
================================================================================
disable active sync plans: 
\ Total 2 sync plans are now disabled.                                [OK]      
--------------------------------------------------------------------------------
~~~

3. Remove one of the sync-plans

~~~
# hammer sync-plan delete --id 4
Sync plan destroyed.
~~~

4. Try enabling sync plans back:

~~~
# foreman-maintain advanced procedure run sync-plans-enable
Running ForemanMaintain::Scenario
================================================================================
re-enable sync plans: 
| re-enabling sync plans                                              [FAIL]    
Could not update the sync plan:
  Could not find sync_plan resource with id 4. Potential missing permissions: edit_sync_plans
--------------------------------------------------------------------------------
Scenario [ForemanMaintain::Scenario] failed.

The following steps ended up in failing state:

  [sync-plans-enable]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="sync-plans-enable"
~~~

Actual results:
Fail to re-enable sync plans

Expected results:
All valid sync plans would be enabled

Additional info:

BZ#1717020 was about the exact same thing and is supposed to be fixed on 6.6, however we can see it in 6.9.

Comment 2 qfz769 2022-11-11 16:02:57 UTC
I am on 6.11.4 and having this issue still..

Going with this work around while waiting for a solution - not great not terrible.
https://access.redhat.com/solutions/6967460

Red Hat, when do you expect it to be fixed?

Comment 3 Sayan Das 2022-11-11 16:24:37 UTC
Hello,

There is a much better solution present than what is documented in the KB.

A) mv /var/lib/foreman-maintain/data.yml /tmp/

B) use "hammer sync-plan list" to check the current list of sync plans and note down their IDs

C) Use "hammer sync-plan update --id X --enabled true" to enable the sync plans manually [ if found any disabled ] [ here X should be replaced by ID of the sync plan ]

D) Now fix satellite-maintain :

# satellite-maintain advanced procedure run sync-plans-disable

# cat /var/lib/foreman-maintain/data.yml 

  --> It should record the ID of currently present sync plans under "disabled" section


# satellite-maintain advanced procedure run sync-plans-enable

# cat /var/lib/foreman-maintain/data.yml 

  --> It should record the ID of currently present sync plans under "enabled" section


And now, you are good to normally use satellite-maintain or foreman-maintain command for upgrade or backup or restore without needing to whitelist any steps.

Comment 4 qfz769 2022-11-11 22:04:47 UTC
hehe fixed!

Thank you - works like a charm :)

Comment 6 Griffin Sullivan 2023-03-14 17:31:15 UTC
Verified on 6.13 snap 14

Deleting sync plans when disabled does not disrupt foreman-maintain's ability to enable the right sync plans.

Steps to Reproduce:

1. Create 2 sync plans

2. # foreman-maintain advanced procedure run sync-plans-disable

3. # hammer sync-plan delete --id 3

4. # foreman-maintain advanced procedure run sync-plans-enable

Results:

Running ForemanMaintain::Scenario
================================================================================
re-enable sync plans: 
| Total 1 sync plans are now enabled.                                 [OK]      
--------------------------------------------------------------------------------


You can also see the proper list of enabled and disabled sync plans in /var/lib/foreman-maintain/data.yml

Comment 9 errata-xmlrpc 2023-05-03 13:21:03 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.