Bug 2034552

Summary: Puppet disable command fails on Capsule
Product: Red Hat Satellite Reporter: Vladimír Sedmík <vsedmik>
Component: Satellite MaintainAssignee: Amit Upadhye <aupadhye>
Status: CLOSED ERRATA QA Contact: Vladimír Sedmík <vsedmik>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: apatel, aupadhye, kgaikwad, pcreech
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-1.0.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:31: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:
Embargoed:

Description Vladimír Sedmík 2021-12-21 09:53:49 UTC
Description of problem:
On Capsule the command to disable puppet plugin fails with "undefined method `services' for nil:NilClass".


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


How reproducible:
always


Steps to Reproduce:
1. Have 7.0 Capsule registered to Satellite
2. Enable puppet:
# satellite-installer --foreman-proxy-puppet true \
--foreman-proxy-puppetca true \
--foreman-proxy-content-puppet true \
--enable-puppet \
--puppet-server true \
--puppet-server-foreman-ssl-ca /etc/pki/katello/puppet/puppet_client_ca.crt \
--puppet-server-foreman-ssl-cert /etc/pki/katello/puppet/puppet_client.crt \
--puppet-server-foreman-ssl-key /etc/pki/katello/puppet/puppet_client.key
3. Try to disable puppet:
# foreman-maintain plugin purge-puppet


Actual results:
Running Remove Puppet feature
================================================================================
Remove Puppet feature:                                                [FAIL]
undefined method `services' for nil:NilClass
--------------------------------------------------------------------------------
Scenario [Remove Puppet feature] failed.

The following steps ended up in failing state:

  [puppet-remove-puppet]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="puppet-remove-puppet"



Expected results:
Successful run

Comment 1 Amit Upadhye 2022-01-18 07:53:47 UTC
Created redmine issue https://projects.theforeman.org/issues/34278 from this bug

Comment 2 Bryan Kearney 2022-01-25 20:05:09 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34278 has been resolved.

Comment 3 Vladimír Sedmík 2022-02-08 14:07:08 UTC
The original error was resolved, which uncovered another issue when using `--remove-all-data` option:

# foreman-maintain plugin purge-puppet --remove-all-data
Running Remove Puppet feature
================================================================================
Remove Puppet feature:                                                [OK]
--------------------------------------------------------------------------------
Remove Puppet data:                                                   [FAIL]
Failed executing foreman-rake purge:puppet, exit status 127:
 sh: foreman-rake: command not found
--------------------------------------------------------------------------------
Scenario [Remove Puppet feature] failed.

The following steps ended up in failing state:

  [puppet-remove-puppet-data]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="puppet-remove-puppet-data"

Comment 4 Vladimír Sedmík 2022-02-14 10:57:59 UTC
Verified on 7.0 snap 9

Comment 8 errata-xmlrpc 2022-07-05 14:31: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 (Moderate: Satellite 6.11 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-2022:5498