Bug 1323737

Summary: Installing package satellite should not install optional plugins
Product: Red Hat Satellite Reporter: Marek Hulan <mhulan>
Component: InstallerAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, cwelton, ehelms, inecas, kbidarka, lpramuk, lzap
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: satellite-6.2.0-9.0.beta Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:40:12 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:

Description Marek Hulan 2016-04-04 14:45:29 UTC
Description of problem:

satellite package has dependencies which installs plugins like discovery. If discovery is not enabled in installer, custom installation logic is missing even though user can see plugin being installed in UI.

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

satellite-6.2.0-6.1.beta.el7sat.noarch

How reproducible:

always

Steps to Reproduce:
1. yum install satellite
2. rpm -q tfm-rubygem-foreman_discovery-5.0.0.3-1.el7sat.noarch
3. 

Actual results:

tfm-rubygem-foreman_discovery-5.0.0.3-1.el7sat.noarch

Expected results:

package is not installed


Additional info:

Comment 2 Ivan Necas 2016-04-15 11:50:42 UTC
Proposing this as a blocker, as it can lead to issues when upgradnig from 6.1, such as 

https://github.com/theforeman/foreman_discovery/pull/268

The problem here is, some old migrations have issues of touching active record objects when migrating data. The first migration is run as part of postrans phase in the spec:

   https://github.com/theforeman/foreman-packaging/blob/rpm/1.11/foreman/foreman.spec#L771

The presence of additional plugins as the package dependency increases a chance of the migration to fail, because some code is relying on migrations that have not happened yet. A workaround would be to uninstall the plugin first, migrate and then install again, with the installer. But since we have the plugins as dependencies in the main package, it makes it look like one is uninstalling the whole satellite.

Comment 3 Ivan Necas 2016-04-15 11:53:11 UTC
The corresponding merge request:

https://gitlab.sat.lab.tlv.redhat.com/satellite6/satellite-packaging/merge_requests/16

Comment 4 Lukas Zapletal 2016-04-18 14:04:45 UTC
Copy of my gitlab comment:

I don't understand how this solves the situation. It only postpones it a bit as when user executes our installer with --enable-plugin-xyz our installer will (IIUC) make the initial migration with all the listed plugins installed. And we have this in our documentation to do that.

Comment 5 Marek Hulan 2016-04-18 14:22:49 UTC
When you enable plugin xyz, then also custom puppet code that configures the xyz plugin is run and does the full plugin installation.

Comment 6 Ivan Necas 2016-04-18 14:55:47 UTC
It helps also with the migration a bit, because the first migration happens at `yum update` phase, where the remote execution (and other plugins that might collide with some old migration using active records for data manipulation), and then the rest of migrations of plugins (that usually don't do the data manipulation and are therefore safer to run) happen in separate run.

Long story short - you would not hit the migration issues with remote execution, because the migration would happen before. It also give us more space for workaround temporarily uninstalling some plugins.

Comment 7 Lukas Pramuk 2016-04-20 16:01:42 UTC
VERIFIED.

satellite-6.2.0-9.0.beta.el7sat.noarch

REPRO:
# rpm -qR satellite | grep foreman_discovery
tfm-rubygem(foreman_discovery)

# rpm -q --whatrequires 'tfm-rubygem(foreman_discovery)'
satellite-6.2.0-8.2.beta.el7sat.noarch

vs.

FIX:
# rpm -qR satellite | grep foreman_discovery
<emtpy>

# rpm -q --whatrequires 'tfm-rubygem(foreman_discovery)'
no package requires tfm-rubygem(foreman_discovery)

Comment 8 Kedar Bidarkar 2016-04-22 08:01:18 UTC
Also OSCAP packages no longer get installed along with installation of satellite package.

this package tfm-rubygem-foreman_openscap-0.5.3.4-1.el7sat.noarch was not installed.

rpm -q --whatrequires tfm-rubygem-foreman_openscap
no package requires tfm-rubygem-foreman_openscap

Comment 9 Bryan Kearney 2016-07-27 11:40:12 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, 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/RHBA-2016:1501