Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1389533

Summary: [RFE] Disable sync plans automatically before upgrade
Product: Red Hat Satellite Reporter: sthirugn <sthirugn>
Component: Satellite MaintainAssignee: Anurag Patel <apatel>
Status: CLOSED CURRENTRELEASE QA Contact: Nikhil Kathole <nkathole>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, bkearney, inecas, kgaikwad, nkathole, oshtaier, szadok
Target Milestone: UnspecifiedKeywords: FutureFeature, PrioBumpField, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/17743
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-11 19:46:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1459226    

Description sthirugn@redhat.com 2016-10-27 20:07:58 UTC
Description of problem:
[RFE] Disable sync plans automatically before upgrade

Version-Release number of selected component (if applicable):
satellite-6.2.3-1.0.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Keeping the sync plans enabled during a lengthy upgrade process - creates sync plan tasks which errors or never completes.

Actual results:
Errored sync plan tasks.

Expected results:
[1] Upgrade process needs to automatically disable all the enabled sync plans.
[2] The disabled sync plans should be re-enabled at the end of the upgrade process

Additional info:

Comment 2 Shlomi Zadok 2016-12-19 17:02:47 UTC
Created redmine issue http://projects.theforeman.org/issues/17743 from this bug

Comment 8 Nikhil Kathole 2017-12-19 14:35:00 UTC
VERIFIED

# rpm -q rubygem-foreman_maintain
rubygem-foreman_maintain-0.1.1-1.el7sat.noarch

Running Procedures before migrating to Satellite 6.2.z
================================================================================
Turn on maintenance mode:                                             [OK]
--------------------------------------------------------------------------------
disable active sync plans:
| Total 2 sync plans are now disabled.                                [OK]
--------------------------------------------------------------------------------

D, [2017-12-19 09:28:07-0500 #99697] DEBUG -- : Running command su postgres -c 'cd ~; psql -d foreman' with stdin "COPY (        SELECT id FROM kat
ello_sync_plans WHERE enabled ='t'\n) TO STDOUT WITH CSV HEADER"
D, [2017-12-19 09:28:07-0500 #99697] DEBUG -- : output of the command:
 id
1
2
D, [2017-12-19 09:28:07-0500 #99697] DEBUG -- : Running command LANG=en_US.utf-8 hammer -c "/etc/foreman-maintain/foreman-maintain-hammer.yml" --in
teractive=no sync-plan update --id 1 --enabled false with stdin nil
D, [2017-12-19 09:28:08-0500 #99697] DEBUG -- : output of the command:
 Sync plan updated
D, [2017-12-19 09:28:08-0500 #99697] DEBUG -- : Running command LANG=en_US.utf-8 hammer -c "/etc/foreman-maintain/foreman-maintain-hammer.yml" --in
teractive=no sync-plan update --id 2 --enabled false with stdin nil
D, [2017-12-19 09:28:09-0500 #99697] DEBUG -- : output of the command:
 Sync plan updated


Running Procedures after migrating to Satellite 6.2.z
================================================================================
katello-service start:
| No katello service to start                                         [OK]
--------------------------------------------------------------------------------
Turn off maintenance mode:                                            [OK]
--------------------------------------------------------------------------------
re-enable sync plans:
- Total 2 sync plans are now enabled.                                 [OK]
--------------------------------------------------------------------------------

D, [2017-12-19 09:33:08-0500 #99697] DEBUG -- : Running command LANG=en_US.utf-8 hammer -c "/etc/foreman-maintain/foreman-maintain-hammer.yml" --in
teractive=no sync-plan update --id 1 --enabled true with stdin nil
D, [2017-12-19 09:33:12-0500 #99697] DEBUG -- : output of the command:
 Sync plan updated
D, [2017-12-19 09:33:12-0500 #99697] DEBUG -- : Running command LANG=en_US.utf-8 hammer -c "/etc/foreman-maintain/foreman-maintain-hammer.yml" --in
teractive=no sync-plan update --id 2 --enabled true with stdin nil
D, [2017-12-19 09:33:13-0500 #99697] DEBUG -- : output of the command:
 Sync plan updated

Comment 9 Bryan Kearney 2018-01-11 19:46:57 UTC
rubygem-foreman_maintain-0.1.1-1.el7sat.noarch has been released. Closing this out.