Bug 2001674

Summary: satellite-installer always redundantly runs "upgrade:run" and "katello:correct_repositories" rake scripts
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: InstallationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Devendra Singh <desingh>
Severity: high Docs Contact:
Priority: high    
Version: 6.10.0CC: egolov, ehelms, gtalreja
Target Milestone: 6.10.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: foreman-installer-2.5.2.3-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 14:13:42 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:

Description Pavel Moravec 2021-09-06 17:37:01 UTC
Description of problem:
Sat6.10 beta / batch14 lacks some downstream patch of satellite-installer to prevent running "upgrade:run" and "katello:correct_repositories" rake scripts whenever one executes the installer.

See recent discussion in satellite-eng mailing list.


Version-Release number of selected component (if applicable):
satellite-installer-6.10.0.4-1.el7sat.noarch
satellite-6.10.0-0.6.beta.el7sat.noarch


How reproducible:
100%


Steps to Reproduce:
1. satellite-installer --foreman-proxy-content-pulpcore-worker-count=4  # or whatever else tuning applied


Actual results:
Stdout contains:
..
2021-09-06 13:50:50 [NOTICE] [configure] System configuration has finished.
Executing: foreman-rake upgrade:run
'ErbParser' is ignored.
'RubyParser' is ignored.
=============================================
Upgrade Step 1/2: katello:correct_repositories. This may take a long while.
Processing Repository 1/4274: Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_64 7Server (1)
..


Expected results:
Neither "upgrade:run" or "katello:correct_repositories" rake script being run in those scenarios.


Additional info:

Comment 2 Devendra Singh 2021-09-13 17:38:28 UTC
Verified on 6.10 snap18

1- Checked the problem before the fix on snap15

2021-08-26 15:49:38 [INFO  ] [post] Executing hooks in group post
2021-08-26 15:49:38 [DEBUG ] [post] Hook /usr/share/foreman-installer/katello/hooks/post/25-register_with_insights.rb returned nil
2021-08-26 15:49:38 [DEBUG ] [root] Executing: foreman-rake upgrade:run
2021-08-26 15:50:05 [DEBUG ] [root] 'ErbParser' is ignored.
2021-08-26 15:50:05 [DEBUG ] [root] 'RubyParser' is ignored.
2021-08-26 15:50:05 [DEBUG ] [root] =============================================
2021-08-26 15:50:05 [DEBUG ] [root] Upgrade Step 1/2: katello:correct_repositories. This may take a long while.
2021-08-26 15:50:05 [DEBUG ] [root] =============================================
2021-08-26 15:50:05 [DEBUG ] [root] Upgrade Step 2/2: katello:clean_backend_objects. This may take a long while.
2021-08-26 15:50:05 [DEBUG ] [root] 0 orphaned consumer id(s) found in candlepin.
2021-08-26 15:50:05 [DEBUG ] [root] Candlepin orphaned consumers: []
2021-08-26 15:50:05 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/30-upgrade.rb returned nil
2021-08-26 15:50:05 [DEBUG ] [post] cdn_ssl_version already migrated, skipping
2021-08-26 15:50:05 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/31-cdn_setting.rb returned true
2021-08-26 15:50:05 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/34-pulpcore_directory_layout.rb returned nil
2021-08-26 15:50:05 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/99-post_install_message.rb returned nil
2021-08-26 15:50:05 [INFO  ] [root] Package versions are being locked.
2021-08-26 15:50:05 [DEBUG ] [root] Executing: foreman-maintain packages lock --assumeyes
2021-08-26 15:50:10 [DEBUG ] [root] Running preparation steps required to run the next scenarios
2021-08-26 15:50:10 [DEBUG ] [root] ================================================================================
2021-08-26 15:50:10 [DEBUG ] [root] Check if tooling for package locking is installed:                    ESC[32mESC[1m[OK]ESC[0m
2021-08-26 15:50:10 [DEBUG ] [root] --------------------------------------------------------------------------------
2021-08-26 15:50:10 [DEBUG ] [root] 
2021-08-26 15:50:10 [DEBUG ] [root] 
2021-08-26 15:50:10 [DEBUG ] [root] Running locking of package versions
2021-08-26 15:50:10 [DEBUG ] [root] ================================================================================
2021-08-26 15:50:10 [DEBUG ] [root] Lock packages:                                                        ESC[32mESC[1m[OK]ESC[0m
2021-08-26 15:50:10 [DEBUG ] [root] --------------------------------------------------------------------------------
2021-08-26 15:50:10 [DEBUG ] [root] 
2021-08-26 15:50:10 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/99-version_locking.rb returned nil
2021-08-26 15:50:10 [INFO  ] [post] All hooks in group post finished
2021-08-26 15:50:10 [DEBUG ] [root] Exit with status code: 2 (signal was 2)
2021-08-26 15:50:10 [DEBUG ] [root] Cleaning /tmp/kafo_installation20210826-13939

2- Installed the 6.10 Snap18 and checked the installer logs and I didn't see "upgrade:run" and "katello:correct_repositories" details in satellite log.

2021-09-13 13:25:05 [NOTICE] [configure] System configuration has finished.
2021-09-13 13:25:05 [INFO  ] [post] Executing hooks in group post
2021-09-13 13:25:05 [DEBUG ] [post] Hook /usr/share/foreman-installer/katello/hooks/post/25-register_with_insights.rb returned nil
2021-09-13 13:25:05 [DEBUG ] [post] cdn_ssl_version already migrated, skipping
2021-09-13 13:25:05 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/31-cdn_setting.rb returned true
2021-09-13 13:25:05 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/34-pulpcore_directory_layout.rb returned nil
2021-09-13 13:25:05 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/99-post_install_message.rb returned nil
2021-09-13 13:25:05 [INFO  ] [root] Package versions are being locked.
2021-09-13 13:25:05 [DEBUG ] [root] Executing: foreman-maintain packages lock --assumeyes
2021-09-13 13:25:10 [DEBUG ] [root] Running preparation steps required to run the next scenarios
2021-09-13 13:25:10 [DEBUG ] [root] ================================================================================
2021-09-13 13:25:10 [DEBUG ] [root] Check if tooling for package locking is installed:                    ESC[32mESC[1m[OK]ESC[0m
2021-09-13 13:25:10 [DEBUG ] [root] --------------------------------------------------------------------------------
2021-09-13 13:25:10 [DEBUG ] [root] 
2021-09-13 13:25:10 [DEBUG ] [root] 
2021-09-13 13:25:10 [DEBUG ] [root] Running locking of package versions
2021-09-13 13:25:10 [DEBUG ] [root] ================================================================================
2021-09-13 13:25:10 [DEBUG ] [root] Lock packages:                                                        ESC[32mESC[1m[OK]ESC[0m
2021-09-13 13:25:10 [DEBUG ] [root] --------------------------------------------------------------------------------
2021-09-13 13:25:10 [DEBUG ] [root] 
2021-09-13 13:25:10 [DEBUG ] [post] Hook /usr/share/foreman-installer/hooks/post/99-version_locking.rb returned nil
2021-09-13 13:25:10 [INFO  ] [post] All hooks in group post finished
2021-09-13 13:25:10 [DEBUG ] [root] Exit with status code: 2 (signal was 2)
2021-09-13 13:25:10 [DEBUG ] [root] Cleaning /tmp/kafo_installation20210913-2888-fkz2fk
2021-09-13 13:25:10 [DEBUG ] [root] Cleaning /tmp/kafo_installation20210913-2888-pr7y92
2021-09-13 13:25:10 [DEBUG ] [root] Cleaning /tmp/default_values.yaml
2021-09-13 13:25:10 [DEBUG ] [root] Installer finished in 1437.279444857 seconds

3- Verified fixed in package version

# rpm -qa|grep foreman-installer
foreman-installer-2.5.2.4-1.el7sat.noarch

Comment 5 errata-xmlrpc 2021-11-16 14:13:42 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 (Moderate: Satellite 6.10 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-2021:4702